Skip to content

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.

Positions and metrics are in design pixels, scaled by the font size of the glyph.

PropertyTypeDefaultSummary
codepointintThe 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.
colorColorThe color the glyph draws in: getColor() reads it, color(Color) replaces it.

ReturnsSignatureSummary
doublegetX() abstractReturns the left edge of the glyph, before its offset.
intgetIndex() abstractReturns the index of the glyph’s character in the string, markup tags included, so that it stays stable while the text is typed.
doublegetSize() abstractReturns the font size of the glyph, in design pixels.
doublegetAdvance() abstractReturns the distance from this glyph to the next one, kerning and letter spacing included.
doublegetAdvance(int codepoint) abstractReturns the advance of codepoint in the face of this glyph, at its size.
doublegetOffsetX() abstractReturns the horizontal offset that the effects gave the glyph.
doublegetOffsetY() abstractReturns the vertical offset that the effects gave the glyph.
doublegetAscender() abstractReturns the height of the face above the baseline, at the size of the glyph.
doublegetDescender() abstractReturns the depth of the face under the baseline at the size of the glyph, negative below it.
doublegetBaseline() abstractReturns the y of the baseline of the glyph.
doublegetUnderlineY() abstractReturns the y where an underline of the face sits.
TextStylegetStyle() abstractReturns the TextStyle that the glyph was laid out with: weight, italic, color and effects.
doublegetUnderlineThickness() abstractReturns the thickness of an underline of the face, at the size of the glyph.
booleanisShadow() abstractIf true, this glyph is the copy drawn as the shadow of the text.
booleanhasGlyph(int codepoint) abstractIf true, the face of this glyph can draw codepoint.
thisoffset(double x, double y) fluent abstractMoves the glyph by x, y from its place, without moving the next glyphs.

  • this codepoint(int codepoint) fluent abstract
  • int 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 abstract
  • Color getColor() abstract

The color the glyph draws in: getColor() reads it, color(Color) replaces it.

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.


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

Report a problem with this page