@mathjax/src
    Preparing search index...

    The SVG FontData class

    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<SvgDelimiterData> = {}

    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

    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 = 'SVG'
    NAME: string = ''

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

    OPTIONS: { dynamicPrefix: string } = ...
    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

    • 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

    • 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

      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

      • 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

    • 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