diff options
author | Sven Gothel <sgothel@jausoft.com> | 2023-08-28 22:57:53 +0200 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2023-08-28 22:57:53 +0200 |
commit | 920e529516bb264f04138ed1caca80d4925e3773 (patch) | |
tree | 498bce9425f880cab2cd36b4251eaa4e231e912c /src/jogl/classes/com/jogamp/graph/font/Font.java | |
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/jogl/classes/com/jogamp/graph/font/Font.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/font/Font.java | 37 |
1 files changed, 34 insertions, 3 deletions
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(); |