Skip to content

GlyphEntry

final class GlyphEntry
Package: dev.joid.tool.msdf.atlas · Module: tool-msdf · Source: GlyphEntry.java

One glyph of an atlas being generated: its code point, advance and outline, then its place and size in the atlas.

ReturnsSignatureSummary
GlyphEntry(int codepoint, double advance, Shape shape)Creates the entry of a code point, with its advance in ems and its outline.

ReturnsSignatureSummary
intgetX()Returns the left edge of the glyph in the atlas, in pixels.
voidsetX(int x)Sets the left edge of the glyph in the atlas.
intgetY()Returns the top edge of the glyph in the atlas, in pixels.
voidsetY(int y)Sets the top edge of the glyph in the atlas.
intgetWidth()Returns the width of the glyph in the atlas, in pixels, margin included.
intgetHeight()Returns the height of the glyph in the atlas, in pixels, margin included.
ReturnsSignatureSummary
ShapegetShape()Returns the outline.
intgetCodepoint()Returns the code point.
doublegetAdvance()Returns the advance, in ems.
double[]getBounds()Returns the bounds of the outline, {left, bottom, right, top} in ems, or null for a glyph without outline.
doublegetTop()Returns the top of the area of the glyph, in ems, margin included.
doublegetBottom()Returns the bottom of the area of the glyph, in ems, margin included.
doublegetLeft()Returns the left of the area of the glyph, in ems, margin included.
doublegetRight()Returns the right of the area of the glyph, in ems, margin included.
booleanisDrawable()If true, the glyph has an outline to draw; a space has none.
ReturnsSignatureSummary
voidmeasure(double size, double range)Computes the area of the glyph at that size in pixels per em, with a margin of half the distance range on each side.

GlyphEntry(int codepoint, double advance, Shape shape)

Creates the entry of a code point, with its advance in ems and its outline.

int getX()

Returns the left edge of the glyph in the atlas, in pixels.

void setX(int x)

Sets the left edge of the glyph in the atlas.

int getY()

Returns the top edge of the glyph in the atlas, in pixels.

void setY(int y)

Sets the top edge of the glyph in the atlas.

int getWidth()

Returns the width of the glyph in the atlas, in pixels, margin included.

int getHeight()

Returns the height of the glyph in the atlas, in pixels, margin included.

Shape getShape()

Returns the outline.

int getCodepoint()

Returns the code point.

double getAdvance()

Returns the advance, in ems.

double[] getBounds()

Returns the bounds of the outline, {left, bottom, right, top} in ems, or null for a glyph without outline.

double getTop()

Returns the top of the area of the glyph, in ems, margin included.

double getBottom()

Returns the bottom of the area of the glyph, in ems, margin included.

double getLeft()

Returns the left of the area of the glyph, in ems, margin included.

double getRight()

Returns the right of the area of the glyph, in ems, margin included.

boolean isDrawable()

If true, the glyph has an outline to draw; a space has none.

void measure(double size, double range)

Computes the area of the glyph at that size in pixels per em, with a margin of half the distance range on each side.


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