@mathjax/src
    Preparing search index...

    Class FontData<C, V, D>

    The FontData class (for storing character bounding box data by variant, and the stretchy delimiter data).

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _styles: StyleJson

    Any styles needed for the font

    cssFamilyPrefix: string

    A prefix to use for explicit font-family CSS settings

    cssFontMap: CssFontMap = {}

    The data to use to make variants to default fonts and css for unknown characters

    cssFontPrefix: string = ''

    The prefix to use for font names (e.g., 'TEX')

    delimiters: DelimiterMap<D> = {}

    The actual delimiter information for this font

    options: OptionList

    The font options

    The actual font parameters for this font

    remapChars: RemapMapMap = {}

    The character maps

    sizeVariants: string[]

    The actual size variants to use for this font

    skewIcFactor: number = 0.75

    Factor by which to multiply italic correction for computation of delta in munderover

    stretchVariants: string[]

    The actual stretchy variants to use for this font

    variant: VariantMap<C, V> = {}

    The actual variant information for this font

    defaultAccentMap: RemapMap = ...

    The default remappings

    defaultChars: CharMapMap<CharOptions> = {}

    The default character data

    defaultCssFamilyPrefix: string = ''

    The default prefix for explicit font-family settings

    defaultCssFonts: CssFontMap = ...

    The family, style, and weight to use for each variant (for unknown characters) The 'unknown' family is replaced by options.unknownFamily

    defaultDelimiters: DelimiterMap<DelimiterData> = {}

    The default delimiter data

    defaultMnMap: RemapMap = ...

    Default map for characters inside

    defaultMoMap: RemapMap = ...

    Default map for characters inside

    defaultParams: FontParameters = ...

    The default font parameters for the font

    defaultSizeVariants: string[] = []

    The default variants for the fixed size stretchy delimiters

    defaultStretchVariants: string[] = []

    The default variants for the assembly parts for stretchy delimiters

    defaultVariants: string[][] = ...

    The standard variants to define

    dynamicExtensions: DynamicFontMap = ...

    The font extension dynamic data

    dynamicFiles: DynamicFileList = {}

    The dynamic file data

    JAX: string = 'common'

    The name of the output jax this font data is for (used by extensions)

    NAME: string = ''

    The name of the font that is being defined (used by extensions)

    OPTIONS: OptionList = ...

    Options for the font

    SmpRanges: number[][] = ...

    Character ranges to remap into Math Alphanumerics

    SmpRemap: SmpMap = ...

    Characters to map back to other Unicode positions (holes in the Math Alphanumeric ranges)

    SmpRemapGreekL: SmpMap = ...

    Greek lower-case variants

    SmpRemapGreekU: SmpMap = ...

    Greek upper-case variants

    VariantSmp: { [name: string]: string | SmpData } = ...

    Variant locations in the Math Alphabnumerics block: [upper-alpha, lower-alpha, upper-Greek, lower-Greek, numbers]

    Accessors

    Methods

    • Implemented in subclasses

      Parameters

      • _fonts: string[]

        The IDs for the fonts to add CSS for

      • Optional_root: string

        The root URL for the fonts (can be set by extensions)

      Returns void

    • Add an extension to an existing font instance (options will get their defaults).

      Parameters

      • data: FontExtensionData<C, D>

        The data for the font extension to merge into this font.

      • prefix: string = ''

        The [prefix] to add to all component names

      Returns string[]

      The new CSS rules needed for this extension

    • Creates the data structure for a variant -- an object with prototype chain that includes a copy of the linked variant, and then the inherited variant chain.

      The reason for this extra link is that for a mathvariant like bold-italic, you want to inherit from both the bold and italic variants, but the prototype chain can only inherit from one. So for bold-italic, we make an object that has a prototype consisting of a copy of the bold data, and add the italic data as the prototype chain. (Since this is a copy, we keep a record of this link so that if bold is changed later, we can update this copy. That is not needed for the prototype chain, since the prototypes are the actual objects, not copies.) We then use this bold-plus-italic object as the prototype chain for the bold-italic object

      That means that bold-italic will first look in its own object for specifically bold-italic glyphs that are defined there, then in the copy of the bold glyphs (only its top level is copied, not its prototype chain), and then the specifically italic glyphs, and then the prototype chain for italics, which is the normal glyphs. Effectively, this means bold-italic looks for bold-italic, then bold, then italic, then normal glyphs in order to find the given character.

      Parameters

      • name: string

        The new variant to create

      • inherit: string = null

        The variant to use if a character is not in this one

      • link: string = null

        A variant to search before the inherit one (but only its top-level object).

      Returns void

    • Create a collection of variants

      Parameters

      • variants: string[][]

        Array of [name, inherit?, link?] values for the variants to define

      Returns void

    • Defines new character data in a given variant (We use Object.assign() here rather than the spread operator since the character maps are objeccts with prototypes, and we don't want to loose those by doing {...chars} or something similar.)

      Parameters

      • name: string

        The variant for these characters

      • chars: CharMap<C>

        The characters to define

      Returns void

    • Defines a character remapping map

      Parameters

      • name: string

        The name of the map to define or augment

      • remap: RemapMap

        The characters to remap

      Returns void

    • Parameters

      • family: string

        The font camily to use

      Returns string

      The family with the css prefix

    • Parameters

      • name: string

        The name of the map to query

      • c: number

        The character to remap

      Returns string

      The remapped character (or the original)

    • Parameters

      • n: number

        The delimiter character number whose variant is needed

      • i: number

        The index in the size array of the size whose variant is needed

      Returns string

      The variant of the i-th size for delimiter n

    • Parameters

      • n: number

        The delimiter character number whose variant is needed

      • i: number

        The index in the stretch array of the part whose variant is needed

      Returns string

      The variant of the i-th part for delimiter n

    • Parameters

      • n: number

        The delimiter character number whose variants are needed

      Returns string[]

      The variants for the parts of the delimiter

    • Parameters

      • name: string

        The name of the variant whose data is to be obtained

      Returns V

      The data for the requested variant (or undefined)

    • Load the data for the character from the proper file, and do any associated setup that needs access to the FontData instance.

      Parameters

      Returns Promise<void>

      The promise that is resolved when the file is loaded

    • Load all dynamic files.

      Returns Promise<void[]>

      A promise that is resolved after all the dynamic files are loaded.

    • Load all dynamic files synchronously, using mathjax.asyncLoad, when it is set to a synchronous loading function, as in util/asyncLoad/node.ts.

      Returns void

    • Create the mapping from Basic Latin and Greek blocks to the Math Alphanumeric block for a given variant.

      Parameters

      • chars: CharMap<C>

        The character mapping to fill.

      • name: string

        The new variant name.

      Returns void

    • Parameters

      • list: number[]

        The list of numbers to adjust

      • N: number

        The pivot number

      Returns number[]

      The list of adjusted numbers

    • Parameters

      • delimiters: DelimiterMap<DelimiterData>

        The delimiter list to modify

      • keys: string[]

        The ids of the delimiters to check

      • sizeN: number

        The original number of size variants

      • stretchN: number

        The original number ot stretch variants

      Returns void

    • Create the setup function for a given dynamically loaded file

      Type Parameters

      Parameters

      • extension: string

        The name of the font extension for this file

      • file: string

        The file being loaded

      • variants: CharMapMap<C>

        The character data to be added

      • delimiters: DelimiterMap<D> = {}

        The delimiter data to be added

      • fonts: string[] = null

        The fonts to add CSS to

      Returns void