Package limn.backend.spi
Interface GlyphOutlines
public interface GlyphOutlines
The outlines of the glyphs a
ShapedText names, for a writer that draws text
as text rather than as pixels: a PDF page keeps each glyph as its outline and maps it back to the
characters it stands for.
A shaped run names its face by a number only the ruler that shaped it understands
(ShapedText.Run.faceId()); the backend that installed that ruler is the one
that can turn the number back into a face, so it implements this. Optional: a backend that has
none leaves it out, and a document then draws a run it cannot outline from its characters'
pictures where it has them, and not at all where it has none, with a warning.
UI thread only, as the ruler is: the faces are the ruler's.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA glyph drawn in place of a character.static final recordA picture drawn in place of a character: a colour emoji's strike.static interfaceOne thing a glyphless cluster draws. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionWhat draws the characters of a cluster a shaped run left without a glyph (ShapedText.NO_GLYPH): a colour emoji's picture, or a glyph of the face the screen would fall back to, each placed one after the other from the cluster's x.faceName(int faceId) static voidinstall(GlyphOutlines outlines) Installs a backend's source where a document reads it; called byBackendServices.install().booleanisSyntheticBold(int faceId) booleanoutline(int faceId, int glyphId, Path2D.Visitor out) Draws a glyph's outline in the face's own units, y growing up from the baseline, as the font file has it: contours whose winding is the non-zero rule's, curves as curves.default CompletionStage<Void> settled()When no face this source shapes with is still loading.static voiduninstall(GlyphOutlines outlines) Takes back a source installed byinstall(limn.backend.spi.GlyphOutlines), at the backend's shutdown; another one installed since stays.intunitsPerEm(int faceId)
-
Field Details
-
NONE
A source that knows no face.
-
-
Method Details
-
unitsPerEm
int unitsPerEm(int faceId) - Parameters:
faceId- a face number from a shaped run- Returns:
- the face's units per em, or 0 when this source does not know the face (one evicted since the run was shaped, or one from another ruler)
-
faceName
- Parameters:
faceId- a face number from a shaped run- Returns:
- the face's name, for the document's font resources;
""for an unknown face
-
isSyntheticBold
boolean isSyntheticBold(int faceId) - Parameters:
faceId- a face number from a shaped run- Returns:
- whether the face is drawn bold by thickening a regular one, which a writer reproduces by stroking each outline as well as filling it
-
outline
Draws a glyph's outline in the face's own units, y growing up from the baseline, as the font file has it: contours whose winding is the non-zero rule's, curves as curves.- Parameters:
faceId- a face number from a shaped runglyphId- a glyph of that faceout- receives the outline- Returns:
- whether the face is known; a known glyph with no ink (a space) draws nothing and answers true
-
cluster
What draws the characters of a cluster a shaped run left without a glyph (ShapedText.NO_GLYPH): a colour emoji's picture, or a glyph of the face the screen would fall back to, each placed one after the other from the cluster's x.- Parameters:
characters- the cluster's charactersfont- the run's font- Returns:
- the pieces in order; empty when nothing draws them
-
settled
When no face this source shapes with is still loading. A face the shaper asked for while a document was recorded (a script's fallback, loaded in the background on its first need) was drawn as boxes for that recording; a document waits on this and records its pages again, where a window simply draws its next frame.- Returns:
- a stage completed on the UI thread once nothing is loading; completed already when nothing is, which the default answers
-
install
Installs a backend's source where a document reads it; called byBackendServices.install().- Parameters:
outlines- the backend's source
-
uninstall
Takes back a source installed byinstall(limn.backend.spi.GlyphOutlines), at the backend's shutdown; another one installed since stays.- Parameters:
outlines- the source that was installed
-