harfbuzzjs
    Preparing search index...

    Class FontFuncs

    An object representing HarfBuzz font functions. Font functions define the methods used by a Font for lower-level queries like glyph advances and extents. HarfBuzz provides built-in default implementations which can be selectively overridden.

    Index

    Constructors

    Properties

    ptr: number

    Methods

    • Set the font's horizontal extents function.

      Parameters

      • func: (font: Font) => FontExtents | null

        The callback receives a Font. It should return an object with ascender, descender, and lineGap, or null on failure.

      Returns void

    • Set the font's vertical extents function.

      Parameters

      • func: (font: Font) => FontExtents | null

        The callback receives a Font. It should return an object with ascender, descender, and lineGap, or null on failure.

      Returns void

    • Set the font's glyph extents function.

      Parameters

      • func: (font: Font, glyph: number) => GlyphExtents | null

        The callback receives a Font and glyph ID. It should return an object with xBearing, yBearing, width, and height, or null on failure.

      Returns void

    • Set the font's glyph from name function.

      Parameters

      • func: (font: Font, name: string) => number | null

        The callback receives a Font and glyph name. It should return the glyph ID, or null on failure.

      Returns void

    • Set the font's glyph horizontal advance function.

      Parameters

      • func: (font: Font, glyph: number) => number

        The callback receives a Font and glyph ID. It should return the horizontal advance of the glyph.

      Returns void

    • Set the font's glyph horizontal kerning function.

      Parameters

      • func: (font: Font, firstGlyph: number, secondGlyph: number) => number

        The callback receives a Font, first glyph ID, and second glyph ID. It should return the horizontal kerning of the glyphs.

      Returns void

    • Set the font's glyph horizontal origin function.

      Parameters

      • func: (font: Font, glyph: number) => [number, number] | null

        The callback receives a Font and glyph ID. It should return the [x, y] horizontal origin of the glyph, or null on failure.

      Returns void

    • Set the font's glyph name function.

      Parameters

      • func: (font: Font, glyph: number) => string | null

        The callback receives a Font and glyph ID. It should return the name of the glyph, or null on failure.

      Returns void

    • Set the font's glyph vertical advance function.

      Parameters

      • func: (font: Font, glyph: number) => number

        The callback receives a Font and glyph ID. It should return the vertical advance of the glyph.

      Returns void

    • Set the font's glyph vertical origin function.

      Parameters

      • func: (font: Font, glyph: number) => [number, number] | null

        The callback receives a Font and glyph ID. It should return the [x, y] vertical origin of the glyph, or null on failure.

      Returns void

    • Set the font's nominal glyph function.

      Parameters

      • func: (font: Font, unicode: number) => number | null

        The callback receives a Font and unicode code point. It should return the nominal glyph of the unicode, or null on failure.

      Returns void

    • Set the font's variation glyph function.

      Parameters

      • func: (font: Font, unicode: number, variationSelector: number) => number | null

        The callback receives a Font, unicode code point, and variation selector. It should return the variation glyph, or null on failure.

      Returns void