Interface Font


  • public interface Font
    Interface wrapper for font implementation.

    TrueType Font Specification:

    • http://www.freetype.org/freetype2/documentation.html
    • http://developer.apple.com/fonts/ttrefman/rm06/Chap6.html
    • http://www.microsoft.com/typography/SpecificationsOverview.mspx
    • http://www.microsoft.com/typography/otspec/

    TrueType Font Table Introduction:

    • http://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08

    Misc.:

    • Treatis on Font Rasterization https://freddie.witherden.org/pages/font-rasterisation/
    • Glyph Hell http://walon.org/pub/ttf/ttf_glyphs.htm

    • Method Detail

      • getName

        String getName​(int nameIndex)
      • getPixelSize

        float getPixelSize​(float fontSize,
                           float resolution)
                Font Scale Formula:
                 inch: 25.4 mm
                 pointSize: [point] = [1/72 inch]
        
                 [1]      Scale := pointSize * resolution / ( 72 points per inch * units_per_em )
                 [2]  PixelSize := pointSize * resolution / ( 72 points per inch )
                 [3]      Scale := PixelSize / units_per_em
         
        Parameters:
        fontSize - in point-per-inch
        resolution - display resolution in dots-per-inch
        Returns:
        pixel-per-inch, pixelSize scale factor for font operations.
      • getAdvanceWidth

        float getAdvanceWidth​(int glyphID,
                              float pixelSize)
        Parameters:
        glyphID -
        pixelSize - Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
        Returns:
      • getNumGlyphs

        int getNumGlyphs()
      • getLineHeight

        float getLineHeight​(float pixelSize)
        Parameters:
        pixelSize - Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
        Returns:
      • getMetricWidth

        float getMetricWidth​(CharSequence string,
                             float pixelSize)
        Parameters:
        string -
        pixelSize - Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
        Returns:
      • getMetricHeight

        float getMetricHeight​(CharSequence string,
                              float pixelSize,
                              AABBox tmp)
        Parameters:
        string -
        pixelSize - Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
        tmp -
        Returns:
      • getPointsBounds

        AABBox getPointsBounds​(jogamp.graph.geom.plane.AffineTransform transform,
                               CharSequence string,
                               float pixelSize,
                               jogamp.graph.geom.plane.AffineTransform temp1,
                               jogamp.graph.geom.plane.AffineTransform temp2)
        Return the bounding box by taking each glyph's point-based bounding box into account.
        Parameters:
        transform - optional given transform
        string - string text
        pixelSize - Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
        temp1 - temporary AffineTransform storage, mandatory
        temp2 - temporary AffineTransform storage, mandatory
      • isPrintableChar

        boolean isPrintableChar​(char c)
      • toString

        String toString()
        Shall return #getFullFamilyName()
        Overrides:
        toString in class Object