aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-15 04:54:11 +0100
committerSven Göthel <[email protected]>2024-02-15 04:54:11 +0100
commit6b548c2408b08128a686eef49118d35543a3667d (patch)
tree555df00149ed624b18863091f2566816d1465fca
parent57732e298fa7249e4b772108543f9aebbc6000ac (diff)
TestTextRendererNEWT20: Fix fontSet override at main + add some glyph info in demo text
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/GPUTextRendererListenerBase01.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java10
2 files changed, 22 insertions, 4 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/GPUTextRendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/GPUTextRendererListenerBase01.java
index 8c5abbc2f..13ef8450b 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/GPUTextRendererListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/GPUTextRendererListenerBase01.java
@@ -381,6 +381,22 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
dy += ( -headbox.getHeight() - font.getLineHeight() ) * pixelSizeCenter;
{
+ final String mg_s = font.getGlyph('M').toString()+"\n"+font.getGlyph('X').toString();
+ pmv.pushMv();
+ // System.err.printf("Head: [%f %f] -> [%f %f]%n", dx, dy, nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy));
+ pmv.translateMv(nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy), nearPlaneZ0);
+ {
+ final float sxy = nearPlaneS * pixelSizeFName;
+ pmv.scaleMv(sxy, sxy, 1.0f);
+ }
+ // pmv.glTranslatef(x0, y1, z0);
+ final AABBox box = textRegionUtil.drawString3D(gl, renderer, font, mg_s, null);
+ pmv.popMv();
+
+ dy += ( -box.getHeight() - font.getLineHeight() ) * pixelSizeFName;
+ }
+
+ {
pmv.pushMv();
pmv.translateMv(nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy), nearPlaneZ0);
// System.err.printf("Bottom: [%f %f] -> [%f %f]%n", dx, dy, nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy));
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java
index 7d6a9bff2..5dbdcb5f6 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java
@@ -76,10 +76,12 @@ public class TestTextRendererNEWT20 extends UITestCase {
@BeforeClass
public static void setup() {
- try {
- fontSet = FontSet01.getSet00();
- } catch (final IOException e) {
- e.printStackTrace();
+ if( fontSet.length == 0 ) {
+ try {
+ fontSet = FontSet01.getSet00();
+ } catch (final IOException e) {
+ e.printStackTrace();
+ }
}
}