summaryrefslogtreecommitdiffstats
path: root/src/demos/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-04-14 18:25:23 +0200
committerSven Gothel <[email protected]>2023-04-14 18:25:23 +0200
commit6259e407e07b1a2f51dc10eaecacc5f2aedef389 (patch)
tree8c215c61ba8bd60465fbef09686b7a31e59ec190 /src/demos/com/jogamp/opengl
parenta798d6bcbdccebe58d3a46ce07aedb574a15ef51 (diff)
GraphUI Demo FontView01: Add font-name and selected glyphID to screenshot filename (documentation)
Diffstat (limited to 'src/demos/com/jogamp/opengl')
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java
index daf125e87..5dd5afc35 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java
@@ -45,16 +45,15 @@ import com.jogamp.graph.ui.layout.Padding;
import com.jogamp.graph.ui.shapes.GlyphShape;
import com.jogamp.graph.ui.shapes.Label;
import com.jogamp.graph.ui.shapes.Rectangle;
-import com.jogamp.newt.event.MouseEvent;
import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GLCapabilities;
+import com.jogamp.opengl.GLCapabilitiesImmutable;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.demos.graph.FontSetDemos;
import com.jogamp.opengl.demos.util.MiscUtils;
-import com.jogamp.opengl.math.Vec3f;
import com.jogamp.opengl.math.geom.AABBox;
import com.jogamp.opengl.util.Animator;
@@ -230,7 +229,7 @@ public class FontView01 {
// glyphCont.markShapeDirty();
// grid.markShapeDirty();
System.err.println();
- scene.screenshot(true, scene.nextScreenshotFile(null, FontView01.class.getSimpleName(), options.renderModes, window.getChosenGLCapabilities(), null));
+ printScreenOnGLThread(scene, window.getChosenGLCapabilities(), font, gs.getGlyph().getID());
}
});
mainGrid.addShape(c);
@@ -266,10 +265,15 @@ public class FontView01 {
}
scene.addShape(infoGrid);
- scene.screenshot(true, scene.nextScreenshotFile(null, FontView01.class.getSimpleName(), options.renderModes, window.getChosenGLCapabilities(), null));
+ printScreenOnGLThread(scene, window.getChosenGLCapabilities(), font, 0);
// stay open ..
}
+ static void printScreenOnGLThread(final Scene scene, final GLCapabilitiesImmutable caps, final Font font, final int glyphID) {
+ final String fn = font.getFullFamilyName().replace(' ', '_').replace('-', '_');
+ scene.screenshot(true, scene.nextScreenshotFile(null, FontView01.class.getSimpleName(), options.renderModes, caps, fn+"_gid"+glyphID));
+ }
+
static void setGlyphInfo(final Font font, final Label label, final char symbol, final Font.Glyph g) {
final String info = getGlyphInfo(symbol, g);
final AABBox fbox = font.getGlyphBounds(info);