|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Interface wrapper for font implementation. More...
Classes | |
| interface | CodepointIDVisitor |
General purpose (unicode) codepoint symbol and Font.Glyph ID visitor without enforcing Glyph caching. More... | |
| interface | Glyph |
| Glyph for font. More... | |
| interface | GlyphVisitor |
General purpose Font.Glyph visitor. More... | |
| interface | GlyphVisitor2 |
General purpose Font.Glyph visitor w/o AffineTransform. More... | |
| interface | Metrics |
| Metrics for font. More... | |
Public Member Functions | |
| String | getName (final int nameIndex) |
| String | getFullFamilyName () |
| Shall return the family and subfamily name, separated a dash. More... | |
| StringBuilder | getAllNames (final StringBuilder string, final String separator) |
| int | hashCode () |
Returns the hash code based on NAME_UNIQUNAME. More... | |
| boolean | equals (final Object o) |
Returns true if other instance is of same type and NAME_UNIQUNAME is equal. More... | |
| int | getAdvanceWidthFU (final int glyphID) |
Returns advance-width of given glyphID in font-units, sourced from hmtx table - same as Glyph#getAdvanceWidthFU(). More... | |
| float | getAdvanceWidth (final int glyphID) |
Returns advance-width of given glyphID in font em-size [0..1], sourced from hmtx table - same as Glyph#getAdvanceWidth(). More... | |
| Metrics | getMetrics () |
| int | getGlyphCount () |
Returns number of Glyph IDs available, i.e. More... | |
| int | getDefinedCount (final CharSequence text) |
Returns the number of defined Glyphs (coverage), i.e. More... | |
| char | getGlyphCodepoint (final String name) |
Returns the Glyph (unicode) codepoint symbol mapped to given Glyph name. More... | |
| String | getUTF16String (final String name) |
Returns UTF-16 representation of the specified Glyph name using getGlyphCodepoint(String) and getUTF16String(char). More... | |
| int | getGlyphID (final char codepoint) |
Returns the Glyph ID mapped to given UTF16 (unicode) codepoint symbol. More... | |
| Glyph | getGlyph (final String name) |
Returns the Glyph mapped to given name. More... | |
| Glyph | getGlyph (final char codepoint) |
Returns the Glyph mapped to given (unicode) codepoint symbol. More... | |
| Glyph | getGlyph (final int glyph_id) |
Returns the Glyph using given ID. More... | |
| void | forAllCodepoints (final Font.CodepointIDVisitor visitor) |
Visit all (unicode) codepoint symbol and Glyph ID tuple of this font. More... | |
| void | forAllGlyphs (final Font.GlyphVisitor2 visitor) |
Visit all Glyphs of this font. More... | |
| int | getLineHeightFU () |
| Returns line height, baseline-to-baseline in font-units, composed from ‘hhea’ table entries. More... | |
| float | getLineHeight () |
| Returns line height, baseline-to-baseline in em-size [0..1], composed from ‘hhea’ table entries. More... | |
| AABBox | getMetricBoundsFU (final CharSequence string) |
| Returns metric-bounds in font-units. More... | |
| AABBox | getMetricBounds (final CharSequence string) |
| Returns metric-bounds in font em-size. More... | |
| AABBox | getGlyphBounds (final CharSequence string) |
Try using getGlyphBounds(CharSequence, AffineTransform, AffineTransform) to reuse AffineTransform instances. More... | |
| AABBox | getGlyphBounds (final CharSequence string, final AffineTransform tmp1, final AffineTransform tmp2) |
| Returns accurate bounding box by taking each glyph's font em-sized bounding box into account. More... | |
| AABBox | getGlyphBoundsFU (final CharSequence string) |
Try using getGlyphBoundsFU(CharSequence, AffineTransform, AffineTransform) to reuse AffineTransform instances. More... | |
| AABBox | getGlyphBoundsFU (final CharSequence string, final AffineTransform tmp1, final AffineTransform tmp2) |
| Returns accurate bounding box by taking each glyph's font-units sized bounding box into account. More... | |
| AABBox | getGlyphShapeBounds (final AffineTransform transform, final CharSequence string) |
Returns accurate bounding box by taking each glyph's font em-sized OutlineShape into account. More... | |
| AABBox | getGlyphShapeBounds (final AffineTransform transform, final CharSequence string, final AffineTransform tmp1, final AffineTransform tmp2) |
Returns accurate bounding box by taking each glyph's font em-sized OutlineShape into account. More... | |
| boolean | isPrintableChar (final char c) |
| AABBox | processString (final Font.GlyphVisitor visitor, final AffineTransform transform, final CharSequence string) |
Try using processString(GlyphVisitor, AffineTransform, CharSequence, AffineTransform, AffineTransform) to reuse AffineTransform instances. More... | |
| AABBox | processString (final Font.GlyphVisitor visitor, final AffineTransform transform, final CharSequence string, final AffineTransform temp1, final AffineTransform temp2) |
Visit each Glyph and perhaps its OutlineShape of the string with the Font.GlyphVisitor while passing the progressed AffineTransform. More... | |
| void | processString (final Font.GlyphVisitor2 visitor, final CharSequence string) |
Visit each Glyph and perhaps its OutlineShape of the string with the constrained Font.GlyphVisitor2. More... | |
| String | toString () |
Returns getFullFamilyName(). More... | |
| String | fullString () |
| Returns all font details as string. More... | |
Static Public Member Functions | |
| static String | getUTF16String (final char codepoint) |
Returns UTF-16 representation of the specified (unicode) codepoint symbol like Character#toChars(int) or Character#toString(). More... | |
| static Font | getBestCoverage (final Font a, final Font b, final CharSequence s) |
Returns Font with best coverage for given text while favoring a. More... | |
Static Public Attributes | |
| static final int | NAME_COPYRIGHT = 0 |
| font name indices for name table More... | |
| static final int | NAME_FAMILY = 1 |
| static final int | NAME_SUBFAMILY = 2 |
| static final int | NAME_UNIQUNAME = 3 |
| static final int | NAME_FULLNAME = 4 |
| static final int | NAME_VERSION = 5 |
| static final int | NAME_MANUFACTURER = 8 |
| static final int | NAME_DESIGNER = 9 |
Interface wrapper for font implementation.
TrueType Font Specification:
TrueType Font Table Introduction:
Misc.:
Rasterization https://freddie.witherden.org/pages/font-rasterisation/ http://walon.org/pub/ttf/ttf_glyphs.htm | boolean com.jogamp.graph.font.Font.equals | ( | final Object | o | ) |
Returns true if other instance is of same type and NAME_UNIQUNAME is equal.
| void com.jogamp.graph.font.Font.forAllCodepoints | ( | final Font.CodepointIDVisitor | visitor | ) |
| void com.jogamp.graph.font.Font.forAllGlyphs | ( | final Font.GlyphVisitor2 | visitor | ) |
| String com.jogamp.graph.font.Font.fullString | ( | ) |
Returns all font details as string.
| float com.jogamp.graph.font.Font.getAdvanceWidth | ( | final int | glyphID | ) |
Returns advance-width of given glyphID in font em-size [0..1], sourced from hmtx table - same as Glyph#getAdvanceWidth().
| glyphID |
| int com.jogamp.graph.font.Font.getAdvanceWidthFU | ( | final int | glyphID | ) |
Returns advance-width of given glyphID in font-units, sourced from hmtx table - same as Glyph#getAdvanceWidthFU().
| glyphID |
| StringBuilder com.jogamp.graph.font.Font.getAllNames | ( | final StringBuilder | string, |
| final String | separator | ||
| ) |
|
static |
Returns Font with best coverage for given text while favoring a.
See getDefinedCount(CharSequence).
return a.getDefinedCount(text) >= b.getDefinedCount(text) ? a : b;
Definition at line 349 of file Font.java.
| int com.jogamp.graph.font.Font.getDefinedCount | ( | final CharSequence | text | ) |
Returns the number of defined Glyphs (coverage), i.e.
not Glyph#isUndefined(), of given text.
| String com.jogamp.graph.font.Font.getFullFamilyName | ( | ) |
Shall return the family and subfamily name, separated a dash.
getName(StringBuilder, int) w/ NAME_FAMILY and NAME_SUBFAMILY
Example: "@iliteral{code} Ubuntu-Regular @endiliteral "
| Glyph com.jogamp.graph.font.Font.getGlyph | ( | final char | codepoint | ) |
Returns the Glyph mapped to given (unicode) codepoint symbol.
| Glyph com.jogamp.graph.font.Font.getGlyph | ( | final String | name | ) |
| AABBox com.jogamp.graph.font.Font.getGlyphBounds | ( | final CharSequence | string | ) |
Try using getGlyphBounds(CharSequence, AffineTransform, AffineTransform) to reuse AffineTransform instances.
| AABBox com.jogamp.graph.font.Font.getGlyphBounds | ( | final CharSequence | string, |
| final AffineTransform | tmp1, | ||
| final AffineTransform | tmp2 | ||
| ) |
Returns accurate bounding box by taking each glyph's font em-sized bounding box into account.
Glyph bounds is based on each glyph's bounding box and ‘hhea’ composed line height.
| string | string text |
| tmp1 | temp AffineTransform to be reused |
| tmp2 | temp AffineTransform to be reused |
| AABBox com.jogamp.graph.font.Font.getGlyphBoundsFU | ( | final CharSequence | string | ) |
Try using getGlyphBoundsFU(CharSequence, AffineTransform, AffineTransform) to reuse AffineTransform instances.
| AABBox com.jogamp.graph.font.Font.getGlyphBoundsFU | ( | final CharSequence | string, |
| final AffineTransform | tmp1, | ||
| final AffineTransform | tmp2 | ||
| ) |
Returns accurate bounding box by taking each glyph's font-units sized bounding box into account.
Glyph bounds is based on each glyph's bounding box and ‘hhea’ composed line height.
| string | string text |
| tmp1 | temp AffineTransform to be reused |
| tmp2 | temp AffineTransform to be reused |
| char com.jogamp.graph.font.Font.getGlyphCodepoint | ( | final String | name | ) |
| int com.jogamp.graph.font.Font.getGlyphCount | ( | ) |
Returns number of Glyph IDs available, i.e.
retrievable via getGlyph(int) [0..count).
| int com.jogamp.graph.font.Font.getGlyphID | ( | final char | codepoint | ) |
Returns the Glyph ID mapped to given UTF16 (unicode) codepoint symbol.
| AABBox com.jogamp.graph.font.Font.getGlyphShapeBounds | ( | final AffineTransform | transform, |
| final CharSequence | string | ||
| ) |
Returns accurate bounding box by taking each glyph's font em-sized OutlineShape into account.
Glyph shape bounds is based on each glyph's OutlineShape and ‘hhea’ composed line height.
This method is only exposed to validate the produced OutlineShape against getGlyphBounds(CharSequence).
| transform | optional given transform |
| string | string text |
| AABBox com.jogamp.graph.font.Font.getGlyphShapeBounds | ( | final AffineTransform | transform, |
| final CharSequence | string, | ||
| final AffineTransform | tmp1, | ||
| final AffineTransform | tmp2 | ||
| ) |
Returns accurate bounding box by taking each glyph's font em-sized OutlineShape into account.
Glyph shape bounds is based on each glyph's OutlineShape and ‘hhea’ composed line height.
This method is only exposed to validate the produced OutlineShape against getGlyphBounds(CharSequence).
| transform | optional given transform |
| string | string text |
| tmp1 | temp AffineTransform to be reused |
| tmp2 | temp AffineTransform to be reused |
| float com.jogamp.graph.font.Font.getLineHeight | ( | ) |
Returns line height, baseline-to-baseline in em-size [0..1], composed from ‘hhea’ table entries.
return ascent - descent + linegap;
or
// lineGap positive value // descent negative value // ascent positive value return ascent - descent + linegap;
| int com.jogamp.graph.font.Font.getLineHeightFU | ( | ) |
Returns line height, baseline-to-baseline in font-units, composed from ‘hhea’ table entries.
return ascent - descent + linegap;
or
// lineGap positive value // descent negative value // ascent positive value return ascent - descent + linegap;
| AABBox com.jogamp.graph.font.Font.getMetricBounds | ( | final CharSequence | string | ) |
Returns metric-bounds in font em-size.
Metric bounds is based on the hmtx table's advance of each glyph and ‘hhea’ composed line height.
For accurate layout consider using getGlyphBounds(CharSequence).
| AABBox com.jogamp.graph.font.Font.getMetricBoundsFU | ( | final CharSequence | string | ) |
Returns metric-bounds in font-units.
Metric bounds is based on the hmtx table's advance of each glyph and ‘hhea’ composed line height.
For accurate layout consider using getGlyphBoundsFU(CharSequence).
| Metrics com.jogamp.graph.font.Font.getMetrics | ( | ) |
| String com.jogamp.graph.font.Font.getName | ( | final int | nameIndex | ) |
|
static |
Returns UTF-16 representation of the specified (unicode) codepoint symbol like Character#toChars(int) or Character#toString().
The returned string can be inserted in any text.
| codepoint | the (unicode) codepoint symbol |
String conforming result | String com.jogamp.graph.font.Font.getUTF16String | ( | final String | name | ) |
Returns UTF-16 representation of the specified Glyph name using getGlyphCodepoint(String) and getUTF16String(char).
The returned string can be inserted in any text.
| codepoint | the (unicode) codepoint symbol |
String conforming result | int com.jogamp.graph.font.Font.hashCode | ( | ) |
Returns the hash code based on NAME_UNIQUNAME.
| boolean com.jogamp.graph.font.Font.isPrintableChar | ( | final char | c | ) |
| AABBox com.jogamp.graph.font.Font.processString | ( | final Font.GlyphVisitor | visitor, |
| final AffineTransform | transform, | ||
| final CharSequence | string | ||
| ) |
Try using processString(GlyphVisitor, AffineTransform, CharSequence, AffineTransform, AffineTransform) to reuse AffineTransform instances.
| AABBox com.jogamp.graph.font.Font.processString | ( | final Font.GlyphVisitor | visitor, |
| final AffineTransform | transform, | ||
| final CharSequence | string, | ||
| final AffineTransform | temp1, | ||
| final AffineTransform | temp2 | ||
| ) |
Visit each Glyph and perhaps its OutlineShape of the string with the Font.GlyphVisitor while passing the progressed AffineTransform.
The processed shapes are in font em-size [0..1], but can be adjusted with the given transform, progressed and passed to the visitor.
| visitor | handling each Font.Glyph and perhaps its OutlineShape in font em-size [0..1] and the given AffineTransform |
| transform | optional given transform for size and position |
| font | the target Font |
| string | string text |
| temp1 | temporary AffineTransform storage, mandatory |
| temp2 | temporary AffineTransform storage, mandatory |
OutlineShape into account. | void com.jogamp.graph.font.Font.processString | ( | final Font.GlyphVisitor2 | visitor, |
| final CharSequence | string | ||
| ) |
Visit each Glyph and perhaps its OutlineShape of the string with the constrained Font.GlyphVisitor2.
The processed shapes are in font em-size [0..1].
| visitor | handling each Font.Glyph and perhaps its OutlineShape in font em-size [0..1] |
| string | string text |
| String com.jogamp.graph.font.Font.toString | ( | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |