FontMetaEntity

data class FontMetaEntity(val ttf: String = "", val size: Int = 8, val oversample: Double = 5.0)(source)

一个资源包 TTF 字体及其两个固定定位载体。 Resource-pack TTF configuration backed by two fixed positioning carriers.

Parameters

ttf

字体文件名(不含 .ttf)。 / Font filename without .ttf.

size

字体的 GUI 像素大小。 / GUI pixel size of the font.

oversample

TTF 采样倍率。 / TTF oversampling factor.

Constructors

Link copied to clipboard
constructor(ttf: String = "", size: Int = 8, oversample: Double = 5.0)

Properties

Link copied to clipboard
lateinit var id: String
Link copied to clipboard
Link copied to clipboard
val size: Int
Link copied to clipboard
val ttf: String

Functions

Link copied to clipboard
fun prepareMetrics(file: File)

Measures the native TTF baseline once so Layout y can consistently mean the visual top edge. Missing or unreadable files fall back to a size-based line metric; rendering never depends on AWT after loading.

Link copied to clipboard
fun releaseFontJson(folder: File)

Writes at most the two shared geometry carriers used by this font.

fun releaseFontJson(basePackName: String = ResourcePackPaths.DIRECTORY)

将固定定位载体写成资源包字体 JSON。 Writes the fixed positioning carriers into the resource pack.