Top Description Inners Fields Methods
com.jogamp.graph.font

public Interface Font

Known Direct Implementers
jogamp.graph.font.typecast.TypecastFont
Imports
jogamp.graph.geom.plane.AffineTransform, com.jogamp.graph.curve.OutlineShape, com.jogamp.opengl.math.geom.AABBox

Interface wrapper for font implementation.

TrueType Font Specification:

TrueType Font Table Introduction:

Misc.:

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Font.Glyph

Glyph for font http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6cmap.html http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6glyf.html http://www.microsoft.com/typography/otspec/glyf.htm

public static interface
Font.Metrics

Metrics for font Depending on the font's direction, horizontal or vertical, the following tables shall be used: Vertical http://developer.apple.com/fonts/TTRefMan/RM06/Chap6vhea.html Horizontal http://developer.apple.com/fonts/TTRefMan/RM06/Chap6hhea.html

Field Summary

Modifier and TypeField and Description
public static final int
NAME_COPYRIGHT

font name indices for name table

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Method Summary

Modifier and TypeMethod and Description
public float
getAdvanceWidth(final int glyphID, final float
Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
pixelSize
)

public StringBuilder
getAllNames(final StringBuilder string, final String separator)

public StringBuilder
getFullFamilyName(final StringBuilder buffer)

Shall return the family and subfamily name, separated a dash.

public Font.Glyph
getGlyph(final char symbol)

public float
getLineHeight(final float
Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
pixelSize
)

public AABBox
getMetricBounds(final CharSequence
string text
string
,
final float
Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
pixelSize
)

Return the layout bounding box as computed by each glyph's metrics.

public float
getMetricHeight(final CharSequence string, final float
Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
pixelSize
,
final AABBox tmp)

public Font.Metrics
public float
getMetricWidth(final CharSequence string, final float
Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
pixelSize
)

public String
getName(final int nameIndex)

public StringBuilder
getName(final StringBuilder string, final int nameIndex)

public int
public float

Returns:

pixel-per-inch, pixelSize scale factor for font operations.
getPixelSize
(final float
in point-per-inch
fontSize
,
final float
display resolution in dots-per-inch
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
public AABBox
getPointsBounds(final AffineTransform
optional given transform
transform
,
final CharSequence
string text
string
,
final float
Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)
pixelSize
,
final AffineTransform
temporary AffineTransform storage, mandatory
temp1
,
final AffineTransform
temporary AffineTransform storage, mandatory
temp2
)

Return the bounding box by taking each glyph's point-based bounding box into account.

public boolean
isPrintableChar(final char c)

public String

Field Detail

NAME_DESIGNERback to summary
public static final int NAME_DESIGNER
NAME_FAMILYback to summary
public static final int NAME_FAMILY
NAME_FULLNAMEback to summary
public static final int NAME_FULLNAME
NAME_MANUFACTURERback to summary
public static final int NAME_MANUFACTURER
NAME_SUBFAMILYback to summary
public static final int NAME_SUBFAMILY
NAME_UNIQUNAMEback to summary
public static final int NAME_UNIQUNAME
NAME_VERSIONback to summary
public static final int NAME_VERSION

Method Detail

getAdvanceWidthback to summary
public float getAdvanceWidth(final int glyphID, final float pixelSize)
Parameters
pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)

getAllNamesback to summary
public StringBuilder getAllNames(final StringBuilder string, final String separator)
getFullFamilyNameback to summary
public StringBuilder getFullFamilyName(final StringBuilder buffer)

Shall return the family and subfamily name, separated a dash.

getName(StringBuilder, int) w/ NAME_FAMILY and NAME_SUBFAMILY

Example: "Ubuntu-Regular"

getGlyphback to summary
public Font.Glyph getGlyph(final char symbol)
getLineHeightback to summary
public float getLineHeight(final float pixelSize)
Parameters
pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)

getMetricBoundsback to summary
public AABBox getMetricBounds(final CharSequence string, final 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:CharSequence

string text

pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)

getMetricHeightback to summary
public float getMetricHeight(final CharSequence string, final float pixelSize, final AABBox tmp)
Parameters
pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)

getMetricsback to summary
public Font.Metrics getMetrics()
getMetricWidthback to summary
public float getMetricWidth(final CharSequence string, final float pixelSize)
Parameters
pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)

getNameback to summary
public String getName(final int nameIndex)
getNameback to summary
public StringBuilder getName(final StringBuilder string, final int nameIndex)
getNumGlyphsback to summary
public int getNumGlyphs()
getPixelSizeback to summary
public float getPixelSize(final float fontSize, final 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:float

in point-per-inch

resolution:float

display resolution in dots-per-inch

Returns:float

pixel-per-inch, pixelSize scale factor for font operations.

getPointsBoundsback to summary
public AABBox getPointsBounds(final AffineTransform transform, final CharSequence string, final float pixelSize, final AffineTransform temp1, final AffineTransform temp2)

Return the bounding box by taking each glyph's point-based bounding box into account.

Parameters
transform:AffineTransform

optional given transform

string:CharSequence

string text

pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see getPixelSize(float, float)

temp1:AffineTransform

temporary AffineTransform storage, mandatory

temp2:AffineTransform

temporary AffineTransform storage, mandatory

isPrintableCharback to summary
public boolean isPrintableChar(final char c)
toStringback to summary
public String toString()

Shall return getFullFamilyName()

Annotations
@Override
com.jogamp.graph.font back to summary

public Interface Font.Glyph

Known Direct Implementers
jogamp.graph.font.typecast.TypecastGlyph

Glyph for font http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6cmap.html http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6glyf.html http://www.microsoft.com/typography/otspec/glyf.htm

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int

Method Summary

Modifier and TypeMethod and Description
public float
getAdvance(final float
Use pointSize * resolution for resolution correct pixel-size, see Font#getPixelSize(float, float)
pixelSize
,
boolean useFrationalMetrics)

public AABBox
public AABBox

Returns:

the given and set AABBox 'dest'
getBBox
(final AABBox
AABBox instance set to this metrics boundary w/ given pixelSize
dest
,
final float
Use pointSize * resolution for resolution correct pixel-size, see Font#getPixelSize(float, float)
pixelSize
,
float[]
caller provided temporary 3-component vector
tmpV3
)

public Font
public short
public float
getScale(final float
Use pointSize * resolution for resolution correct pixel-size, see Font#getPixelSize(float, float)
pixelSize
)

public OutlineShape
public char
public int

Field Detail

ID_CRback to summary
public static final int ID_CR
ID_SPACEback to summary
public static final int ID_SPACE
ID_UNKNOWNback to summary
public static final int ID_UNKNOWN

Method Detail

getAdvanceback to summary
public float getAdvance(final float pixelSize, boolean useFrationalMetrics)
Parameters
pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see Font#getPixelSize(float, float)

getBBoxback to summary
public AABBox getBBox()
getBBoxback to summary
public AABBox getBBox(final AABBox dest, final float pixelSize, float[] tmpV3)
Parameters
dest:AABBox

AABBox instance set to this metrics boundary w/ given pixelSize

pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see Font#getPixelSize(float, float)

tmpV3:float[]

caller provided temporary 3-component vector

Returns:AABBox

the given and set AABBox 'dest'

getFontback to summary
public Font getFont()
getIDback to summary
public short getID()
getScaleback to summary
public float getScale(final float pixelSize)
Parameters
pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see Font#getPixelSize(float, float)

getShapeback to summary
public OutlineShape getShape()
getSymbolback to summary
public char getSymbol()
hashCodeback to summary
public int hashCode()
com.jogamp.graph.font back to summary

public Interface Font.Metrics

Known Direct Implementers
jogamp.graph.font.typecast.TypecastHMetrics

Metrics for font Depending on the font's direction, horizontal or vertical, the following tables shall be used: Vertical http://developer.apple.com/fonts/TTRefMan/RM06/Chap6vhea.html Horizontal http://developer.apple.com/fonts/TTRefMan/RM06/Chap6hhea.html

Method Summary

Modifier and TypeMethod and Description
public float
getAscent(final float pixelSize)

public AABBox

Returns:

the given and set AABBox 'dest'
getBBox
(final AABBox
AABBox instance set to this metrics boundary w/ given pixelSize
dest
,
final float
Use pointSize * resolution for resolution correct pixel-size, see Font#getPixelSize(float, float)
pixelSize
,
final float[]
caller provided temporary 3-component vector
tmpV3
)

public float
getDescent(final float pixelSize)

public float
getLineGap(final float pixelSize)

public float
getMaxExtend(final float pixelSize)

public float
getScale(final float pixelSize)

Method Detail

getAscentback to summary
public float getAscent(final float pixelSize)
getBBoxback to summary
public AABBox getBBox(final AABBox dest, final float pixelSize, final float[] tmpV3)
Parameters
dest:AABBox

AABBox instance set to this metrics boundary w/ given pixelSize

pixelSize:float

Use pointSize * resolution for resolution correct pixel-size, see Font#getPixelSize(float, float)

tmpV3:float[]

caller provided temporary 3-component vector

Returns:AABBox

the given and set AABBox 'dest'

getDescentback to summary
public float getDescent(final float pixelSize)
getLineGapback to summary
public float getLineGap(final float pixelSize)
getMaxExtendback to summary
public float getMaxExtend(final float pixelSize)
getScaleback to summary
public float getScale(final float pixelSize)