Class BpxFontConfigPico8

A free to use (CC-0) font created by zep and distributed as part of PICO-8 fantasy console.

Links:

Implements

Static values

Constructors

Methods

Properties

Static values

spriteSheetUrl: "beetpx/pico-8-font.png" = "beetpx/pico-8-font.png"

Constructors

Methods

  • This functions maps the text grapheme (a user-perceived character like a or a multi-character emoji like ❤️) before trying to find its corresponding glyph in a glyphs map. It would be typically used to call grapheme.toLowerCase() in fonts which have glyphs defined for lower-case characters only.

    Parameters

    • grapheme: string

    Returns string

Properties

ascent: number = 5

An amount of pixels from the baseline (included) to the top-most pixel of font's glyphs.

descent: number = 0

An amount of pixels from the baseline (excluded) to the bottom-most pixel of font's glyphs.

glyphs: Map<string, BpxGlyph> = ...

A map which contains the glyphs for specified graphemes (keys of the map). Grapheme is a user-perceived character like a or a multi-character emoji like ❤️. Before retrieving a glyph from this map, a grapheme is normalized with use of mapGrapheme function. Typically, it would be useful when you want to specify same glyphs for both upper-case and lower-case characters, so you are able to define lower-case ones only and then implement mapGrapheme as grapheme.toLowerCase().

lineGap: number = 1

An amount of pixels between the bottom-most pixel of the previous line (excluded) and the top-most pixel of the next line (excluded).