Top Description Inners Fields Constructors Methods
org.apache.fontbox.ttf

pack-priv Class GlyphRenderer

extends Object
Class Inheritance
Imports
org.apache.commons.logging.Log, .LogFactory, java.awt.geom.GeneralPath, java.util.ArrayList, .List, .Locale

This class provides a glyph to GeneralPath conversion for true type fonts. Based on code from Apache Batik, a subproject of Apache XMLGraphics.
See Also
http://xmlgraphics.apache.org/batik Contour rendering ported from PDF.js, viewed on 14.2.2015, rev 2e97c0d, pdf.js/src/core/font_renderer.js

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
GlyphRenderer.Point

This class represents one point of a glyph.

Field Summary

Modifier and TypeField and Description
private final GlyphDescription
private static final Log

Constructor Summary

AccessConstructor and Description
pack-priv
GlyphRenderer(GlyphDescription glyphDescription)

Method Summary

Modifier and TypeMethod and Description
private GeneralPath

Returns:

the calculated GeneralPath
calculatePath
(GlyphRenderer.Point[]
the points to be used to generate the GeneralPath
points
)

Use the given points to calculate a GeneralPath.

private GlyphRenderer.Point[]
describe(GlyphDescription gd)

Set the points of a glyph from the GlyphDescription.

public GeneralPath

Returns:

the path
getPath
()

Returns the path of the glyph.

private void
private int
midValue(int a, int b)

private GlyphRenderer.Point
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

glyphDescriptionback to summary
private final GlyphDescription glyphDescription
LOGback to summary
private static final Log LOG

Constructor Detail

GlyphRendererback to summary
pack-priv GlyphRenderer(GlyphDescription glyphDescription)

Method Detail

calculatePathback to summary
private GeneralPath calculatePath(GlyphRenderer.Point[] points)

Use the given points to calculate a GeneralPath.

Parameters
points:GlyphRenderer.Point[]

the points to be used to generate the GeneralPath

Returns:GeneralPath

the calculated GeneralPath

describeback to summary
private GlyphRenderer.Point[] describe(GlyphDescription gd)

Set the points of a glyph from the GlyphDescription.

getPathback to summary
public GeneralPath getPath()

Returns the path of the glyph.

Returns:GeneralPath

the path

lineToback to summary
private void lineTo(GeneralPath path, GlyphRenderer.Point point)
midValueback to summary
private int midValue(int a, int b)
midValueback to summary
private GlyphRenderer.Point midValue(GlyphRenderer.Point point1, GlyphRenderer.Point point2)
moveToback to summary
private void moveTo(GeneralPath path, GlyphRenderer.Point point)
quadToback to summary
private void quadTo(GeneralPath path, GlyphRenderer.Point ctrlPoint, GlyphRenderer.Point point)
org.apache.fontbox.ttf back to summary

private Class GlyphRenderer.Point

extends Object
Class Inheritance

This class represents one point of a glyph.

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private int
x

private int
y

Constructor Summary

AccessConstructor and Description
pack-priv
Point(int xValue, int yValue, boolean onCurveValue, boolean endOfContourValue)

pack-priv
Point(int xValue, int yValue)

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

endOfContourback to summary
private boolean endOfContour
onCurveback to summary
private boolean onCurve
xback to summary
private int x
yback to summary
private int y

Constructor Detail

Pointback to summary
pack-priv Point(int xValue, int yValue, boolean onCurveValue, boolean endOfContourValue)
Pointback to summary
pack-priv Point(int xValue, int yValue)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override