Options
All
  • Public
  • Public/Protected
  • All
Menu

Collection of font assets used to render glyphs when using a TextCanvas.

summary

A FontCatalog works as a stack of SDF bitmap fonts (using the BMFont format) designed to cover the widest Unicode code point range possible. In order to manage all these assets elegantly, the assets inside the FontCatalog are stored on a per-Unicode-Block basis, and assets for a block are only loaded once a glyph belonging to that block is requested.

Bitmap information coming from all different fonts is then stored in a unified WebGL GPU Texture resource, which can be sampled to render all currently loaded glyphs.

Hierarchy

  • FontCatalog

Index

Properties

Readonly distanceRange

distanceRange: number

Distance range used to generate the SDF bitmaps.

Readonly fonts

fonts: Font[]

Array of supported fonts.

Readonly maxCodePointCount

maxCodePointCount: number

Maximum number of unique code points bitmaps this FontCatalog's internal texture can store simultaneously.

Readonly maxHeight

maxHeight: number

FontCatalog's maximum glyph height (pixels).

Readonly maxWidth

maxWidth: number

FontCatalog's maximum glyph width (pixels).

Readonly name

name: string

FontCatalog's name.

showReplacementGlyphs

showReplacementGlyphs: boolean = false

If true, a replacement glyph is returned for every missing glyph.

Readonly size

size: number

FontCatalog's glyph size (pixels).

Readonly type

type: string

FontCatalog's type (sdf or msdf).

Readonly unicodeBlocks

unicodeBlocks: UnicodeBlock[]

Array of supported Unicode blocks.

Readonly url

url: string

FontCatalog's URL.

Accessors

isLoading

  • get isLoading(): boolean

texture

  • get texture(): Texture

textureSize

  • get textureSize(): Vector2

Methods

clear

  • clear(): void

dispose

  • dispose(): void

getFont

  • getFont(codePoint: number, fontName?: undefined | string): Font

getGlyph

getGlyphs

loadBlock

loadCharset

removeBlock

update

  • update(renderer: WebGLRenderer): void

updateMemoryUsage

Static load

  • load(path: string, maxCodePointCount: number): Promise<FontCatalog>

Static loadJSON

  • loadJSON(url: string): Promise<any>

Static loadTexture

  • loadTexture(url: string): Promise<Texture>

Generated using TypeDoc