diff options
author | Sven Gothel <[email protected]> | 2023-08-28 22:57:53 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-08-28 22:57:53 +0200 |
commit | 920e529516bb264f04138ed1caca80d4925e3773 (patch) | |
tree | 498bce9425f880cab2cd36b4251eaa4e231e912c /src/graphui/classes/com/jogamp/graph/ui | |
parent | 733cc5272cfed10fa07b707e29fd756f44581508 (diff) |
Graph Font + Glyph: More robust detetection and API definition of non-contour/whitespace Glyphs (detect and allow to skip 'em)
We also drop shapes for both, but for id 0 (unknown).
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui')
3 files changed, 7 insertions, 8 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/AnimGroup.java b/src/graphui/classes/com/jogamp/graph/ui/AnimGroup.java index 2f3d2bf07..f0c2f9df4 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/AnimGroup.java +++ b/src/graphui/classes/com/jogamp/graph/ui/AnimGroup.java @@ -406,7 +406,7 @@ public class AnimGroup extends Group { final Font.GlyphVisitor fgv = new Font.GlyphVisitor() { @Override public void visit(final char symbol, final Glyph glyph, final AffineTransform t) { - if( !glyph.isWhiteSpace() && null != glyph.getShape() ) { + if( !glyph.isNonContour() ) { final GlyphShape gs = new GlyphShape(renderModes, symbol, glyph, t.getTranslateX(), t.getTranslateY()); gs.setScale(fontScale, fontScale, 1f); gs.moveTo(gs.getOrigPos().x()*fontScale, gs.getOrigPos().y()*fontScale, gs.getOrigPos().z()); diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java index 19791d099..76e454c12 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java @@ -71,7 +71,7 @@ public class GlyphShape extends GraphShape { this.symbol = symbol; this.glyph = glyph; this.origPos = new Vec3f(x, y, 0f); - if( glyph.isWhiteSpace() || null == glyph.getShape() ) { + if( glyph.isNonContour() ) { setEnabled(false); } final int[/*2*/] vertIndexCount = Region.countOutlineShape(glyph.getShape(), new int[2]); @@ -139,7 +139,7 @@ public class GlyphShape extends GraphShape { final Font.GlyphVisitor fgv = new Font.GlyphVisitor() { @Override public void visit(final char symbol, final Glyph glyph, final AffineTransform t) { - if( !glyph.isWhiteSpace() && null != glyph.getShape() ) { + if( !glyph.isNonContour() ) { res.add( new GlyphShape(renderModes, symbol, glyph, t.getTranslateX(), t.getTranslateY()) ); } } diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/Label.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/Label.java index b8edb74e2..4904f4d42 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/Label.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/Label.java @@ -193,12 +193,11 @@ public class Label extends GraphShape { private final Font.GlyphVisitor glyphVisitor = new Font.GlyphVisitor() { @Override public void visit(final char symbol, final Glyph glyph, final AffineTransform t) { - if( glyph.isWhiteSpace() ) { - return; + if( !glyph.isNonContour() ) { + final OutlineShape shape = glyph.getShape(); + shape.setSharpness(oshapeSharpness); + region.addOutlineShape(shape, t, rgbaColor); } - final OutlineShape shape = glyph.getShape(); - shape.setSharpness(oshapeSharpness); - region.addOutlineShape(shape, t, rgbaColor); } }; |