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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
OpenTypeMsdfSource | of(Object handle) factory | Creates a source from anything Asset.of accepts: a path, a File, a URL, a stream or an Asset. |
Properties
Section titled “Properties”Inherited from MsdfSource (2)
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
Inherited from MsdfSource (1)
Constants and fields
Section titled “Constants and fields”| Type | Name | Value | Summary |
|---|---|---|---|
int | HEADER | 4 | The number of bytes supports needs: 4. |
Creation details
Section titled “Creation details”OpenTypeMsdfSource of(Object handle) factory
Creates a source from anything Asset.of accepts: a path, a File, a URL, a stream or an Asset.
Method details
Section titled “Method details”supports
Section titled “supports”boolean supports(byte[] header) static
If true, header starts like a TrueType, OpenType or font collection file.
describe
Section titled “describe”String describe()
Returns whether the atlas was generated or read from the cache, and its file.
getAsset
Section titled “getAsset”Asset getAsset()
Returns the font file.
getFile
Section titled “getFile”File getFile()
Returns the cached atlas file, null before the face is read.
isGenerated
Section titled “isGenerated”boolean isGenerated()
If true, the last read generated the atlas instead of finding it in the cache.
Constant and field details
Section titled “Constant and field details”HEADER
Section titled “HEADER”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
