Package org.apache.fontbox.ttf
Class GlyphRenderer
java.lang.Object
org.apache.fontbox.ttf.GlyphRenderer
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 Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
This class represents one point of a glyph. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GlyphDescription
private static final org.apache.commons.logging.Log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate GeneralPath
calculatePath
(GlyphRenderer.Point[] points) Use the given points to calculate a GeneralPath.private GlyphRenderer.Point[]
Set the points of a glyph from the GlyphDescription.getPath()
Returns the path of the glyph.private void
lineTo
(GeneralPath path, GlyphRenderer.Point point) private int
midValue
(int a, int b) private GlyphRenderer.Point
midValue
(GlyphRenderer.Point point1, GlyphRenderer.Point point2) private void
moveTo
(GeneralPath path, GlyphRenderer.Point point) private void
quadTo
(GeneralPath path, GlyphRenderer.Point ctrlPoint, GlyphRenderer.Point point)
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
glyphDescription
-
-
Constructor Details
-
GlyphRenderer
GlyphRenderer(GlyphDescription glyphDescription)
-
-
Method Details
-
getPath
Returns the path of the glyph.- Returns:
- the path
-
describe
Set the points of a glyph from the GlyphDescription. -
calculatePath
Use the given points to calculate a GeneralPath.- Parameters:
points
- the points to be used to generate the GeneralPath- Returns:
- the calculated GeneralPath
-
moveTo
-
lineTo
-
quadTo
-
midValue
private int midValue(int a, int b) -
midValue
-