Skip to content

OpenTypeMsdfSource

final class OpenTypeMsdfSource
Extends: MsdfSource
Package: dev.joid.lib.font.impl.msdf.source · Module: core · Source: OpenTypeMsdfSource.java

Reads a face from a TrueType or OpenType file, generating its MSDF atlas into the cache folder on the first load.

The atlas covers the codepoints 32 to 563 at 2048 × 2048 pixels. It is stored in the msdf area of the cache folder under a hash of the font and of the generator settings, and generated again when the cached file cannot be read.

ReturnsSignatureSummary
OpenTypeMsdfSourceof(Object handle) factoryCreates a source from anything Asset.of accepts: a path, a File, a URL, a stream or an Asset.

Inherited from MsdfSource (2)

italic · weight

ReturnsSignatureSummary
booleansupports(byte[] header) staticIf true, header starts like a TrueType, OpenType or font collection file.
Stringdescribe()Returns whether the atlas was generated or read from the cache, and its file.
AssetgetAsset()Returns the font file.
FilegetFile()Returns the cached atlas file, null before the face is read.
booleanisGenerated()If true, the last read generated the atlas instead of finding it in the cache.
Inherited from MsdfSource (1)

read

TypeNameValueSummary
intHEADER4The number of bytes supports needs: 4.

OpenTypeMsdfSource of(Object handle) factory

Creates a source from anything Asset.of accepts: a path, a File, a URL, a stream or an Asset.

boolean supports(byte[] header) static

If true, header starts like a TrueType, OpenType or font collection file.

String describe()

Returns whether the atlas was generated or read from the cache, and its file.

Asset getAsset()

Returns the font file.

File getFile()

Returns the cached atlas file, null before the face is read.

boolean isGenerated()

If true, the last read generated the atlas instead of finding it in the cache.

int HEADER

The number of bytes supports needs: 4.


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