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

  • Field Details

  • Method Details

    • getName

      String getName(int nameIndex)
    • getName

      StringBuilder getName(StringBuilder string, int nameIndex)
    • getFullFamilyName

      StringBuilder getFullFamilyName(StringBuilder buffer)
      Shall return the family and subfamily name, separated a dash.

      getName(StringBuilder, int) w/ NAME_FAMILY and NAME_SUBFAMILY

      Example: "Ubuntu-Regular"

    • getAllNames

      StringBuilder getAllNames(StringBuilder string, String separator)
    • 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:
    • getMetrics

      Font.Metrics getMetrics()
    • getGlyph

      Font.Glyph getGlyph(char symbol)
    • 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:
    • getMetricBounds

      AABBox getMetricBounds(CharSequence string, float pixelSize)
      Return the layout bounding box as computed by each glyph's metrics. The result is not pixel correct, bit reflects layout specific metrics.

      See getPointsBounds(AffineTransform, CharSequence, float, AffineTransform, AffineTransform) for pixel correct results.

      Parameters:
      string - string text
      pixelSize - Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
    • 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