From 6b548c2408b08128a686eef49118d35543a3667d Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Thu, 15 Feb 2024 04:54:11 +0100 Subject: TestTextRendererNEWT20: Fix fontSet override at main + add some glyph info in demo text --- .../test/junit/graph/GPUTextRendererListenerBase01.java | 16 ++++++++++++++++ .../opengl/test/junit/graph/TestTextRendererNEWT20.java | 10 ++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'src/test/com') 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 @@ -380,6 +380,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); 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(); + } } } -- cgit v1.2.3