Top Fields Constructors Methods
jogamp.graph.font.typecast

pack-priv Class TypecastFont

extends Object
implements Font
Class Inheritance
All Implemented Interfaces
com.jogamp.graph.font.Font
Imports
jogamp.graph.font.typecast.ot.OTFont, .OTFontCollection, jogamp.graph.font.typecast.ot.table.CmapFormat, .CmapIndexEntry, .CmapTable, .HdmxTable, .ID, jogamp.graph.geom.plane.AffineTransform, com.jogamp.common.util.IntObjectHashMap, com.jogamp.graph.curve.OutlineShape, com.jogamp.graph.font.Font, .FontFactory, com.jogamp.graph.geom.SVertex, .Vertex, com.jogamp.opengl.math.geom.AABBox

Field Summary

Modifier and TypeField and Description
private final IntObjectHashMap
private final int
private final CmapFormat
pack-priv static final boolean
pack-priv final OTFont
private final TypecastHMetrics
private final float[]
private static final Vertex.Factory<SVertex>

Constructor Summary

AccessConstructor and Description
public

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
)

Implements com.jogamp.graph.font.Font.getAdvanceWidth.

public StringBuilder
public StringBuilder
getFullFamilyName(StringBuilder sb)

Implements com.jogamp.graph.font.Font.getFullFamilyName.

Shall return the family and subfamily name, separated a dash.
public Font.Glyph
getGlyph(final char symbol)

Implements com.jogamp.graph.font.Font.getGlyph.

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

Implements com.jogamp.graph.font.Font.getLineHeight.

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

Implements com.jogamp.graph.font.Font.getMetricBounds.

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)

Implements com.jogamp.graph.font.Font.getMetricHeight.

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

Implements com.jogamp.graph.font.Font.getMetricWidth.

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

Implements com.jogamp.graph.font.Font.getName.

public String
getName(final int nameIndex)

Implements com.jogamp.graph.font.Font.getName.

public final int
public final float
getPixelSize(final float
in point-per-inch
fontSize
,
final float
display resolution in dots-per-inch
resolution
)

Implements com.jogamp.graph.font.Font.getPixelSize.

       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
)

Implements com.jogamp.graph.font.Font.getPointsBounds.

Return the bounding box by taking each glyph's point-based bounding box into account.
public boolean
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

char2Glyphback to summary
private final IntObjectHashMap char2Glyph
cmapentriesback to summary
private final int cmapentries
cmapFormatback to summary
private final CmapFormat cmapFormat
DEBUGback to summary
pack-priv static final boolean DEBUG
fontback to summary
pack-priv final OTFont font
metricsback to summary
private final TypecastHMetrics metrics
tmpV3back to summary
private final float[] tmpV3
vertexFactoryback to summary
private static final Vertex.Factory<SVertex> vertexFactory

Constructor Detail

TypecastFontback to summary
public TypecastFont(final OTFontCollection fontset)

Method Detail

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

Implements com.jogamp.graph.font.Font.getAdvanceWidth.

Parameters
pixelSize:float

Doc from com.jogamp.graph.font.Font.getAdvanceWidth.

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

Annotations
@Override
getAllNamesback to summary
public StringBuilder getAllNames(final StringBuilder sb, final String separator)

Implements com.jogamp.graph.font.Font.getAllNames.

Annotations
@Override
getFullFamilyNameback to summary
public StringBuilder getFullFamilyName(StringBuilder sb)

Implements com.jogamp.graph.font.Font.getFullFamilyName.

Doc from com.jogamp.graph.font.Font.getFullFamilyName.

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

getName(StringBuilder, int) w/ NAME_FAMILY and NAME_SUBFAMILY

Example: "Ubuntu-Regular"

Annotations
@Override
getGlyphback to summary
public Font.Glyph getGlyph(final char symbol)

Implements com.jogamp.graph.font.Font.getGlyph.

Annotations
@Override
getLineHeightback to summary
public float getLineHeight(final float pixelSize)

Implements com.jogamp.graph.font.Font.getLineHeight.

Parameters
pixelSize:float

Doc from com.jogamp.graph.font.Font.getLineHeight.

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

Annotations
@Override
getMetricBoundsback to summary
public AABBox getMetricBounds(final CharSequence string, final float pixelSize)

Implements com.jogamp.graph.font.Font.getMetricBounds.

Doc from com.jogamp.graph.font.Font.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:CharSequence

string text

pixelSize:float

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

Annotations
@Override
getMetricHeightback to summary
public float getMetricHeight(final CharSequence string, final float pixelSize, final AABBox tmp)

Implements com.jogamp.graph.font.Font.getMetricHeight.

Parameters
pixelSize:float

Doc from com.jogamp.graph.font.Font.getMetricHeight.

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

Annotations
@Override
getMetricsback to summary
public final Font.Metrics getMetrics()

Implements com.jogamp.graph.font.Font.getMetrics.

Annotations
@Override
getMetricWidthback to summary
public float getMetricWidth(final CharSequence string, final float pixelSize)

Implements com.jogamp.graph.font.Font.getMetricWidth.

Parameters
pixelSize:float

Doc from com.jogamp.graph.font.Font.getMetricWidth.

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

Annotations
@Override
getNameback to summary
public StringBuilder getName(final StringBuilder sb, final int nameIndex)

Implements com.jogamp.graph.font.Font.getName.

Annotations
@Override
getNameback to summary
public String getName(final int nameIndex)

Implements com.jogamp.graph.font.Font.getName.

Annotations
@Override
getNumGlyphsback to summary
public final int getNumGlyphs()

Implements com.jogamp.graph.font.Font.getNumGlyphs.

Annotations
@Override
getPixelSizeback to summary
public final float getPixelSize(final float fontSize, final float resolution)

Implements com.jogamp.graph.font.Font.getPixelSize.

Doc from com.jogamp.graph.font.Font.getPixelSize.

       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.

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

Implements com.jogamp.graph.font.Font.getPointsBounds.

Doc from com.jogamp.graph.font.Font.getPointsBounds.

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

Annotations
@Override
isPrintableCharback to summary
public boolean isPrintableChar(final char c)

Implements com.jogamp.graph.font.Font.isPrintableChar.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements com.jogamp.graph.font.Font.toString.

Doc from com.jogamp.graph.font.Font.toString.

Shall return getFullFamilyName()

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override