diff options
Diffstat (limited to 'src/test/com')
12 files changed, 1431 insertions, 129 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/FontSet01.java b/src/test/com/jogamp/opengl/test/junit/graph/FontSet01.java index a2dc8430d..c2f2de020 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/FontSet01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/FontSet01.java @@ -15,21 +15,21 @@ public class FontSet01 { fonts[i++] = FontFactory.get(FontFactory.UBUNTU).get(FontSet.FAMILY_LIGHT, FontSet.STYLE_NONE); fonts[i++] = FontFactory.get(FontFactory.UBUNTU).get(FontSet.FAMILY_LIGHT, FontSet.STYLE_ITALIC); fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMono.ttf", - TestTextRendererNEWTBugXXXX.class.getClassLoader(), TestTextRendererNEWTBugXXXX.class).getInputStream(), true); + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMonoBold.ttf", - TestTextRendererNEWTBugXXXX.class.getClassLoader(), TestTextRendererNEWTBugXXXX.class).getInputStream(), true); + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSans.ttf", - TestTextRendererNEWTBugXXXX.class.getClassLoader(), TestTextRendererNEWTBugXXXX.class).getInputStream(), true); + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSansBold.ttf", - TestTextRendererNEWTBugXXXX.class.getClassLoader(), TestTextRendererNEWTBugXXXX.class).getInputStream(), true); + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerif.ttf", - TestTextRendererNEWTBugXXXX.class.getClassLoader(), TestTextRendererNEWTBugXXXX.class).getInputStream(), true); + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifBold.ttf", - TestTextRendererNEWTBugXXXX.class.getClassLoader(), TestTextRendererNEWTBugXXXX.class).getInputStream(), true); + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifBoldItalic.ttf", - TestTextRendererNEWTBugXXXX.class.getClassLoader(), TestTextRendererNEWTBugXXXX.class).getInputStream(), true); + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifItalic.ttf", - TestTextRendererNEWTBugXXXX.class.getClassLoader(), TestTextRendererNEWTBugXXXX.class).getInputStream(), true); + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); return fonts; } } diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java index 790315354..22c9af424 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java @@ -17,6 +17,7 @@ import com.jogamp.opengl.GLPipelineFactory; import com.jogamp.opengl.GLRunnable; import com.jogamp.common.net.Uri; +import com.jogamp.common.util.IOUtil; import com.jogamp.common.util.InterruptSource; import com.jogamp.graph.curve.Region; import com.jogamp.graph.curve.opengl.RegionRenderer; @@ -35,6 +36,7 @@ import com.jogamp.newt.event.MouseEvent.PointerClass; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.math.FloatUtil; import com.jogamp.opengl.math.VectorUtil; +import com.jogamp.opengl.test.junit.graph.FontSet01; import com.jogamp.opengl.test.junit.graph.demos.ui.CrossHair; import com.jogamp.opengl.test.junit.graph.demos.ui.GLEventListenerButton; import com.jogamp.opengl.test.junit.graph.demos.ui.Label; @@ -65,24 +67,24 @@ public class GPUUISceneGLListener0A implements GLEventListener { private int renderModes; private RegionRenderer renderer; - private final int fontSet = FontFactory.UBUNTU; - private Font font; + private final Font font; + private final Font fontFPS; private final float sceneDist = 3000f; private final float zNear = 0.1f, zFar = 7000f; - private final float relTop = 5f/6f; - private final float relMiddle = 2f/6f; - private final float relLeft = 1f/6f; + private final float relTop = 80f/100f; + private final float relMiddle = 22f/100f; + private final float relLeft = 11f/100f; /** Proportional Button Size to Window Height, per-vertical-pixels [PVP] */ private final float buttonYSizePVP = 0.084f; - private final float buttonXSizePVP = 0.105f; + private final float buttonXSizePVP = 0.084f; // 0.105f; private final float fontSizePt = 10f; /** Proportional Font Size to Window Height for Main Text, per-vertical-pixels [PVP] */ private final float fontSizeFixedPVP = 0.04f; /** Proportional Font Size to Window Height for FPS Status Line, per-vertical-pixels [PVP] */ - private final float fontSizeFpsPVP = 0.04f; + private final float fontSizeFpsPVP = 0.03f; private float dpiH = 96; /** @@ -112,6 +114,20 @@ public class GPUUISceneGLListener0A implements GLEventListener { private final String jogamp = "JogAmp - Jogl Graph Module Demo"; private final String truePtSize = fontSizePt+" pt font size label - true scale!"; + private final String longText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec \n"+ + "Ut purus odio, rhoncus sit amet commodo eget, ullamcorper vel\n"+ + "quam iaculis urna cursus ornare. Nullam ut felis a ante ultrices\n"+ + "In hac habitasse platea dictumst. Vivamus et mi a quam lacinia\n"+ + "Morbi quis bibendum nibh. Donec lectus orci, sagittis in consequat\n"+ + "Donec ut dolor et nulla tristique varius. In nulla magna, fermentum\n"+ + "in lorem. Maecenas in ipsum ac justo scelerisque sollicitudin.\n"+ + "\n"+ + "Lyford’s in Texas & L’Anse-aux-Griffons in Québec;\n"+ + "Kwikpak on the Yukon delta, Kvæven in Norway, Kyulu in Kenya, not Rwanda.…\n"+ + "Ytterbium in the periodic table. Are Toussaint L’Ouverture, Wölfflin, Wolfe,\n"+ + "\n"+ + "The quick brown fox jumps over the lazy dog\n"; + public GPUUISceneGLListener0A() { this(0); } @@ -120,14 +136,14 @@ public class GPUUISceneGLListener0A implements GLEventListener { * @param noAADPIThreshold see {@link #DefaultNoAADPIThreshold} */ public GPUUISceneGLListener0A(final float noAADPIThreshold) { - this(noAADPIThreshold, false, false); + this(null, noAADPIThreshold, false, false); } /** * @param renderModes */ public GPUUISceneGLListener0A(final int renderModes) { - this(renderModes, false, false); + this(null, renderModes, false, false); } /** @@ -135,8 +151,8 @@ public class GPUUISceneGLListener0A implements GLEventListener { * @param debug * @param trace */ - public GPUUISceneGLListener0A(final int renderModes, final boolean debug, final boolean trace) { - this(0f, renderModes, debug, trace); + public GPUUISceneGLListener0A(final String fontfilename, final int renderModes, final boolean debug, final boolean trace) { + this(fontfilename, 0f, renderModes, debug, trace); } /** @@ -144,11 +160,11 @@ public class GPUUISceneGLListener0A implements GLEventListener { * @param debug * @param trace */ - public GPUUISceneGLListener0A(final float noAADPIThreshold, final boolean debug, final boolean trace) { - this(noAADPIThreshold, 0, debug, trace); + public GPUUISceneGLListener0A(final String fontfilename, final float noAADPIThreshold, final boolean debug, final boolean trace) { + this(fontfilename, noAADPIThreshold, 0, debug, trace); } - private GPUUISceneGLListener0A(final float noAADPIThreshold, final int renderModes, final boolean debug, final boolean trace) { + private GPUUISceneGLListener0A(final String fontfilename, final float noAADPIThreshold, final int renderModes, final boolean debug, final boolean trace) { this.noAADPIThreshold = noAADPIThreshold; this.rs = RenderState.createRenderState(SVertex.factory()); this.debug = debug; @@ -157,7 +173,18 @@ public class GPUUISceneGLListener0A implements GLEventListener { this.renderModes = renderModes; try { - font = FontFactory.get(FontFactory.UBUNTU).getDefault(); + if( null == fontfilename ) { + font = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerif.ttf", + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); + } else { + font = FontFactory.get( new File( fontfilename ) ); + } + System.err.println("Font "+font.getFullFamilyName()); + + fontFPS = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMonoBold.ttf", + FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true); + System.err.println("Font FPS "+fontFPS.getFullFamilyName()); + } catch (final IOException ioe) { throw new RuntimeException(ioe); } @@ -254,7 +281,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { button.addMouseListener(dragZoomRotateListener); buttons.add(button); - button = new LabelButton(SVertex.factory(), renderModes, font, "v-sync", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "V-Sync", buttonXSize, buttonYSize); button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f); button.setToggleable(true); button.setToggle(gl.getSwapInterval()>0); @@ -277,7 +304,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { button.addMouseListener(dragZoomRotateListener); buttons.add(button); - button = new LabelButton(SVertex.factory(), renderModes, font, "< tilt >", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "< Tilt >", buttonXSize, buttonYSize); button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f); button.addMouseListener(new UIShape.MouseGestureAdapter() { @Override @@ -299,7 +326,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { buttons.add(button); if( pass2Mode ) { // second column to the left - button = new LabelButton(SVertex.factory(), renderModes, font, "< samples >", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "< Samples >", buttonXSize, buttonYSize); button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f); button.addMouseListener(new UIShape.MouseGestureAdapter() { @Override @@ -321,7 +348,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { button.addMouseListener(dragZoomRotateListener); buttons.add(button); - button = new LabelButton(SVertex.factory(), renderModes, font, "< quality >", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "< Quality >", buttonXSize, buttonYSize); button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f); button.addMouseListener(new UIShape.MouseGestureAdapter() { @Override @@ -376,7 +403,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { { final int j = 1; // column int k = 0; // row - button = new LabelButton(SVertex.factory(), renderModes, font, "y flip", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "Y Flip", buttonXSize, buttonYSize); button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f); button.addMouseListener(new UIShape.MouseGestureAdapter() { @Override @@ -387,7 +414,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { buttons.add(button); k++; - button = new LabelButton(SVertex.factory(), renderModes, font, "x flip", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "X Flip", buttonXSize, buttonYSize); button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f); button.addMouseListener(new UIShape.MouseGestureAdapter() { @Override @@ -425,7 +452,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { buttons.add(button); k++; - button = new LabelButton(SVertex.factory(), renderModes, font, "< space >", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "< Space >", buttonXSize, buttonYSize); button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f); button.addMouseListener(new UIShape.MouseGestureAdapter() { @Override @@ -449,7 +476,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { buttons.add(button); k++; - button = new LabelButton(SVertex.factory(), renderModes, font, "< corner >", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "< Corner >", buttonXSize, buttonYSize); button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f); button.addMouseListener(new UIShape.MouseGestureAdapter() { @Override @@ -474,7 +501,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { buttons.add(button); k++; - button = new LabelButton(SVertex.factory(), renderModes, font, "reset", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "Reset", buttonXSize, buttonYSize); button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f); button.addMouseListener(new UIShape.MouseGestureAdapter() { @Override @@ -485,7 +512,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { buttons.add(button); k++; - button = new LabelButton(SVertex.factory(), renderModes, font, "screenshot", buttonXSize, buttonYSize); + button = new LabelButton(SVertex.factory(), renderModes, font, "Snapshot", buttonXSize, buttonYSize); button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f); button.addMouseListener(new UIShape.MouseGestureAdapter() { @Override @@ -646,17 +673,13 @@ public class GPUUISceneGLListener0A implements GLEventListener { "MNOPQRSTUVWXYZ\n"+ "0123456789.:,;(*!?/\\\")$%^&-+@~#<>{}[]"; - strings[i++] = "The quick brown fox\njumps over the lazy\ndog"; + strings[i++] = "The quick brown fox jumps over the lazy dog"; - strings[i++] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec \n"+ - "Ut purus odio, rhoncus sit amet commodo eget, ullamcorper vel\n"+ - "quam iaculis urna cursus ornare. Nullam ut felis a ante ultrices\n"+ - "In hac habitasse platea dictumst. Vivamus et mi a quam lacinia\n"+ - "Morbi quis bibendum nibh. Donec lectus orci, sagittis in consequat\n"+ - "Donec ut dolor et nulla tristique varius. In nulla magna, fermentum\n"+ - "in lorem. Maecenas in ipsum ac justo scelerisque sollicitudin.\n"; + strings[i++] = longText; labels = new Label[i]; + + currentText = strings.length - 1; } @@ -685,17 +708,20 @@ public class GPUUISceneGLListener0A implements GLEventListener { * [FPS] Display 112.88889 dpi, fontSize 12.0 ppi -> pixelSize 15.679012 */ final float pixelSizeFPS = fontSizeFpsPVP * drawable.getSurfaceHeight(); - fpsLabel = new Label(renderer.getRenderState().getVertexFactory(), renderModes, font, pixelSizeFPS, "Nothing there yet"); + fpsLabel = new Label(renderer.getRenderState().getVertexFactory(), renderModes, fontFPS, pixelSizeFPS, "Nothing there yet"); fpsLabel.addMouseListener(dragZoomRotateListener); sceneUIController.addShape(fpsLabel); fpsLabel.setEnabled(enableOthers); - fpsLabel.setColor(0.3f, 0.3f, 0.3f, 1.0f); + fpsLabel.setColor(0.1f, 0.1f, 0.1f, 1.0f); + fpsLabel.translate(0f, pixelSizeFPS * (fontFPS.getMetrics().getLineGap() - fontFPS.getMetrics().getDescent()), 0f); - crossHairCtr = new CrossHair(renderer.getRenderState().getVertexFactory(), 0, 100f, 100f, 2f); - crossHairCtr.addMouseListener(dragZoomRotateListener); - sceneUIController.addShape(crossHairCtr); - crossHairCtr.setEnabled(true); - crossHairCtr.translate(0f, 0f, -1f); + if( false ) { + crossHairCtr = new CrossHair(renderer.getRenderState().getVertexFactory(), 0, 100f, 100f, 2f); + crossHairCtr.addMouseListener(dragZoomRotateListener); + sceneUIController.addShape(crossHairCtr); + crossHairCtr.setEnabled(true); + crossHairCtr.translate(0f, 0f, -1f); + } initButtons(drawable.getGL().getGL2ES2(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), renderer); for(int i=0; i<buttons.size(); i++) { @@ -779,12 +805,6 @@ public class GPUUISceneGLListener0A implements GLEventListener { gl = gl.getContext().setGL( GLPipelineFactory.create("com.jogamp.opengl.Trace", null, gl, new Object[] { System.err } ) ).getGL2ES2(); } - try { - font = FontFactory.get(fontSet).getDefault(); - } catch (final IOException ioe) { - throw new RuntimeException(ioe); - } - renderer = RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable); rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED); // renderer = RegionRenderer.create(rs, null, null); @@ -848,7 +868,9 @@ public class GPUUISceneGLListener0A implements GLEventListener { System.err.println("Label["+currentText+"] MOVE: "+Arrays.toString(labels[currentText].getTranslate())); } - crossHairCtr.translate(dw/2f, dh/2f, 0f); + if( false ) { + crossHairCtr.translate(dw/2f, dh/2f, 0f); + } sceneUIController.reshape(drawable, x, y, width, height); @@ -923,15 +945,14 @@ public class GPUUISceneGLListener0A implements GLEventListener { final String modeS = Region.getRenderModeString(renderModes); final String text; if( null == actionText ) { - final String timePrec = gl.isGLES() ? "4.0" : "4.1"; - text = String.format("%03.1f/%03.1f fps, v-sync %d, dpi %.1f, fontSize %.1f, %s-samples %d, q %d, td %"+timePrec+"f, blend %b, alpha %d, msaa %d", - lfps, tfps, gl.getSwapInterval(), dpiH, fontSizeFixedPVP, modeS, sceneUIController.getSampleCount(), fpsLabel.getQuality(), td, + text = String.format("%03.1f/%03.1f fps, v-sync %d, dpi %.1f, %s-samples %d, q %d, td %.0f, blend %b, alpha %d, msaa %d", + lfps, tfps, gl.getSwapInterval(), dpiH, modeS, sceneUIController.getSampleCount(), fpsLabel.getQuality(), td, renderer.getRenderState().isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED), drawable.getChosenGLCapabilities().getAlphaBits(), drawable.getChosenGLCapabilities().getNumSamples()); } else { - text = String.format("%03.1f/%03.1f fps, v-sync %d, fontSize %.1f, %s", - lfps, tfps, gl.getSwapInterval(), fontSizeFixedPVP, actionText); + text = String.format("%03.1f/%03.1f fps, v-sync %d, %s", + lfps, tfps, gl.getSwapInterval(), actionText); } fpsLabel.setText(text); } @@ -1004,7 +1025,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { final boolean isOnscreen = PointerClass.Onscreen == e.getPointerType(0).getPointerClass(); if( 0 == ( ~InputEvent.BUTTONALL_MASK & e.getModifiers() ) && !isOnscreen ) { // offscreen vertical mouse wheel zoom - final float tz = 10f*e.getRotation()[1]; // vertical: wheel + final float tz = 100f*e.getRotation()[1]; // vertical: wheel System.err.println("Rotate.Zoom.W: "+tz); shapeEvent.shape.translate(0f, 0f, tz); } else if( isOnscreen || e.isControlDown() ) { diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java index 721fe9cb0..de571ec82 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java @@ -25,16 +25,10 @@ public class GPUUISceneNewtCanvasAWTDemo { static final boolean DEBUG = false; static final boolean TRACE = false; - static int SceneMSAASamples = 0; - static boolean GraphVBAAMode = false; - static boolean GraphMSAAMode = false; - static float GraphAutoMode = GPUUISceneGLListener0A.DefaultNoAADPIThreshold; - - static float[] reqSurfacePixelScale = new float[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE }; - static void setComponentSize(final Component comp, final DimensionImmutable new_sz) { try { javax.swing.SwingUtilities.invokeAndWait(new Runnable() { + @Override public void run() { final java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight()); comp.setMinimumSize(d); @@ -48,6 +42,15 @@ public class GPUUISceneNewtCanvasAWTDemo { } public static void main(final String[] args) throws InterruptedException, InvocationTargetException { + String fontfilename = null; + + int SceneMSAASamples = 0; + boolean GraphVBAAMode = false; + boolean GraphMSAAMode = false; + float GraphAutoMode = GPUUISceneGLListener0A.DefaultNoAADPIThreshold; + + final float[] reqSurfacePixelScale = new float[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE }; + int width = 800, height = 400; int x = 10, y = 10; @@ -77,6 +80,9 @@ public class GPUUISceneNewtCanvasAWTDemo { GraphVBAAMode = true; i++; GraphAutoMode = MiscUtils.atof(args[i], GraphAutoMode); + } else if(args[i].equals("-font")) { + i++; + fontfilename = args[i]; } else if(args[i].equals("-width")) { i++; width = MiscUtils.atoi(args[i], width); @@ -153,8 +159,8 @@ public class GPUUISceneNewtCanvasAWTDemo { window.setSurfaceScale(reqSurfacePixelScale); final float[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new float[2]); - final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) : - new GPUUISceneGLListener0A(rmode, DEBUG, TRACE); + final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(fontfilename, GraphAutoMode, DEBUG, TRACE) : + new GPUUISceneGLListener0A(fontfilename, rmode, DEBUG, TRACE); window.addGLEventListener(sceneGLListener); sceneGLListener.attachInputListenerTo(window); @@ -164,6 +170,7 @@ public class GPUUISceneNewtCanvasAWTDemo { animator.add(window); window.addWindowListener(new WindowAdapter() { + @Override public void windowDestroyed(final WindowEvent e) { animator.stop(); } @@ -175,7 +182,8 @@ public class GPUUISceneNewtCanvasAWTDemo { setComponentSize(newtCanvasAWT, new Dimension(width, height)); frame.add(newtCanvasAWT); SwingUtilities.invokeAndWait(new Runnable() { - public void run() { + @Override + public void run() { frame.pack(); frame.setVisible(true); } diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java index 452909871..0eb0fbf22 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java @@ -15,14 +15,16 @@ public class GPUUISceneNewtDemo { static final boolean DEBUG = false; static final boolean TRACE = false; - static int SceneMSAASamples = 0; - static boolean GraphVBAAMode = false; - static boolean GraphMSAAMode = false; - static float GraphAutoMode = GPUUISceneGLListener0A.DefaultNoAADPIThreshold; + public static void main(final String[] args) { + int SceneMSAASamples = 0; + boolean GraphVBAAMode = false; + boolean GraphMSAAMode = false; + float GraphAutoMode = GPUUISceneGLListener0A.DefaultNoAADPIThreshold; - static float[] reqSurfacePixelScale = new float[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE }; + final float[] reqSurfacePixelScale = new float[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE }; + + String fontfilename = null; - public static void main(final String[] args) { int width = 1280, height = 720; int x = 10, y = 10; @@ -52,6 +54,9 @@ public class GPUUISceneNewtDemo { GraphVBAAMode = true; i++; GraphAutoMode = MiscUtils.atof(args[i], GraphAutoMode); + } else if(args[i].equals("-font")) { + i++; + fontfilename = args[i]; } else if(args[i].equals("-width")) { i++; width = MiscUtils.atoi(args[i], width); @@ -128,8 +133,8 @@ public class GPUUISceneNewtDemo { window.setSurfaceScale(reqSurfacePixelScale); final float[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new float[2]); - final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) : - new GPUUISceneGLListener0A(rmode, DEBUG, TRACE); + final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(fontfilename, GraphAutoMode, DEBUG, TRACE) : + new GPUUISceneGLListener0A(fontfilename, rmode, DEBUG, TRACE); window.addGLEventListener(sceneGLListener); sceneGLListener.attachInputListenerTo(window); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShapeDemo01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/UIShapeDemo01.java index 66fca799e..4b30b0c79 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShapeDemo01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/UIShapeDemo01.java @@ -25,7 +25,7 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. */ -package com.jogamp.opengl.test.junit.graph.demos.ui; +package com.jogamp.opengl.test.junit.graph.demos; import java.io.File; import java.io.IOException; @@ -46,7 +46,9 @@ import com.jogamp.opengl.GLRunnable; import com.jogamp.opengl.fixedfunc.GLMatrixFunc; import com.jogamp.opengl.math.FloatUtil; import com.jogamp.opengl.math.geom.AABBox; -import com.jogamp.opengl.test.junit.graph.demos.MSAATool; +import com.jogamp.opengl.test.junit.graph.demos.ui.CrossHair; +import com.jogamp.opengl.test.junit.graph.demos.ui.LabelButton; +import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape; import com.jogamp.common.util.InterruptSource; import com.jogamp.graph.curve.Region; import com.jogamp.graph.curve.opengl.RegionRenderer; diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UITypeDemo01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/UITypeDemo01.java index 183d81f27..0b372054e 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UITypeDemo01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/UITypeDemo01.java @@ -25,7 +25,7 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. */ -package com.jogamp.opengl.test.junit.graph.demos.ui; +package com.jogamp.opengl.test.junit.graph.demos; import java.io.File; import java.io.IOException; @@ -46,7 +46,12 @@ import com.jogamp.opengl.GLRunnable; import com.jogamp.opengl.fixedfunc.GLMatrixFunc; import com.jogamp.opengl.math.FloatUtil; import com.jogamp.opengl.math.geom.AABBox; -import com.jogamp.opengl.test.junit.graph.demos.MSAATool; +import com.jogamp.opengl.test.junit.graph.demos.ui.CrossHair; +import com.jogamp.opengl.test.junit.graph.demos.ui.Rectangle; +import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape; +import com.jogamp.opengl.test.junit.graph.testshapes.Glyph03FreeMonoRegular_M; +import com.jogamp.opengl.test.junit.graph.testshapes.Glyph04FreeSans_0; +import com.jogamp.opengl.test.junit.graph.testshapes.Glyph05FreeSerifBoldItalic_ae; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.common.util.InterruptSource; import com.jogamp.graph.curve.Region; @@ -90,7 +95,7 @@ public class UITypeDemo01 implements GLEventListener { public static void main(final String[] args) throws IOException { Font font = null; String text = "Hello Origin."; - int glyph_id = 0; + int glyph_id = Glyph.ID_UNKNOWN; if( 0 != args.length ) { for(int i=0; i<args.length; i++) { if(args[i].equals("-font")) { @@ -204,7 +209,7 @@ public class UITypeDemo01 implements GLEventListener { } else { final float scale = 0.15312886f; final float size_xz = 0.541f; - final UIShape o = new TestObject02(SVertex.factory(), renderModes); + final UIShape o = new Glyph03FreeMonoRegular_M(SVertex.factory(), renderModes); o.scale(scale, scale, 1f); // o.translate(size_xz, -size_xz, 0f); testObj = o; @@ -273,8 +278,13 @@ public class UITypeDemo01 implements GLEventListener { pmv.glLoadIdentity(); pmv.glTranslatef(xTran, yTran, zTran); renderer.enable(gl, true); - drawShape(gl, pmv, renderer, testObj); - drawShape(gl, pmv, renderer, crossHair); + { + pmv.glPushMatrix(); + pmv.glScalef(0.8f, 0.8f, 1f); + drawShape(gl, pmv, renderer, testObj); + pmv.glPopMatrix(); + } + // drawShape(gl, pmv, renderer, crossHair); { final float full_width_o; final float full_height_o; @@ -300,10 +310,14 @@ public class UITypeDemo01 implements GLEventListener { full_width_o = objCoord1[0] - objCoord0[0]; full_height_o = objCoord1[1] - objCoord0[1]; } + pmv.glPushMatrix(); + final Font.Glyph glyph; - if( Glyph.ID_UNKNOWN != glyph_id ) { + if( Glyph.ID_UNKNOWN < glyph_id ) { glyph = font.getGlyph(glyph_id); - System.err.println("glyph_id "+glyph_id+": "+glyph); + if( once ) { + System.err.println("glyph_id "+glyph_id+": "+glyph); + } } else { glyph = null; } @@ -312,7 +326,6 @@ public class UITypeDemo01 implements GLEventListener { final float full_width_s = full_width_o / txt_box_em.getWidth(); final float full_height_s = full_height_o / txt_box_em.getHeight(); final float txt_scale = full_width_s < full_height_s ? full_width_s/2f : full_height_s/2f; - pmv.glPushMatrix(); pmv.glScalef(txt_scale, txt_scale, 1f); pmv.glTranslatef(-txt_box_em.getWidth(), 0f, 0f); if( null != glyph.getShape() ) { @@ -328,14 +341,12 @@ public class UITypeDemo01 implements GLEventListener { System.err.println("XXX: txt_scale: "+txt_scale); System.err.println("XXX: txt_box_em "+txt_box_em); System.err.println("XXX: txt_box_e2 "+txt_box_em2); - once = false; } - } else { + } else if( Glyph.ID_UNKNOWN == glyph_id ) { final AABBox txt_box_em = font.getGlyphBounds(text); final float full_width_s = full_width_o / txt_box_em.getWidth(); final float full_height_s = full_height_o / txt_box_em.getHeight(); final float txt_scale = full_width_s < full_height_s ? full_width_s/2f : full_height_s/2f; - pmv.glPushMatrix(); pmv.glScalef(txt_scale, txt_scale, 1f); pmv.glTranslatef(-txt_box_em.getWidth(), 0f, 0f); final AABBox txt_box_r = TextRegionUtil.drawString3D(gl, renderModes, renderer, font, text, fg_color, sampleCount); @@ -347,14 +358,21 @@ public class UITypeDemo01 implements GLEventListener { System.err.println("XXX: txt_box_em "+txt_box_em); System.err.println("XXX: txt_box_e2 "+txt_box_em2); System.err.println("XXX: txt_box_rg "+txt_box_r); - once = false; } } pmv.glPopMatrix(); + if( once ) { + try { + printScreen(drawable); + } catch (GLException | IOException e) { + e.printStackTrace(); + } + } + once = false; } renderer.enable(gl, false); } - static boolean once = true; + private boolean once = true; @Override public void dispose(final GLAutoDrawable drawable) { @@ -391,17 +409,22 @@ public class UITypeDemo01 implements GLEventListener { window.removeMouseListener(mouseAction); } - public void printScreen(final GLAutoDrawable drawable, final String dir, final String tech, final String objName, final boolean exportAlpha) throws GLException, IOException { - final StringWriter sw = new StringWriter(); - final PrintWriter pw = new PrintWriter(sw); - pw.printf("-%03dx%03d-Z%04d-T%04d-%s", drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), (int)Math.abs(zTran), 0, objName); + public void printScreen(final GLAutoDrawable drawable) throws GLException, IOException { + final String dir = "./"; + final String tech="demo-"+Region.getRenderModeString(renderModes); + final String objName = "snap"+screenshot_num; + { + final StringWriter sw = new StringWriter(); + final PrintWriter pw = new PrintWriter(sw); + pw.printf("-%03dx%03d-Z%04d-T%04d-%s", drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), (int)Math.abs(zTran), 0, objName); - final String filename = dir + tech + sw +".png"; - if(screenshot.readPixels(drawable.getGL(), false)) { - screenshot.write(new File(filename)); + final String filename = dir + tech + sw +".png"; + if(screenshot.readPixels(drawable.getGL(), false)) { + screenshot.write(new File(filename)); + } } + screenshot_num++; } - int screenshot_num = 0; public void setIgnoreInput(final boolean v) { @@ -575,9 +598,7 @@ public class UITypeDemo01 implements GLEventListener { @Override public boolean run(final GLAutoDrawable drawable) { try { - final String type = Region.getRenderModeString(renderModes); - printScreen(drawable, "./", "demo-"+type, "snap"+screenshot_num, false); - screenshot_num++; + printScreen(drawable); } catch (final GLException e) { e.printStackTrace(); } catch (final IOException e) { diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java index 59514375c..4ea341fba 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java @@ -43,9 +43,9 @@ import com.jogamp.opengl.math.geom.AABBox; */ public class LabelButton extends RoundButton { /** {@value} */ - public static final float DEFAULT_SPACING_X = 0.08f; + public static final float DEFAULT_SPACING_X = 0.12f; /** {@value} */ - public static final float DEFAULT_SPACING_Y = 0.40f; + public static final float DEFAULT_SPACING_Y = 0.42f; private static final float DEFAULT_2PASS_LABEL_ZOFFSET = -0.005f; // -0.05f; diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TestObject01.java b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph01UbuntuLight_o.java index d2bff1fee..f1ef69800 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TestObject01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph01UbuntuLight_o.java @@ -25,10 +25,10 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. */ -package com.jogamp.opengl.test.junit.graph.demos.ui; +package com.jogamp.opengl.test.junit.graph.testshapes; import com.jogamp.opengl.GL2ES2; - +import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape; import com.jogamp.graph.curve.OutlineShape; import com.jogamp.graph.curve.opengl.RegionRenderer; import com.jogamp.graph.geom.Vertex; @@ -37,10 +37,12 @@ import com.jogamp.graph.geom.plane.Winding; /** * GPU based resolution independent test object + * - Ubuntu-Light, lower case 'o' + * - TTF Shape for Glyph 82 */ -public class TestObject01 extends UIShape { +public class Glyph01UbuntuLight_o extends UIShape { - public TestObject01(final Factory<? extends Vertex> factory, final int renderModes) { + public Glyph01UbuntuLight_o(final Factory<? extends Vertex> factory, final int renderModes) { super(factory, renderModes); } @@ -57,7 +59,7 @@ public class TestObject01 extends UIShape { protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) { final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory()); - // lower case 'o' + // Ubuntu-Light, lower case 'o' // Start TTF Shape for Glyph 82 if( false ) { // Original Outer shape: Winding.CW @@ -131,7 +133,7 @@ public class TestObject01 extends UIShape { // Shape.QuadTo: shape.addVertex(0, 0.527000f, 0.319000f, false); shape.addVertex(0, 0.527000f, 0.258000f, true); - System.err.println("TestObject01.shape01a.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph01UbuntuLight_o.shape01a.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } else { // Outer shape: Winding.CW @@ -205,9 +207,9 @@ public class TestObject01 extends UIShape { // Shape.QuadTo: shape.addVertex(0.527000f, 0.319000f, false); shape.addVertex(0.527000f, 0.258000f, true); - System.err.println("TestObject01.shape01b.1.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph01UbuntuLight_o.shape01b.1.winding_area: "+shape.getWindingOfLastOutline()); shape.setWindingOfLastOutline(Winding.CCW); - System.err.println("TestObject01.shape01b.2.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph01UbuntuLight_o.shape01b.2.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } @@ -251,7 +253,7 @@ public class TestObject01 extends UIShape { // Shape.QuadTo: shape.addVertex(0, 0.458000f, 0.161000f, false); shape.addVertex(0, 0.458000f, 0.258000f, true); - System.err.println("TestObject01.shape02a.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph01UbuntuLight_o.shape02a.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } else { // Inner shape: Winding.CCW @@ -295,7 +297,7 @@ public class TestObject01 extends UIShape { shape.addVertex(0.458000f, 0.161000f, false); shape.addVertex(0.458000f, 0.258000f, true); - System.err.println("TestObject01.shape02b.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph01UbuntuLight_o.shape02b.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } // End Shape for Glyph 82 diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TestObject02.java b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph02UbuntuLight_ae.java index fe1d965ee..0b024f970 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TestObject02.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph02UbuntuLight_ae.java @@ -25,10 +25,10 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. */ -package com.jogamp.opengl.test.junit.graph.demos.ui; +package com.jogamp.opengl.test.junit.graph.testshapes; import com.jogamp.opengl.GL2ES2; - +import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape; import com.jogamp.graph.curve.OutlineShape; import com.jogamp.graph.curve.opengl.RegionRenderer; import com.jogamp.graph.geom.Vertex; @@ -36,10 +36,12 @@ import com.jogamp.graph.geom.Vertex.Factory; /** * GPU based resolution independent test object + * - Ubuntu-Light, lower case 'æ' + * - TTF Shape for Glyph 193 */ -public class TestObject02 extends UIShape { +public class Glyph02UbuntuLight_ae extends UIShape { - public TestObject02(final Factory<? extends Vertex> factory, final int renderModes) { + public Glyph02UbuntuLight_ae(final Factory<? extends Vertex> factory, final int renderModes) { super(factory, renderModes); } @@ -56,7 +58,7 @@ public class TestObject02 extends UIShape { protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) { final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory()); - // lower case 'æ' + // Ubuntu-Light, lower case 'æ' // Start TTF Shape for Glyph 193 if( true ) { @@ -94,7 +96,7 @@ public class TestObject02 extends UIShape { // 008: B1: line-to p0-p1 // Shape.LineTo: shape.addVertex(0, 0.728000f, 0.300000f, true); - System.err.println("TestObject02.shape01a.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph02UbuntuLight_ae.shape01a.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } else { // Inner e-shape: Winding.CCW @@ -131,7 +133,7 @@ public class TestObject02 extends UIShape { // 008: B1: line-to p0-p1 // Shape.LineTo: shape.addVertex(0.728000f, 0.300000f, true); - System.err.println("TestObject02.shape01b.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph02UbuntuLight_ae.shape01b.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } @@ -315,7 +317,7 @@ public class TestObject02 extends UIShape { // Shape.QuadTo: shape.addVertex(0, 0.289000f, -0.011000f, false); shape.addVertex(0, 0.252000f, -0.011000f, true); - System.err.println("TestObject02.shape02a.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph02UbuntuLight_ae.shape02a.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } else { // Outer shape: Winding.CW @@ -497,7 +499,7 @@ public class TestObject02 extends UIShape { // Shape.QuadTo: shape.addVertex(0.289000f, -0.011000f, false); shape.addVertex(0.252000f, -0.011000f, true); - System.err.println("TestObject02.shape02b.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph02UbuntuLight_ae.shape02b.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } @@ -565,7 +567,7 @@ public class TestObject02 extends UIShape { // Shape.QuadTo: shape.addVertex(0, 0.366000f, 0.190000f, false); shape.addVertex(0, 0.365000f, 0.238000f, true); - System.err.println("TestObject02.shape03a.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph02UbuntuLight_ae.shape03a.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } else { // Inner a-shape: Winding.CCW @@ -631,7 +633,7 @@ public class TestObject02 extends UIShape { // Shape.QuadTo: shape.addVertex(0.366000f, 0.190000f, false); shape.addVertex(0.365000f, 0.238000f, true); - System.err.println("TestObject02.shape03b.winding_area: "+shape.getWindingOfLastOutline()); + System.err.println("Glyph02UbuntuLight_ae.shape03b.winding_area: "+shape.getWindingOfLastOutline()); shape.closeLastOutline(false); } // End Shape for Glyph 193 diff --git a/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph03FreeMonoRegular_M.java b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph03FreeMonoRegular_M.java new file mode 100644 index 000000000..55fc7609e --- /dev/null +++ b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph03FreeMonoRegular_M.java @@ -0,0 +1,804 @@ +/** + * Copyright 2023 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ +package com.jogamp.opengl.test.junit.graph.testshapes; + +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape; +import com.jogamp.graph.curve.OutlineShape; +import com.jogamp.graph.curve.opengl.RegionRenderer; +import com.jogamp.graph.geom.Vertex; +import com.jogamp.graph.geom.Vertex.Factory; + +/** + * GPU based resolution independent test object + * - FreeMono-Regular, capital case 'M' + * - TTF Shape for Glyph 48 + */ +public class Glyph03FreeMonoRegular_M extends UIShape { + + public Glyph03FreeMonoRegular_M(final Factory<? extends Vertex> factory, final int renderModes) { + super(factory, renderModes); + } + + @Override + protected void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) { + } + + @Override + protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) { + } + + @SuppressWarnings("unused") + @Override + protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) { + final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory()); + + if( false ) { + // Start TTF Shape for Glyph 48 + // GlyphShape<48>: offset 0 of 45/45 points + // pM[044] P[483/522, on true, end true] + // p0[000] P[326/169, on true, end false] + // p1[001] P[280/169, on true, end false] + // p2[002] P[121/522, on true, end false] + // 000: B0a: move-to p0 + // Shape.MoveTo: + shape.closeLastOutline(false); + shape.addEmptyOutline(); + shape.addVertex(0, 0.326000f, 0.169000f, true); + // 000: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.280000f, 0.169000f, true); + // GlyphShape<48>: offset 1 of 45/45 points + // pM[000] P[326/169, on true, end false] + // p0[001] P[280/169, on true, end false] + // p1[002] P[121/522, on true, end false] + // p2[003] P[113/522, on true, end false] + // 001: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.121000f, 0.522000f, true); + // GlyphShape<48>: offset 2 of 45/45 points + // pM[001] P[280/169, on true, end false] + // p0[002] P[121/522, on true, end false] + // p1[003] P[113/522, on true, end false] + // p2[004] P[113/41, on true, end false] + // 002: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.113000f, 0.522000f, true); + // GlyphShape<48>: offset 3 of 45/45 points + // pM[002] P[121/522, on true, end false] + // p0[003] P[113/522, on true, end false] + // p1[004] P[113/41, on true, end false] + // p2[005] P[187/41, on true, end false] + // 003: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.113000f, 0.041000f, true); + // GlyphShape<48>: offset 4 of 45/45 points + // pM[003] P[113/522, on true, end false] + // p0[004] P[113/41, on true, end false] + // p1[005] P[187/41, on true, end false] + // p2[006] P[215/41, on false, end false] + // 004: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.187000f, 0.041000f, true); + // GlyphShape<48>: offset 5 of 45/45 points + // pM[004] P[113/41, on true, end false] + // p0[005] P[187/41, on true, end false] + // p1[006] P[215/41, on false, end false] + // p2[007] P[215/21, on true, end false] + // 005: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.215000f, 0.041000f, false); + shape.addVertex(0, 0.215000f, 0.021000f, true); + // GlyphShape<48>: offset 7 of 45/45 points + // pM[006] P[215/41, on false, end false] + // p0[007] P[215/21, on true, end false] + // p1[008] P[215/0, on false, end false] + // p2[009] P[187/0, on true, end false] + // 007: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.215000f, 0.000000f, false); + shape.addVertex(0, 0.187000f, 0.000000f, true); + // GlyphShape<48>: offset 9 of 45/45 points + // pM[008] P[215/0, on false, end false] + // p0[009] P[187/0, on true, end false] + // p1[010] P[38/0, on true, end false] + // p2[011] P[11/0, on false, end false] + // 009: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.038000f, 0.000000f, true); + // GlyphShape<48>: offset 10 of 45/45 points + // pM[009] P[187/0, on true, end false] + // p0[010] P[38/0, on true, end false] + // p1[011] P[11/0, on false, end false] + // p2[012] P[11/21, on true, end false] + // 010: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.011000f, 0.000000f, false); + shape.addVertex(0, 0.011000f, 0.021000f, true); + // GlyphShape<48>: offset 12 of 45/45 points + // pM[011] P[11/0, on false, end false] + // p0[012] P[11/21, on true, end false] + // p1[013] P[11/41, on false, end false] + // p2[014] P[38/41, on true, end false] + // 012: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.011000f, 0.041000f, false); + shape.addVertex(0, 0.038000f, 0.041000f, true); + // GlyphShape<48>: offset 14 of 45/45 points + // pM[013] P[11/41, on false, end false] + // p0[014] P[38/41, on true, end false] + // p1[015] P[72/41, on true, end false] + // p2[016] P[72/522, on true, end false] + // 014: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.072000f, 0.041000f, true); + // GlyphShape<48>: offset 15 of 45/45 points + // pM[014] P[38/41, on true, end false] + // p0[015] P[72/41, on true, end false] + // p1[016] P[72/522, on true, end false] + // p2[017] P[47/522, on true, end false] + // 015: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.072000f, 0.522000f, true); + // GlyphShape<48>: offset 16 of 45/45 points + // pM[015] P[72/41, on true, end false] + // p0[016] P[72/522, on true, end false] + // p1[017] P[47/522, on true, end false] + // p2[018] P[20/522, on false, end false] + // 016: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.047000f, 0.522000f, true); + // GlyphShape<48>: offset 17 of 45/45 points + // pM[016] P[72/522, on true, end false] + // p0[017] P[47/522, on true, end false] + // p1[018] P[20/522, on false, end false] + // p2[019] P[20/543, on true, end false] + // 017: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.020000f, 0.522000f, false); + shape.addVertex(0, 0.020000f, 0.543000f, true); + // GlyphShape<48>: offset 19 of 45/45 points + // pM[018] P[20/522, on false, end false] + // p0[019] P[20/543, on true, end false] + // p1[020] P[20/563, on false, end false] + // p2[021] P[47/563, on true, end false] + // 019: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.020000f, 0.563000f, false); + shape.addVertex(0, 0.047000f, 0.563000f, true); + // GlyphShape<48>: offset 21 of 45/45 points + // pM[020] P[20/563, on false, end false] + // p0[021] P[47/563, on true, end false] + // p1[022] P[146/563, on true, end false] + // p2[023] P[303/215, on true, end false] + // 021: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.146000f, 0.563000f, true); + // GlyphShape<48>: offset 22 of 45/45 points + // pM[021] P[47/563, on true, end false] + // p0[022] P[146/563, on true, end false] + // p1[023] P[303/215, on true, end false] + // p2[024] P[457/563, on true, end false] + // 022: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.303000f, 0.215000f, true); + // GlyphShape<48>: offset 23 of 45/45 points + // pM[022] P[146/563, on true, end false] + // p0[023] P[303/215, on true, end false] + // p1[024] P[457/563, on true, end false] + // p2[025] P[557/563, on true, end false] + // 023: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.457000f, 0.563000f, true); + // GlyphShape<48>: offset 24 of 45/45 points + // pM[023] P[303/215, on true, end false] + // p0[024] P[457/563, on true, end false] + // p1[025] P[557/563, on true, end false] + // p2[026] P[584/563, on false, end false] + // 024: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.557000f, 0.563000f, true); + // GlyphShape<48>: offset 25 of 45/45 points + // pM[024] P[457/563, on true, end false] + // p0[025] P[557/563, on true, end false] + // p1[026] P[584/563, on false, end false] + // p2[027] P[584/543, on true, end false] + // 025: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.584000f, 0.563000f, false); + shape.addVertex(0, 0.584000f, 0.543000f, true); + // GlyphShape<48>: offset 27 of 45/45 points + // pM[026] P[584/563, on false, end false] + // p0[027] P[584/543, on true, end false] + // p1[028] P[584/522, on false, end false] + // p2[029] P[557/522, on true, end false] + // 027: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.584000f, 0.522000f, false); + shape.addVertex(0, 0.557000f, 0.522000f, true); + // GlyphShape<48>: offset 29 of 45/45 points + // pM[028] P[584/522, on false, end false] + // p0[029] P[557/522, on true, end false] + // p1[030] P[532/522, on true, end false] + // p2[031] P[532/41, on true, end false] + // 029: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.532000f, 0.522000f, true); + // GlyphShape<48>: offset 30 of 45/45 points + // pM[029] P[557/522, on true, end false] + // p0[030] P[532/522, on true, end false] + // p1[031] P[532/41, on true, end false] + // p2[032] P[566/41, on true, end false] + // 030: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.532000f, 0.041000f, true); + // GlyphShape<48>: offset 31 of 45/45 points + // pM[030] P[532/522, on true, end false] + // p0[031] P[532/41, on true, end false] + // p1[032] P[566/41, on true, end false] + // p2[033] P[593/41, on false, end false] + // 031: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.566000f, 0.041000f, true); + // GlyphShape<48>: offset 32 of 45/45 points + // pM[031] P[532/41, on true, end false] + // p0[032] P[566/41, on true, end false] + // p1[033] P[593/41, on false, end false] + // p2[034] P[593/21, on true, end false] + // 032: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.593000f, 0.041000f, false); + shape.addVertex(0, 0.593000f, 0.021000f, true); + // GlyphShape<48>: offset 34 of 45/45 points + // pM[033] P[593/41, on false, end false] + // p0[034] P[593/21, on true, end false] + // p1[035] P[593/0, on false, end false] + // p2[036] P[566/0, on true, end false] + // 034: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.593000f, 0.000000f, false); + shape.addVertex(0, 0.566000f, 0.000000f, true); + // GlyphShape<48>: offset 36 of 45/45 points + // pM[035] P[593/0, on false, end false] + // p0[036] P[566/0, on true, end false] + // p1[037] P[417/0, on true, end false] + // p2[038] P[390/0, on false, end false] + // 036: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.417000f, 0.000000f, true); + // GlyphShape<48>: offset 37 of 45/45 points + // pM[036] P[566/0, on true, end false] + // p0[037] P[417/0, on true, end false] + // p1[038] P[390/0, on false, end false] + // p2[039] P[390/21, on true, end false] + // 037: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.390000f, 0.000000f, false); + shape.addVertex(0, 0.390000f, 0.021000f, true); + // GlyphShape<48>: offset 39 of 45/45 points + // pM[038] P[390/0, on false, end false] + // p0[039] P[390/21, on true, end false] + // p1[040] P[390/41, on false, end false] + // p2[041] P[417/41, on true, end false] + // 039: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.390000f, 0.041000f, false); + shape.addVertex(0, 0.417000f, 0.041000f, true); + // GlyphShape<48>: offset 41 of 45/45 points + // pM[040] P[390/41, on false, end false] + // p0[041] P[417/41, on true, end false] + // p1[042] P[491/41, on true, end false] + // p2[043] P[491/522, on true, end false] + // 041: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.491000f, 0.041000f, true); + // GlyphShape<48>: offset 42 of 45/45 points + // pM[041] P[417/41, on true, end false] + // p0[042] P[491/41, on true, end false] + // p1[043] P[491/522, on true, end false] + // p2[044] P[483/522, on true, end true] + // 042: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.491000f, 0.522000f, true); + // GlyphShape<48>: offset 43 of 45/45 points + // pM[042] P[491/41, on true, end false] + // p0[043] P[491/522, on true, end false] + // p1[044] P[483/522, on true, end true] + // p2[000] P[326/169, on true, end false] + // 043: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.483000f, 0.522000f, true); + // GlyphShape<48>: offset 44 of 45/45 points + // pM[043] P[491/522, on true, end false] + // p0[044] P[483/522, on true, end true] + // p1[000] P[326/169, on true, end false] + // p2[001] P[280/169, on true, end false] + // 044: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.326000f, 0.169000f, true); + System.err.println("Glyph03FreeMonoRegular_M.shape01a.winding_area: "+shape.getWindingOfLastOutline()); + shape.closeLastOutline(false); + + // End Shape for Glyph 48 + } else if( false ) { + // Start TTF Shape for Glyph 48 + // GlyphShape<48>: offset 0 of 45/45 points + // pM[044] P[483/522, on true, end true] + // p0[000] P[326/169, on true, end false] + // p1[001] P[280/169, on true, end false] + // p2[002] P[121/522, on true, end false] + // 000: B0a: move-to p0 + // Shape.MoveTo: + shape.closeLastOutline(false); + shape.addEmptyOutline(); + shape.addVertex(0, 0.326000f, 0.169000f, true); + // 000: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.280000f, 0.169000f, true); + // GlyphShape<48>: offset 1 of 45/45 points + // pM[000] P[326/169, on true, end false] + // p0[001] P[280/169, on true, end false] + // p1[002] P[121/522, on true, end false] + // p2[003] P[113/522, on true, end false] + // 001: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.121000f, 0.522000f, true); + // GlyphShape<48>: offset 2 of 45/45 points + // pM[001] P[280/169, on true, end false] + // p0[002] P[121/522, on true, end false] + // p1[003] P[113/522, on true, end false] + // p2[004] P[113/41, on true, end false] + // 002: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.113000f, 0.522000f, true); + // GlyphShape<48>: offset 3 of 45/45 points + // pM[002] P[121/522, on true, end false] + // p0[003] P[113/522, on true, end false] + // p1[004] P[113/41, on true, end false] + // p2[005] P[187/41, on true, end false] + // 003: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.113000f, 0.041000f, true); + // GlyphShape<48>: offset 4 of 45/45 points + // pM[003] P[113/522, on true, end false] + // p0[004] P[113/41, on true, end false] + // p1[005] P[187/41, on true, end false] + // p2[006] P[215/41, on false, end false] + // 004: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.187000f, 0.041000f, true); + // GlyphShape<48>: offset 5 of 45/45 points + // pM[004] P[113/41, on true, end false] + // p0[005] P[187/41, on true, end false] + // p1[006] P[215/41, on false, end false] + // p2[007] P[215/21, on true, end false] + // 005: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.215000f, 0.041000f, true); // curve -> line + shape.addVertex(0, 0.215000f, 0.021000f, true); + // GlyphShape<48>: offset 7 of 45/45 points + // pM[006] P[215/41, on false, end false] + // p0[007] P[215/21, on true, end false] + // p1[008] P[215/0, on false, end false] + // p2[009] P[187/0, on true, end false] + // 007: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.215000f, 0.000000f, true); // curve -> line + shape.addVertex(0, 0.187000f, 0.000000f, true); + // GlyphShape<48>: offset 9 of 45/45 points + // pM[008] P[215/0, on false, end false] + // p0[009] P[187/0, on true, end false] + // p1[010] P[38/0, on true, end false] + // p2[011] P[11/0, on false, end false] + // 009: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.038000f, 0.000000f, true); + // GlyphShape<48>: offset 10 of 45/45 points + // pM[009] P[187/0, on true, end false] + // p0[010] P[38/0, on true, end false] + // p1[011] P[11/0, on false, end false] + // p2[012] P[11/21, on true, end false] + // 010: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.011000f, 0.000000f, true); // curve -> line + shape.addVertex(0, 0.011000f, 0.021000f, true); + // GlyphShape<48>: offset 12 of 45/45 points + // pM[011] P[11/0, on false, end false] + // p0[012] P[11/21, on true, end false] + // p1[013] P[11/41, on false, end false] + // p2[014] P[38/41, on true, end false] + // 012: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.011000f, 0.041000f, true); // curve -> line + shape.addVertex(0, 0.038000f, 0.041000f, true); + // GlyphShape<48>: offset 14 of 45/45 points + // pM[013] P[11/41, on false, end false] + // p0[014] P[38/41, on true, end false] + // p1[015] P[72/41, on true, end false] + // p2[016] P[72/522, on true, end false] + // 014: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.072000f, 0.041000f, true); + // GlyphShape<48>: offset 15 of 45/45 points + // pM[014] P[38/41, on true, end false] + // p0[015] P[72/41, on true, end false] + // p1[016] P[72/522, on true, end false] + // p2[017] P[47/522, on true, end false] + // 015: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.072000f, 0.522000f, true); + // GlyphShape<48>: offset 16 of 45/45 points + // pM[015] P[72/41, on true, end false] + // p0[016] P[72/522, on true, end false] + // p1[017] P[47/522, on true, end false] + // p2[018] P[20/522, on false, end false] + // 016: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.047000f, 0.522000f, true); + // GlyphShape<48>: offset 17 of 45/45 points + // pM[016] P[72/522, on true, end false] + // p0[017] P[47/522, on true, end false] + // p1[018] P[20/522, on false, end false] + // p2[019] P[20/543, on true, end false] + // 017: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.020000f, 0.522000f, true); // curve -> line + shape.addVertex(0, 0.020000f, 0.543000f, true); + // GlyphShape<48>: offset 19 of 45/45 points + // pM[018] P[20/522, on false, end false] + // p0[019] P[20/543, on true, end false] + // p1[020] P[20/563, on false, end false] + // p2[021] P[47/563, on true, end false] + // 019: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.020000f, 0.563000f, true); // curve -> line + shape.addVertex(0, 0.047000f, 0.563000f, true); + // GlyphShape<48>: offset 21 of 45/45 points + // pM[020] P[20/563, on false, end false] + // p0[021] P[47/563, on true, end false] + // p1[022] P[146/563, on true, end false] + // p2[023] P[303/215, on true, end false] + // 021: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.146000f, 0.563000f, true); + // GlyphShape<48>: offset 22 of 45/45 points + // pM[021] P[47/563, on true, end false] + // p0[022] P[146/563, on true, end false] + // p1[023] P[303/215, on true, end false] + // p2[024] P[457/563, on true, end false] + // 022: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.303000f, 0.215000f, true); + // GlyphShape<48>: offset 23 of 45/45 points + // pM[022] P[146/563, on true, end false] + // p0[023] P[303/215, on true, end false] + // p1[024] P[457/563, on true, end false] + // p2[025] P[557/563, on true, end false] + // 023: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.457000f, 0.563000f, true); + // GlyphShape<48>: offset 24 of 45/45 points + // pM[023] P[303/215, on true, end false] + // p0[024] P[457/563, on true, end false] + // p1[025] P[557/563, on true, end false] + // p2[026] P[584/563, on false, end false] + // 024: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.557000f, 0.563000f, true); + // GlyphShape<48>: offset 25 of 45/45 points + // pM[024] P[457/563, on true, end false] + // p0[025] P[557/563, on true, end false] + // p1[026] P[584/563, on false, end false] + // p2[027] P[584/543, on true, end false] + // 025: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.584000f, 0.563000f, true); // curve -> line + shape.addVertex(0, 0.584000f, 0.543000f, true); + // GlyphShape<48>: offset 27 of 45/45 points + // pM[026] P[584/563, on false, end false] + // p0[027] P[584/543, on true, end false] + // p1[028] P[584/522, on false, end false] + // p2[029] P[557/522, on true, end false] + // 027: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.584000f, 0.522000f, true); // curve -> line + shape.addVertex(0, 0.557000f, 0.522000f, true); + // GlyphShape<48>: offset 29 of 45/45 points + // pM[028] P[584/522, on false, end false] + // p0[029] P[557/522, on true, end false] + // p1[030] P[532/522, on true, end false] + // p2[031] P[532/41, on true, end false] + // 029: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.532000f, 0.522000f, true); + // GlyphShape<48>: offset 30 of 45/45 points + // pM[029] P[557/522, on true, end false] + // p0[030] P[532/522, on true, end false] + // p1[031] P[532/41, on true, end false] + // p2[032] P[566/41, on true, end false] + // 030: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.532000f, 0.041000f, true); + // GlyphShape<48>: offset 31 of 45/45 points + // pM[030] P[532/522, on true, end false] + // p0[031] P[532/41, on true, end false] + // p1[032] P[566/41, on true, end false] + // p2[033] P[593/41, on false, end false] + // 031: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.566000f, 0.041000f, true); + // GlyphShape<48>: offset 32 of 45/45 points + // pM[031] P[532/41, on true, end false] + // p0[032] P[566/41, on true, end false] + // p1[033] P[593/41, on false, end false] + // p2[034] P[593/21, on true, end false] + // 032: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.593000f, 0.041000f, true); // curve -> line + shape.addVertex(0, 0.593000f, 0.021000f, true); + // GlyphShape<48>: offset 34 of 45/45 points + // pM[033] P[593/41, on false, end false] + // p0[034] P[593/21, on true, end false] + // p1[035] P[593/0, on false, end false] + // p2[036] P[566/0, on true, end false] + // 034: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.593000f, 0.000000f, true); // curve -> line + shape.addVertex(0, 0.566000f, 0.000000f, true); + // GlyphShape<48>: offset 36 of 45/45 points + // pM[035] P[593/0, on false, end false] + // p0[036] P[566/0, on true, end false] + // p1[037] P[417/0, on true, end false] + // p2[038] P[390/0, on false, end false] + // 036: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.417000f, 0.000000f, true); + // GlyphShape<48>: offset 37 of 45/45 points + // pM[036] P[566/0, on true, end false] + // p0[037] P[417/0, on true, end false] + // p1[038] P[390/0, on false, end false] + // p2[039] P[390/21, on true, end false] + // 037: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.390000f, 0.000000f, true); // curve -> line + shape.addVertex(0, 0.390000f, 0.021000f, true); + // GlyphShape<48>: offset 39 of 45/45 points + // pM[038] P[390/0, on false, end false] + // p0[039] P[390/21, on true, end false] + // p1[040] P[390/41, on false, end false] + // p2[041] P[417/41, on true, end false] + // 039: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.390000f, 0.041000f, true); // curve -> line + shape.addVertex(0, 0.417000f, 0.041000f, true); + // GlyphShape<48>: offset 41 of 45/45 points + // pM[040] P[390/41, on false, end false] + // p0[041] P[417/41, on true, end false] + // p1[042] P[491/41, on true, end false] + // p2[043] P[491/522, on true, end false] + // 041: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.491000f, 0.041000f, true); + // GlyphShape<48>: offset 42 of 45/45 points + // pM[041] P[417/41, on true, end false] + // p0[042] P[491/41, on true, end false] + // p1[043] P[491/522, on true, end false] + // p2[044] P[483/522, on true, end true] + // 042: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.491000f, 0.522000f, true); + // GlyphShape<48>: offset 43 of 45/45 points + // pM[042] P[491/41, on true, end false] + // p0[043] P[491/522, on true, end false] + // p1[044] P[483/522, on true, end true] + // p2[000] P[326/169, on true, end false] + // 043: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.483000f, 0.522000f, true); + // GlyphShape<48>: offset 44 of 45/45 points + // pM[043] P[491/522, on true, end false] + // p0[044] P[483/522, on true, end true] + // p1[000] P[326/169, on true, end false] + // p2[001] P[280/169, on true, end false] + // 044: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.326000f, 0.169000f, true); + System.err.println("Glyph03FreeMonoRegular_M.shape01a.winding_area: "+shape.getWindingOfLastOutline()); + shape.closeLastOutline(false); + } else { + final boolean with_left_leg = true; // ERROR + final boolean with_right_leg = false; // OK + + // Start TTF Shape for Glyph 48 + // GlyphShape<48>: offset 0 of 45/45 points + // pM[044] P[483/522, on true, end true] + // p0[000] P[326/169, on true, end false] + // p1[001] P[280/169, on true, end false] + // p2[002] P[121/522, on true, end false] + // 000: B0a: move-to p0 + // Shape.MoveTo: + shape.closeLastOutline(false); + shape.addEmptyOutline(); + shape.addVertex(0, 0.326000f, 0.169000f, true); + // 000: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.280000f, 0.169000f, true); + // GlyphShape<48>: offset 1 of 45/45 points + // pM[000] P[326/169, on true, end false] + // p0[001] P[280/169, on true, end false] + // p1[002] P[121/522, on true, end false] + // p2[003] P[113/522, on true, end false] + // 001: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.121000f, 0.522000f, true); // ID 11 + + // GlyphShape<48>: offset 2 of 45/45 points + // pM[001] P[280/169, on true, end false] + // p0[002] P[121/522, on true, end false] + // p1[003] P[113/522, on true, end false] + // p2[004] P[113/41, on true, end false] + // 002: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.113000f, 0.522000f, true); + + if( with_left_leg ) { + // GlyphShape<48>: offset 3 of 45/45 points + // pM[002] P[121/522, on true, end false] + // p0[003] P[113/522, on true, end false] + // p1[004] P[113/41, on true, end false] + // p2[005] P[187/41, on true, end false] + // 003: B1: line-to p0-p1 + // Shape.LineTo: + // shape.addVertex(0, 0.113000f, 0.041000f, true); + + shape.addVertex(0, 0.113000f, 0.000000f, true); + shape.addVertex(0, 0.072000f, 0.000000f, true); + + // GlyphShape<48>: offset 14 of 45/45 points + // pM[013] P[11/41, on false, end false] + // p0[014] P[38/41, on true, end false] + // p1[015] P[72/41, on true, end false] + // p2[016] P[72/522, on true, end false] + // 014: B1: line-to p0-p1 + // Shape.LineTo: + // shape.addVertex(0, 0.072000f, 0.041000f, true); + + // GlyphShape<48>: offset 15 of 45/45 points + // pM[014] P[38/41, on true, end false] + // p0[015] P[72/41, on true, end false] + // p1[016] P[72/522, on true, end false] + // p2[017] P[47/522, on true, end false] + // 015: B1: line-to p0-p1 + // Shape.LineTo: + // shape.addVertex(0, 0.072000f, 0.522000f, true); + + shape.addVertex(0, 0.072000f, 0.563000f, true); // ID 7 + } else { + shape.addVertex(0, 0.113000f, 0.563000f, true); + } + + // GlyphShape<48>: offset 21 of 45/45 points + // pM[020] P[20/563, on false, end false] + // p0[021] P[47/563, on true, end false] + // p1[022] P[146/563, on true, end false] + // p2[023] P[303/215, on true, end false] + // 021: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.146000f, 0.563000f, true); + // GlyphShape<48>: offset 22 of 45/45 points + // pM[021] P[47/563, on true, end false] + // p0[022] P[146/563, on true, end false] + // p1[023] P[303/215, on true, end false] + // p2[024] P[457/563, on true, end false] + // 022: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.303000f, 0.215000f, true); + // GlyphShape<48>: offset 23 of 45/45 points + // pM[022] P[146/563, on true, end false] + // p0[023] P[303/215, on true, end false] + // p1[024] P[457/563, on true, end false] + // p2[025] P[557/563, on true, end false] + // 023: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.457000f, 0.563000f, true); // ID 4 + + if( with_right_leg ) { + shape.addVertex(0, 0.532000f, 0.563000f, true); + + // GlyphShape<48>: offset 29 of 45/45 points + // pM[028] P[584/522, on false, end false] + // p0[029] P[557/522, on true, end false] + // p1[030] P[532/522, on true, end false] + // p2[031] P[532/41, on true, end false] + // 029: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.532000f, 0.522000f, true); + // GlyphShape<48>: offset 30 of 45/45 points + // pM[029] P[557/522, on true, end false] + // p0[030] P[532/522, on true, end false] + // p1[031] P[532/41, on true, end false] + // p2[032] P[566/41, on true, end false] + // 030: B1: line-to p0-p1 + // Shape.LineTo: + // shape.addVertex(0, 0.532000f, 0.041000f, true); + + shape.addVertex(0, 0.532000f, 0.000000f, true); + shape.addVertex(0, 0.491000f, 0.000000f, true); + } else { + shape.addVertex(0, 0.491000f, 0.563000f, true); // ID 3 + } + + // GlyphShape<48>: offset 41 of 45/45 points + // pM[040] P[390/41, on false, end false] + // p0[041] P[417/41, on true, end false] + // p1[042] P[491/41, on true, end false] + // p2[043] P[491/522, on true, end false] + // 041: B1: line-to p0-p1 + // Shape.LineTo: + // shape.addVertex(0, 0.491000f, 0.041000f, true); + + // GlyphShape<48>: offset 42 of 45/45 points + // pM[041] P[417/41, on true, end false] + // p0[042] P[491/41, on true, end false] + // p1[043] P[491/522, on true, end false] + // p2[044] P[483/522, on true, end true] + // 042: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.491000f, 0.522000f, true); // ID 2 + // GlyphShape<48>: offset 43 of 45/45 points + // pM[042] P[491/41, on true, end false] + // p0[043] P[491/522, on true, end false] + // p1[044] P[483/522, on true, end true] + // p2[000] P[326/169, on true, end false] + // 043: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.483000f, 0.522000f, true); // ID 1 + // GlyphShape<48>: offset 44 of 45/45 points + // pM[043] P[491/522, on true, end false] + // p0[044] P[483/522, on true, end true] + // p1[000] P[326/169, on true, end false] + // p2[001] P[280/169, on true, end false] + // 044: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.326000f, 0.169000f, true); + System.err.println("Glyph03FreeMonoRegular_M.shape01a.winding_area: "+shape.getWindingOfLastOutline()); + shape.closeLastOutline(false); + } + + shape.setIsQuadraticNurbs(); + shape.setSharpness(shapesSharpness); + region.addOutlineShape(shape, null, rgbaColor); + + box.resize(shape.getBounds()); + } + + @Override + public String getSubString() { + return super.getSubString(); + } +} diff --git a/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph04FreeSans_0.java b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph04FreeSans_0.java new file mode 100644 index 000000000..5b677b622 --- /dev/null +++ b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph04FreeSans_0.java @@ -0,0 +1,150 @@ +/** + * Copyright 2023 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ +package com.jogamp.opengl.test.junit.graph.testshapes; + +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape; +import com.jogamp.graph.curve.OutlineShape; +import com.jogamp.graph.curve.opengl.RegionRenderer; +import com.jogamp.graph.geom.Vertex; +import com.jogamp.graph.geom.Vertex.Factory; + +/** + * GPU based resolution independent test object + * - FreeSans, '0' + * - TTF Shape for Glyph 19 + */ +public class Glyph04FreeSans_0 extends UIShape { + + public Glyph04FreeSans_0(final Factory<? extends Vertex> factory, final int renderModes) { + super(factory, renderModes); + } + + @Override + protected void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) { + } + + @Override + protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) { + } + + @Override + protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) { + final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory()); + + // Start TTF Shape for Glyph 19 + // 000: B0a: move-to p0 + // Shape.MoveTo: + shape.closeLastOutline(false); + shape.addEmptyOutline(); + shape.addVertex(0, 0.043000f, 0.343000f, true); + // 000: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.043000f, 0.432000f, false); + shape.addVertex(0, 0.058000f, 0.500000f, true); + // 002: B5: quad-to pMh-p0-p1h ***** MID + // Shape.QuadTo: + shape.addVertex(0, 0.073000f, 0.568000f, false); + shape.addVertex(0, 0.096000f, 0.606000f, true); + // 003: B5: quad-to pMh-p0-p1h ***** MID + // Shape.QuadTo: + shape.addVertex(0, 0.119000f, 0.645000f, false); + shape.addVertex(0, 0.151000f, 0.669000f, true); + // 004: B5: quad-to pMh-p0-p1h ***** MID + // Shape.QuadTo: + shape.addVertex(0, 0.183000f, 0.693000f, false); + shape.addVertex(0, 0.212000f, 0.701000f, true); + // 005: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.242000f, 0.709000f, false); + shape.addVertex(0, 0.275000f, 0.709000f, true); + // 006: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.507000f, 0.709000f, false); + shape.addVertex(0, 0.507000f, 0.337000f, true); + // 008: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.507000f, 0.162000f, false); + shape.addVertex(0, 0.448000f, 0.070000f, true); + // 010: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.388000f, -0.023000f, false); + shape.addVertex(0, 0.275000f, -0.023000f, true); + // 011: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.161000f, -0.023000f, false); + shape.addVertex(0, 0.102000f, 0.070000f, true); + // 013: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.043000f, 0.164000f, false); + shape.addVertex(0, 0.043000f, 0.343000f, true); + System.err.println("Glyph04FreeSans_0.shape01a.winding_area: "+shape.getWindingOfLastOutline()); + shape.closeLastOutline(false); + + // 021: B0b: move-to pM + // Shape.MoveTo: + shape.closeLastOutline(false); + shape.addEmptyOutline(); + shape.addVertex(0, 0.417000f, 0.345000f, true); + // 021: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.417000f, 0.631000f, false); + shape.addVertex(0, 0.275000f, 0.631000f, true); + // 015: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.133000f, 0.631000f, false); + shape.addVertex(0, 0.133000f, 0.342000f, true); + // 016: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.133000f, 0.050000f, false); + shape.addVertex(0, 0.273000f, 0.050000f, true); + // 018: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.347000f, 0.050000f, false); + shape.addVertex(0, 0.382000f, 0.122000f, true); + // 020: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.417000f, 0.194000f, false); + shape.addVertex(0, 0.417000f, 0.345000f, true); + System.err.println("Glyph04FreeSans_0.shape02a.winding_area: "+shape.getWindingOfLastOutline()); + shape.closeLastOutline(false); + + // End Shape for Glyph 19 + + shape.setIsQuadraticNurbs(); + shape.setSharpness(shapesSharpness); + region.addOutlineShape(shape, null, rgbaColor); + + box.resize(shape.getBounds()); + } + + @Override + public String getSubString() { + return super.getSubString(); + } +} diff --git a/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph05FreeSerifBoldItalic_ae.java b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph05FreeSerifBoldItalic_ae.java new file mode 100644 index 000000000..e7f726b1f --- /dev/null +++ b/src/test/com/jogamp/opengl/test/junit/graph/testshapes/Glyph05FreeSerifBoldItalic_ae.java @@ -0,0 +1,287 @@ +/** + * Copyright 2023 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ +package com.jogamp.opengl.test.junit.graph.testshapes; + +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape; +import com.jogamp.graph.curve.OutlineShape; +import com.jogamp.graph.curve.opengl.RegionRenderer; +import com.jogamp.graph.geom.Vertex; +import com.jogamp.graph.geom.Vertex.Factory; + +/** + * GPU based resolution independent test object + * - FreeSans, '0' + * - TTF Shape for Glyph 19 + */ +public class Glyph05FreeSerifBoldItalic_ae extends UIShape { + + public Glyph05FreeSerifBoldItalic_ae(final Factory<? extends Vertex> factory, final int renderModes) { + super(factory, renderModes); + } + + @Override + protected void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) { + } + + @Override + protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) { + } + + @Override + protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) { + final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory()); + + // Start TTF Shape for Glyph 168 + // 000: B0a: move-to p0 + // Shape.MoveTo: + shape.closeLastOutline(false); + shape.addEmptyOutline(); + shape.addVertex(0, 0.450000f, -0.013000f, true); + // 000: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.386000f, -0.013000f, false); + shape.addVertex(0, 0.353000f, 0.018000f, true); + // 002: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.319000f, 0.049000f, false); + shape.addVertex(0, 0.307000f, 0.118000f, true); + // 003: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.265000f, 0.049000f, false); + shape.addVertex(0, 0.225000f, 0.019000f, true); + // 005: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.184000f, -0.012000f, false); + shape.addVertex(0, 0.134000f, -0.012000f, true); + // 006: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.085000f, -0.012000f, false); + shape.addVertex(0, 0.053000f, 0.021000f, true); + // 008: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.020000f, 0.055000f, false); + shape.addVertex(0, 0.020000f, 0.106000f, true); + // 009: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.020000f, 0.185000f, false); + shape.addVertex(0, 0.062000f, 0.269000f, true); + // 011: B5: quad-to pMh-p0-p1h ***** MID + // Shape.QuadTo: + shape.addVertex(0, 0.105000f, 0.353000f, false); + shape.addVertex(0, 0.170000f, 0.407000f, true); + // 012: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.235000f, 0.462000f, false); + shape.addVertex(0, 0.296000f, 0.462000f, true); + // 013: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.328000f, 0.462000f, false); + shape.addVertex(0, 0.346000f, 0.448000f, true); + // 015: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.364000f, 0.433000f, false); + shape.addVertex(0, 0.377000f, 0.396000f, true); + // 016: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.395000f, 0.454000f, true); + // 017: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.498000f, 0.459000f, true); + // 018: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.478000f, 0.394000f, true); + // 019: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.510000f, 0.431000f, false); + shape.addVertex(0, 0.535000f, 0.445000f, true); + // 021: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.561000f, 0.459000f, false); + shape.addVertex(0, 0.598000f, 0.459000f, true); + // 022: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.645000f, 0.459000f, false); + shape.addVertex(0, 0.671000f, 0.436000f, true); + // 024: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.698000f, 0.413000f, false); + shape.addVertex(0, 0.698000f, 0.372000f, true); + // 025: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.698000f, 0.310000f, false); + shape.addVertex(0, 0.639000f, 0.263000f, true); + // 027: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.579000f, 0.215000f, false); + shape.addVertex(0, 0.470000f, 0.190000f, true); + // 028: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.431000f, 0.181000f, true); + // 029: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.426000f, 0.156000f, false); + shape.addVertex(0, 0.426000f, 0.134000f, true); + // 031: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.426000f, 0.096000f, false); + shape.addVertex(0, 0.444000f, 0.073000f, true); + // 033: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.462000f, 0.050000f, false); + shape.addVertex(0, 0.493000f, 0.050000f, true); + // 034: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.565000f, 0.050000f, false); + shape.addVertex(0, 0.616000f, 0.139000f, true); + // 036: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.644000f, 0.122000f, true); + // 037: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.578000f, -0.013000f, false); + shape.addVertex(0, 0.450000f, -0.013000f, true); + System.err.println("Glyph05FreeSerifBoldItalic_ae.shape01a.winding_area: "+shape.getWindingOfLastOutline()); + shape.closeLastOutline(false); + + // 039: B0a: move-to p0 + // Shape.MoveTo: + shape.closeLastOutline(false); + shape.addEmptyOutline(); + shape.addVertex(0, 0.194000f, 0.058000f, true); + // 039: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.238000f, 0.058000f, false); + shape.addVertex(0, 0.278000f, 0.122000f, true); + // 041: B5: quad-to pMh-p0-p1h ***** MID + // Shape.QuadTo: + shape.addVertex(0, 0.319000f, 0.187000f, false); + shape.addVertex(0, 0.338000f, 0.256000f, true); + // 042: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.358000f, 0.326000f, false); + shape.addVertex(0, 0.358000f, 0.363000f, true); + // 043: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.358000f, 0.387000f, false); + shape.addVertex(0, 0.345000f, 0.403000f, true); + // 045: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.331000f, 0.419000f, false); + shape.addVertex(0, 0.310000f, 0.419000f, true); + // 046: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.267000f, 0.419000f, false); + shape.addVertex(0, 0.227000f, 0.356000f, true); + // 048: B5: quad-to pMh-p0-p1h ***** MID + // Shape.QuadTo: + shape.addVertex(0, 0.187000f, 0.293000f, false); + shape.addVertex(0, 0.167000f, 0.225000f, true); + // 049: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.146000f, 0.156000f, false); + shape.addVertex(0, 0.146000f, 0.119000f, true); + // 050: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.146000f, 0.092000f, false); + shape.addVertex(0, 0.159000f, 0.075000f, true); + // 052: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.172000f, 0.058000f, false); + shape.addVertex(0, 0.194000f, 0.058000f, true); + System.err.println("Glyph05FreeSerifBoldItalic_ae.shape02a.winding_area: "+shape.getWindingOfLastOutline()); + shape.closeLastOutline(false); + + if( true ) { + // GlyphShape<168>: offset 0 of 8/61 points + // pM[060] P[443/231, on true, end true] + // p0[053] P[438/214, on true, end false] + // p1[054] P[498/223, on false, end false] + // p2[055] P[608/320, on false, end false] + // 053: B0a: move-to p0 + // Shape.MoveTo: + shape.closeLastOutline(false); + shape.addEmptyOutline(); + shape.addVertex(0, 0.438000f, 0.214000f, true); + // 053: B4: quad-to p0-p1-p2h **** MID + // Shape.QuadTo: + shape.addVertex(0, 0.498000f, 0.223000f, false); + shape.addVertex(0, 0.553000f, 0.271000f, true); + // GlyphShape<168>: offset 2 of 8/61 points + // pM[054] P[498/223, on false, end false] + // p0[055] P[608/320, on false, end false] + // p1[056] P[608/388, on true, end false] + // p2[057] P[608/429, on false, end false] + // 055: B6: quad-to pMh-p0-p1 + // Shape.QuadTo: + shape.addVertex(0, 0.608000f, 0.320000f, false); + shape.addVertex(0, 0.608000f, 0.388000f, true); + // GlyphShape<168>: offset 3 of 8/61 points + // pM[055] P[608/320, on false, end false] + // p0[056] P[608/388, on true, end false] + // p1[057] P[608/429, on false, end false] + // p2[058] P[575/429, on true, end false] + // 056: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.608000f, 0.429000f, false); + shape.addVertex(0, 0.575000f, 0.429000f, true); + // GlyphShape<168>: offset 5 of 8/61 points + // pM[057] P[608/429, on false, end false] + // p0[058] P[575/429, on true, end false] + // p1[059] P[502/429, on false, end false] + // p2[060] P[443/231, on true, end true] + // 058: B2: quad-to p0-p1-p2 + // Shape.QuadTo: + shape.addVertex(0, 0.502000f, 0.429000f, false); + shape.addVertex(0, 0.443000f, 0.231000f, true); + // GlyphShape<168>: offset 7 of 8/61 points + // pM[059] P[502/429, on false, end false] + // p0[060] P[443/231, on true, end true] + // p1[053] P[438/214, on true, end false] + // p2[054] P[498/223, on false, end false] + // 060: B1: line-to p0-p1 + // Shape.LineTo: + shape.addVertex(0, 0.438000f, 0.214000f, true); + System.err.println("Glyph05FreeSerifBoldItalic_ae.shape03a.winding_area: "+shape.getWindingOfLastOutline()); + shape.closeLastOutline(false); + } + + // End Shape for Glyph 168 + + shape.setIsQuadraticNurbs(); + shape.setSharpness(shapesSharpness); + region.addOutlineShape(shape, null, rgbaColor); + + box.resize(shape.getBounds()); + } + + @Override + public String getSubString() { + return super.getSubString(); + } +} |