Skip to content

IFontFace

interface IFontFace
Known subtypes: MsdfFontFace
Package: dev.joid.lib.font.impl.glyph · Module: core · Source: IFontFace.java

One face of a glyph font, a weight and a style, with its metrics on 1 of the font size.

MsdfFontFace implements it; implement it with your own GlyphTextRenderer for another kind of glyph font. Every metric is on 1 of the font size: a line height of 1.2F at a size of 20 design pixels is 24 design pixels.

ReturnsSignatureSummary
booleanisItalic() abstractIf true, this face is italic.
floatgetAscender() abstractReturns the height above the baseline, on 1 of the font size.
floatgetDescender() abstractReturns the depth under the baseline, on 1 of the font size, negative below it.
floatgetLineHeight() abstractReturns the height of one line, on 1 of the font size.
floatgetUnderlineY() abstractReturns the position of an underline relative to the baseline, on 1 of the font size, negative below it.
floatgetUnderlineThickness() abstractReturns the thickness of an underline, on 1 of the font size.
StringgetName() abstractReturns the name of the face, shown in the warnings.
FontWeightgetWeight() abstractReturns the FontWeight of this face.
floatgetAdvance(int codepoint) abstractReturns the distance from codepoint to the next character, on 1 of the font size.
floatgetKerning(int previous, int current) abstractReturns the adjustment between previous and current, on 1 of the font size, 0F for none.
booleanhasGlyph(int codepoint) abstractIf true, this face can draw codepoint; the renderer skips a character it cannot draw, except a space.

boolean isItalic() abstract

If true, this face is italic.

float getAscender() abstract

Returns the height above the baseline, on 1 of the font size.

float getDescender() abstract

Returns the depth under the baseline, on 1 of the font size, negative below it.

float getLineHeight() abstract

Returns the height of one line, on 1 of the font size.

float getUnderlineY() abstract

Returns the position of an underline relative to the baseline, on 1 of the font size, negative below it.

float getUnderlineThickness() abstract

Returns the thickness of an underline, on 1 of the font size.

String getName() abstract

Returns the name of the face, shown in the warnings.

FontWeight getWeight() abstract

Returns the FontWeight of this face.

float getAdvance(int codepoint) abstract

Returns the distance from codepoint to the next character, on 1 of the font size.

float getKerning(int previous, int current) abstract

Returns the adjustment between previous and current, on 1 of the font size, 0F for none.

boolean hasGlyph(int codepoint) abstract

If true, this face can draw codepoint; the renderer skips a character it cannot draw, except a space.


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