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 Classes Modifier and Type Interface Description 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.htmstatic 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
Fields Modifier and Type Field Description static int
NAME_COPYRIGHT
font name indices for name tablestatic int
NAME_DESIGNER
static int
NAME_FAMILY
static int
NAME_FULLNAME
static int
NAME_MANUFACTURER
static int
NAME_SUBFAMILY
static int
NAME_UNIQUNAME
static int
NAME_VERSION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description float
getAdvanceWidth(int glyphID, float pixelSize)
StringBuilder
getAllNames(StringBuilder string, String separator)
StringBuilder
getFullFamilyName(StringBuilder buffer)
Shall return the family and subfamily name, separated a dash.Font.Glyph
getGlyph(char symbol)
float
getLineHeight(float pixelSize)
AABBox
getMetricBounds(CharSequence string, float pixelSize)
Return the layout bounding box as computed by each glyph's metrics.float
getMetricHeight(CharSequence string, float pixelSize, AABBox tmp)
Font.Metrics
getMetrics()
float
getMetricWidth(CharSequence string, float pixelSize)
String
getName(int nameIndex)
StringBuilder
getName(StringBuilder string, int nameIndex)
int
getNumGlyphs()
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_emAABBox
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.boolean
isPrintableChar(char c)
String
toString()
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_FAMILY
andNAME_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-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 * resolution
for 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 * resolution
for resolution correct pixel-size, seegetPixelSize(float, float)
- Returns:
-
getMetricWidth
float getMetricWidth(CharSequence string, float pixelSize)
- Parameters:
string
-pixelSize
- UsepointSize * resolution
for resolution correct pixel-size, seegetPixelSize(float, float)
- Returns:
-
getMetricHeight
float getMetricHeight(CharSequence string, float pixelSize, AABBox tmp)
- Parameters:
string
-pixelSize
- UsepointSize * resolution
for 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 * resolution
for 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 * resolution
for resolution correct pixel-size, seegetPixelSize(float, float)
temp1
- temporary AffineTransform storage, mandatorytemp2
- temporary AffineTransform storage, mandatory
-
isPrintableChar
boolean isPrintableChar(char c)
-
-