ITextGlyph
interface ITextGlyph
Known subtypes: TextGlyph
Package: dev.joid.lib.font.effect · Module: core · Source: ITextGlyph.java
One laid-out glyph as an ITextEffect sees it, with its place, its metrics in design pixels, and the codepoint, color and offset an effect can change.
Description
Section titled “Description”Positions and metrics are in design pixels, scaled by the font size of the glyph.
Learn more
Section titled “Learn more”Properties
Section titled “Properties”| Property | Type | Default | Summary |
|---|---|---|---|
| codepoint | int | The character that the glyph draws: getCodepoint() reads it, codepoint(int) replaces it, for example to scramble a text; the advance of the glyph is unchanged. | |
| color | Color | The color the glyph draws in: getColor() reads it, color(Color) replaces it. |
Methods
Section titled “Methods”For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
double | getX() abstract | Returns the left edge of the glyph, before its offset. |
int | getIndex() abstract | Returns the index of the glyph’s character in the string, markup tags included, so that it stays stable while the text is typed. |
double | getSize() abstract | Returns the font size of the glyph, in design pixels. |
double | getAdvance() abstract | Returns the distance from this glyph to the next one, kerning and letter spacing included. |
double | getAdvance(int codepoint) abstract | Returns the advance of codepoint in the face of this glyph, at its size. |
double | getOffsetX() abstract | Returns the horizontal offset that the effects gave the glyph. |
double | getOffsetY() abstract | Returns the vertical offset that the effects gave the glyph. |
double | getAscender() abstract | Returns the height of the face above the baseline, at the size of the glyph. |
double | getDescender() abstract | Returns the depth of the face under the baseline at the size of the glyph, negative below it. |
double | getBaseline() abstract | Returns the y of the baseline of the glyph. |
double | getUnderlineY() abstract | Returns the y where an underline of the face sits. |
TextStyle | getStyle() abstract | Returns the TextStyle that the glyph was laid out with: weight, italic, color and effects. |
double | getUnderlineThickness() abstract | Returns the thickness of an underline of the face, at the size of the glyph. |
boolean | isShadow() abstract | If true, this glyph is the copy drawn as the shadow of the text. |
boolean | hasGlyph(int codepoint) abstract | If true, the face of this glyph can draw codepoint. |
this | offset(double x, double y) fluent abstract | Moves the glyph by x, y from its place, without moving the next glyphs. |
Property details
Section titled “Property details”codepoint
Section titled “codepoint”this codepoint(int codepoint)fluent abstractint getCodepoint()abstract
The character that the glyph draws: getCodepoint() reads it, codepoint(int) replaces it, for example to scramble a text; the advance of the glyph is unchanged.
this color(Color color)fluent abstractColor getColor()abstract
The color the glyph draws in: getColor() reads it, color(Color) replaces it.
Method details
Section titled “Method details”double getX() abstract
Returns the left edge of the glyph, before its offset.
getIndex
Section titled “getIndex”int getIndex() abstract
Returns the index of the glyph’s character in the string, markup tags included, so that it stays stable while the text is typed.
getSize
Section titled “getSize”double getSize() abstract
Returns the font size of the glyph, in design pixels.
getAdvance
Section titled “getAdvance”double getAdvance() abstract
Returns the distance from this glyph to the next one, kerning and letter spacing included.
double getAdvance(int codepoint) abstract
Returns the advance of codepoint in the face of this glyph, at its size.
getOffsetX
Section titled “getOffsetX”double getOffsetX() abstract
Returns the horizontal offset that the effects gave the glyph.
getOffsetY
Section titled “getOffsetY”double getOffsetY() abstract
Returns the vertical offset that the effects gave the glyph.
getAscender
Section titled “getAscender”double getAscender() abstract
Returns the height of the face above the baseline, at the size of the glyph.
getDescender
Section titled “getDescender”double getDescender() abstract
Returns the depth of the face under the baseline at the size of the glyph, negative below it.
getBaseline
Section titled “getBaseline”double getBaseline() abstract
Returns the y of the baseline of the glyph.
getUnderlineY
Section titled “getUnderlineY”double getUnderlineY() abstract
Returns the y where an underline of the face sits.
getStyle
Section titled “getStyle”TextStyle getStyle() abstract
Returns the TextStyle that the glyph was laid out with: weight, italic, color and effects.
getUnderlineThickness
Section titled “getUnderlineThickness”double getUnderlineThickness() abstract
Returns the thickness of an underline of the face, at the size of the glyph.
isShadow
Section titled “isShadow”boolean isShadow() abstract
If true, this glyph is the copy drawn as the shadow of the text.
hasGlyph
Section titled “hasGlyph”boolean hasGlyph(int codepoint) abstract
If true, the face of this glyph can draw codepoint.
offset
Section titled “offset”this offset(double x, double y) fluent abstract
Moves the glyph by x, y from its place, without moving the next glyphs.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
