Space Provider#

The space provider defines the width of a space character's glyph. It is the most simple provider: it only contains the "advances" dictionary.

The keys of the advances are the characters, and the values are the widths.

In mcfonts only, rangestrings can also be used as the keys. They will be expanded as they are for the Options Provider.

The default width for U+0020 SPACE is 4.

Structure#

{
    "type": "space",
    "advances": {
        "\u0020": 4
    }
}

Advances#

The advances is a dictionary. Keys must be one character long; however, mcfonts also accepts rangestrings in place of keys as well. Values must be integers.

To glyph sizes#

Space advances can be converted to a Legacy Unicode Provider glyph sizes with mcfonts.providers.SpaceProvider.to_glyph_sizes():

import mcfonts.providers
mcfonts.providers.SpaceProviders.to_glyph_sizes(
    {
        "a": 8,
        " ": 4,
        "!": 0
    }
)

Conversely, glyph sizes can be converted into space advances with mcfonts.providers.LegacyUnicodeProvider.to_advances().