Package com.jogamp.graph.font
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceGlyph 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.htmstatic interfaceMetrics 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
FieldsModifier and TypeFieldDescriptionstatic final intfont name indices for name tablestatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionfloatgetAdvanceWidth(int glyphID, float pixelSize) getAllNames(StringBuilder string, String separator) getFullFamilyName(StringBuilder buffer) Shall return the family and subfamily name, separated a dash.getGlyph(char symbol) floatgetLineHeight(float pixelSize) getMetricBounds(CharSequence string, float pixelSize) Return the layout bounding box as computed by each glyph's metrics.floatgetMetricHeight(CharSequence string, float pixelSize, AABBox tmp) floatgetMetricWidth(CharSequence string, float pixelSize) getName(int nameIndex) getName(StringBuilder string, int nameIndex) intfloatgetPixelSize(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_emgetPointsBounds(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.booleanisPrintableChar(char c) toString()Shall return#getFullFamilyName()
-
Field Details
-
NAME_COPYRIGHT
static final int NAME_COPYRIGHTfont name indices for name table- See Also:
-
NAME_FAMILY
static final int NAME_FAMILY- See Also:
-
NAME_SUBFAMILY
static final int NAME_SUBFAMILY- See Also:
-
NAME_UNIQUNAME
static final int NAME_UNIQUNAME- See Also:
-
NAME_FULLNAME
static final int NAME_FULLNAME- See Also:
-
NAME_VERSION
static final int NAME_VERSION- See Also:
-
NAME_MANUFACTURER
static final int NAME_MANUFACTURER- See Also:
-
NAME_DESIGNER
static final int NAME_DESIGNER- See Also:
-
-
Method Details
-
getName
-
getName
-
getFullFamilyName
Shall return the family and subfamily name, separated a dash.getName(StringBuilder, int)w/NAME_FAMILYandNAME_SUBFAMILYExample: "
Ubuntu-Regular" -
getAllNames
-
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-inchresolution- 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- UsepointSize * resolutionfor resolution correct pixel-size, seegetPixelSize(float, float)- Returns:
-
getMetrics
Font.Metrics getMetrics() -
getGlyph
-
getNumGlyphs
int getNumGlyphs() -
getLineHeight
float getLineHeight(float pixelSize) - Parameters:
pixelSize- UsepointSize * resolutionfor resolution correct pixel-size, seegetPixelSize(float, float)- Returns:
-
getMetricWidth
- Parameters:
string-pixelSize- UsepointSize * resolutionfor resolution correct pixel-size, seegetPixelSize(float, float)- Returns:
-
getMetricHeight
- Parameters:
string-pixelSize- UsepointSize * resolutionfor resolution correct pixel-size, seegetPixelSize(float, float)tmp-- Returns:
-
getMetricBounds
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 textpixelSize- UsepointSize * resolutionfor resolution correct pixel-size, seegetPixelSize(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 transformstring- string textpixelSize- UsepointSize * resolutionfor resolution correct pixel-size, seegetPixelSize(float, float)temp1- temporary AffineTransform storage, mandatorytemp2- temporary AffineTransform storage, mandatory
-
isPrintableChar
boolean isPrintableChar(char c) -
toString
String toString()Shall return#getFullFamilyName()
-