Skip to content

Packer

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

Places the glyphs of an atlas in rows and finds the largest glyph size that fits.

ReturnsSignatureSummary
booleanpack(List glyphs, double size, double range, int width, int height) staticMeasures and places every drawable glyph at that size, tallest first, with one pixel between glyphs; returns false when they do not fit in the atlas.
doublefit(List glyphs, double range, int width, int height) staticReturns the largest size, to a sixteenth of a pixel, at which the glyphs fit, and leaves them placed at it.

boolean pack(List<GlyphEntry> glyphs, double size, double range, int width, int height) static

Measures and places every drawable glyph at that size, tallest first, with one pixel between glyphs; returns false when they do not fit in the atlas.

double fit(List<GlyphEntry> glyphs, double range, int width, int height) static

Throws:

  • IllegalStateException: The glyphs do not fit in …x… even at …px, raise —width and —height or shrink the charset

Returns the largest size, to a sixteenth of a pixel, at which the glyphs fit, and leaves them placed at it. Throws an IllegalStateException when they do not fit even at 1 pixel.


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