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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| GlyphEntry(int codepoint, double advance, Shape shape) | Creates the entry of a code point, with its advance in ems and its outline. |
Methods
Section titled “Methods”Position and size
Section titled “Position and size”| Returns | Signature | Summary |
|---|---|---|
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. |
Queries
Section titled “Queries”| Returns | Signature | Summary |
|---|---|---|
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. |
Actions
Section titled “Actions”| Returns | Signature | Summary |
|---|---|---|
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. |
Creation details
Section titled “Creation details”GlyphEntry
Section titled “GlyphEntry”GlyphEntry(int codepoint, double advance, Shape shape)
Creates the entry of a code point, with its advance in ems and its outline.
Method details
Section titled “Method details”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.
getWidth
Section titled “getWidth”int getWidth()
Returns the width of the glyph in the atlas, in pixels, margin included.
getHeight
Section titled “getHeight”int getHeight()
Returns the height of the glyph in the atlas, in pixels, margin included.
getShape
Section titled “getShape”Shape getShape()
Returns the outline.
getCodepoint
Section titled “getCodepoint”int getCodepoint()
Returns the code point.
getAdvance
Section titled “getAdvance”double getAdvance()
Returns the advance, in ems.
getBounds
Section titled “getBounds”double[] getBounds()
Returns the bounds of the outline, {left, bottom, right, top} in ems, or null for a glyph without outline.
getTop
Section titled “getTop”double getTop()
Returns the top of the area of the glyph, in ems, margin included.
getBottom
Section titled “getBottom”double getBottom()
Returns the bottom of the area of the glyph, in ems, margin included.
getLeft
Section titled “getLeft”double getLeft()
Returns the left of the area of the glyph, in ems, margin included.
getRight
Section titled “getRight”double getRight()
Returns the right of the area of the glyph, in ems, margin included.
isDrawable
Section titled “isDrawable”boolean isDrawable()
If true, the glyph has an outline to draw; a space has none.
measure
Section titled “measure”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
