Interface Font.Metrics

  • Enclosing interface:
    Font

    public static interface Font.Metrics
    Metrics for font Depending on the font's direction, horizontal or vertical, the following tables shall be used: Vertical https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6vhea.html Horizontal https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6hhea.html
    • Method Detail

      • getAscentFU

        int getAscentFU()
        Distance from baseline of highest ascender, a positive value.
        Returns:
        ascent in font-units, sourced from `hhea' table.
      • getAscent

        float getAscent()
        Distance from baseline of highest ascender, a positive value.
        Returns:
        ascent in font em-size [0..1], sourced from `hhea' table.
      • getDescentFU

        int getDescentFU()
        Distance from baseline of lowest descender, a negative value.
        Returns:
        descent in font-units, sourced from `hhea' table.
      • getDescent

        float getDescent()
        Distance from baseline of lowest descender, a negative value.
        Returns:
        descend in font em-size [0..1], sourced from `hhea' table.
      • getLineGapFU

        int getLineGapFU()
        Typographic line gap, a positive value.
        Returns:
        line-gap in font-units, sourced from `hhea' table.
      • getLineGap

        float getLineGap()
        Typographic line gap, a positive value.
        Returns:
        line-gap in font em-size [0..1], sourced from `hhea' table.
      • getMaxExtendFU

        int getMaxExtendFU()
        max(lsb + (xMax-xMin)), a positive value.
        Returns:
        max-extend in font-units, sourced from `hhea' table.
      • getMaxExtend

        float getMaxExtend()
        max(lsb + (xMax-xMin)), a positive value.
        Returns:
        max-extend in font em-size [0..1], sourced from `hhea' table.
      • getUnitsPerEM

        int getUnitsPerEM()
        Returns the font's units per EM from the 'head' table. One em square covers one glyph.
      • getScale

        float getScale​(int funits)
        Return fractional font em-size [0..1], i.e. funits divided by getUnitsPerEM(), i.e.
            return funits / head.unitsPerEM;
         
        Parameters:
        funits - smallest font unit, where getUnitsPerEM() square covers whole glyph
        Returns:
        fractional font em-size [0..1]
      • getBoundsFU

        AABBox getBoundsFU​(AABBox dest)
        Parameters:
        dest - AABBox instance set to this metrics boundary in font-units
        Returns:
        the given and set AABBox 'dest' in font units
      • getBounds

        AABBox getBounds​(AABBox dest)
        Parameters:
        dest - AABBox instance set to this metrics boundary in font em-size [0..1]
        Returns:
        the given and set AABBox 'dest' in font units