diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph')
3 files changed, 42 insertions, 8 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java index c282a4b92..d25ab4311 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java @@ -188,7 +188,9 @@ public abstract class GLRegion extends Region { final Font.GlyphVisitor2 visitor = new Font.GlyphVisitor2() {
@Override
public final void visit(final char symbol, final Font.Glyph glyph) {
- Region.countOutlineShape(glyph.getShape(), vertIndexCount);
+ if( !glyph.isNonContour() ) {
+ Region.countOutlineShape(glyph.getShape(), vertIndexCount);
+ }
} };
font.processString(visitor, str);
return GLRegion.create(glp, renderModes, colorTexSeq, vertIndexCount[0], vertIndexCount[1]);
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java index 62a1ecb95..0090480bb 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java @@ -145,10 +145,9 @@ public class TextRegionUtil { final Font.GlyphVisitor visitor = new Font.GlyphVisitor() { @Override public void visit(final char symbol, final Glyph glyph, final AffineTransform t) { - if( glyph.isWhiteSpace() ) { - return; + if( !glyph.isNonContour() ) { + region.addOutlineShape(glyph.getShape(), t, rgbaColor); } - region.addOutlineShape(glyph.getShape(), t, rgbaColor); } }; if( preGrowRegion ) { @@ -175,7 +174,9 @@ public class TextRegionUtil { final Font.GlyphVisitor2 visitor = new Font.GlyphVisitor2() { @Override public final void visit(final char symbol, final Font.Glyph glyph) { - Region.countOutlineShape(glyph.getShape(), vertIndexCount); + if( !glyph.isNonContour() ) { + Region.countOutlineShape(glyph.getShape(), vertIndexCount); + } } }; font.processString(visitor, str); return vertIndexCount; diff --git a/src/jogl/classes/com/jogamp/graph/font/Font.java b/src/jogl/classes/com/jogamp/graph/font/Font.java index 314040adf..ef1179153 100644 --- a/src/jogl/classes/com/jogamp/graph/font/Font.java +++ b/src/jogl/classes/com/jogamp/graph/font/Font.java @@ -175,13 +175,44 @@ public interface Font { /** Return the glyph's name, source from `post` table */ String getName(); - /** Return true if the underlying {@link #getShape()} is a whitespace, otherwise false. */ - boolean isWhiteSpace(); + /** + * Return true if the glyph is a whitespace, otherwise false. + * <p> + * A whitespace glyph has no {@link #getShape()}, but a valid {@link #getBounds()} and {@link #getAdvance()}. + * </p> + * Being a whitespace glyph excludes {@link #isUndefined()}. + * @see #isUndefined() + * @see #isNonContour() + */ + boolean isWhitespace(); - /** Return true if the Glyph denotes an undefined {@link #getID()} symbol, i.e. {@link #getName()} == `.notdef`. */ + /** + * Return true if the Glyph denotes an undefined {@link #getID()} symbol as follows + * <ul> + * <li>it's glyph index is {@link #ID_UNKNOWN}, i.e. {@code 0x00}</li> + * <li>has the {@link #getName() name} `.notdef`, `NULL`, `null` or `.null`</li> + * <li>has no original underlying shape</li> + * </ul> + * <p> + * An undefined glyph has no {@link #getShape()} if glyph index is not {@link #ID_UNKNOWN}. + * </p> + * <p> + * An undefined glyph has a default {@link #getBounds()} and {@link #getAdvance()}. + * </p> + * Being an undefined shape excludes {@link #isWhitespace()}. + * @see #isWhitespace() + * @see #isNonContour() + */ boolean isUndefined(); /** + * Returns true if {@link #isWhitespace()} or {@link #isUndefined()}. + * @see #isWhitespace() + * @see #isUndefined() + */ + boolean isNonContour(); + + /** * Return the AABBox in font-units, borrowing internal instance. */ AABBox getBoundsFU(); |