Package com.jogamp.graph.font
Interface Font
-
public interface FontInterface 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 Classes Modifier and Type Interface Description static interfaceFont.GlyphGlyph 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 interfaceFont.MetricsMetrics 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
Fields Modifier and Type Field Description static intNAME_COPYRIGHTfont name indices for name tablestatic intNAME_DESIGNERstatic intNAME_FAMILYstatic intNAME_FULLNAMEstatic intNAME_MANUFACTURERstatic intNAME_SUBFAMILYstatic intNAME_UNIQUNAMEstatic intNAME_VERSION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description floatgetAdvanceWidth(int glyphID, float pixelSize)StringBuildergetAllNames(StringBuilder string, String separator)StringBuildergetFullFamilyName(StringBuilder buffer)Shall return the family and subfamily name, separated a dash.Font.GlyphgetGlyph(char symbol)floatgetLineHeight(float pixelSize)AABBoxgetMetricBounds(CharSequence string, float pixelSize)Return the layout bounding box as computed by each glyph's metrics.floatgetMetricHeight(CharSequence string, float pixelSize, AABBox tmp)Font.MetricsgetMetrics()floatgetMetricWidth(CharSequence string, float pixelSize)StringgetName(int nameIndex)StringBuildergetName(StringBuilder string, int nameIndex)intgetNumGlyphs()floatgetPixelSize(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_emAABBoxgetPointsBounds(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)StringtoString()Shall return#getFullFamilyName()
-
-
-
Field Detail
-
NAME_COPYRIGHT
static final int NAME_COPYRIGHT
font name indices for name table- See Also:
- Constant Field Values
-
NAME_FAMILY
static final int NAME_FAMILY
- See Also:
- Constant Field Values
-
NAME_SUBFAMILY
static final int NAME_SUBFAMILY
- See Also:
- Constant Field Values
-
NAME_UNIQUNAME
static final int NAME_UNIQUNAME
- See Also:
- Constant Field Values
-
NAME_FULLNAME
static final int NAME_FULLNAME
- See Also:
- Constant Field Values
-
NAME_VERSION
static final int NAME_VERSION
- See Also:
- Constant Field Values
-
NAME_MANUFACTURER
static final int NAME_MANUFACTURER
- See Also:
- Constant Field Values
-
NAME_DESIGNER
static final int NAME_DESIGNER
- See Also:
- Constant Field Values
-
-
Method Detail
-
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_FAMILYandNAME_SUBFAMILYExample: "
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-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
Font.Glyph getGlyph(char symbol)
-
getNumGlyphs
int getNumGlyphs()
-
getLineHeight
float getLineHeight(float pixelSize)
- Parameters:
pixelSize- UsepointSize * resolutionfor resolution correct pixel-size, seegetPixelSize(float, float)- Returns:
-
getMetricWidth
float getMetricWidth(CharSequence string, float pixelSize)
- Parameters:
string-pixelSize- UsepointSize * resolutionfor resolution correct pixel-size, seegetPixelSize(float, float)- Returns:
-
getMetricHeight
float getMetricHeight(CharSequence string, float pixelSize, AABBox tmp)
- Parameters:
string-pixelSize- UsepointSize * resolutionfor resolution correct pixel-size, seegetPixelSize(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 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)
-
-