diff options
author | Sven Gothel <[email protected]> | 2023-09-01 11:57:47 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-09-01 11:57:47 +0200 |
commit | f6dd8e9562d7e0bbf681c268f40ff4c819057915 (patch) | |
tree | f5f93b8ec249d42d3c8d0624e3d62f2058e6d058 /src/jogl/classes/com/jogamp/graph | |
parent | 5d83a6271495fe43141ee2c7f301f16ea0389134 (diff) |
Graph Font + Glyph: Fix whitespace definition: Include 'no original underlying shape' and add API doc
Regression was introduced with commit 920e529516bb264f04138ed1caca80d4925e3773
'Robust detetection and API definition of non-contour/whitespace Glyphs'.
Issue was mistaken a glyph as undefined if not having an underlying shape,
which is true for some fonts (e.g. 'space').
+++
Also Use post table's name if no underlying shape exists.
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/font/Font.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/font/Font.java b/src/jogl/classes/com/jogamp/graph/font/Font.java index ef1179153..c3c997135 100644 --- a/src/jogl/classes/com/jogamp/graph/font/Font.java +++ b/src/jogl/classes/com/jogamp/graph/font/Font.java @@ -176,22 +176,10 @@ public interface Font { String getName(); /** - * 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 as follows + * Return true if the Glyph denotes an undefined {@link #getID()} symbol, determined 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}. @@ -206,6 +194,22 @@ public interface Font { boolean isUndefined(); /** + * Return true if the Glyph denotes a whitespace, determined as follows + * <ul> + * <li>is not {@link #isUndefined()}</li> + * <li>has no original underlying shape</li> + * <li>has an underlying shape with a zero sized area</li> + * </ul> + * <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(); + + /** * Returns true if {@link #isWhitespace()} or {@link #isUndefined()}. * @see #isWhitespace() * @see #isUndefined() |