processingjs text rendering problem
in
Processing with Other Languages
•
5 months ago
Hi,
I'm in trouble with text rendering in processingjs and firefox(but I didn't tried other browers), the text is cropped at the base, I can't figure out why, here is the image sample:
Can someone help me?
I've also tryed with the "/* @pjs font */ directive" but the problem is still there....
Here is menu.pde:
Here is interface.js
Here is test.html
I'm in trouble with text rendering in processingjs and firefox(but I didn't tried other browers), the text is cropped at the base, I can't figure out why, here is the image sample:
Can someone help me?
I've also tryed with the "/* @pjs font */ directive" but the problem is still there....
Here is menu.pde:
- void setup() {
size(1024, 650, OPENGL);
textFont(createFont("Verdana", 20));
//textMode(SHAPE); // this won't work
colorMode(HSB, 200);
}
void draw() {
background(0,0,200);
fill(0,0,0);
text("test text ajyt", 0, 20);
}
Here is interface.js
var sketch;
window.onload = function () {
tryFindSketch();
}
function tryFindSketch () {
sketch = Processing.getInstanceById(getProcessingSketchId());
if ( sketch == undefined ) return setTimeout(tryFindSketch, 200);
}
Here is test.html
- <!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>test</title>
<!--[if lt IE 9]>
<script type="text/javascript">alert("Your browser does not support the canvas tag.");</script>
<![endif]-->
<script src="processing.js" type="text/javascript"></script>
<script type="text/javascript">
// convenience function to get the id attribute of generated sketch html element
function getProcessingSketchId () { return 'menu'; }
</script>
<script src="interface.js" type="text/javascript"></script>
</head>
<body>
<canvas data-processing-sources="menu.pde" id="menu">
<p>Your browser does not support the canvas tag.</p>
</canvas>
<noscript>
<p>JavaScript is required to view the contents of this page.</p>
</noscript>
</body>
</html>
1