Package org.apache.fontbox.ttf
Class GlyphRenderer
- java.lang.Object
-
- org.apache.fontbox.ttf.GlyphRenderer
-
class GlyphRenderer extends java.lang.Object
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 Classes Modifier and Type Class Description private static class
GlyphRenderer.Point
This class represents one point of a glyph.
-
Field Summary
Fields Modifier and Type Field Description private GlyphDescription
glyphDescription
private static org.apache.commons.logging.Log
LOG
-
Constructor Summary
Constructors Constructor Description GlyphRenderer(GlyphDescription glyphDescription)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.awt.geom.GeneralPath
calculatePath(GlyphRenderer.Point[] points)
Use the given points to calculate a GeneralPath.private GlyphRenderer.Point[]
describe(GlyphDescription gd)
Set the points of a glyph from the GlyphDescription.java.awt.geom.GeneralPath
getPath()
Returns the path of the glyph.private void
lineTo(java.awt.geom.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(java.awt.geom.GeneralPath path, GlyphRenderer.Point point)
private void
quadTo(java.awt.geom.GeneralPath path, GlyphRenderer.Point ctrlPoint, GlyphRenderer.Point point)
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
-
glyphDescription
private GlyphDescription glyphDescription
-
-
Constructor Detail
-
GlyphRenderer
GlyphRenderer(GlyphDescription glyphDescription)
-
-
Method Detail
-
getPath
public java.awt.geom.GeneralPath getPath()
Returns the path of the glyph.- Returns:
- the path
-
describe
private GlyphRenderer.Point[] describe(GlyphDescription gd)
Set the points of a glyph from the GlyphDescription.
-
calculatePath
private java.awt.geom.GeneralPath calculatePath(GlyphRenderer.Point[] points)
Use the given points to calculate a GeneralPath.- Parameters:
points
- the points to be used to generate the GeneralPath- Returns:
- the calculated GeneralPath
-
moveTo
private void moveTo(java.awt.geom.GeneralPath path, GlyphRenderer.Point point)
-
lineTo
private void lineTo(java.awt.geom.GeneralPath path, GlyphRenderer.Point point)
-
quadTo
private void quadTo(java.awt.geom.GeneralPath path, GlyphRenderer.Point ctrlPoint, GlyphRenderer.Point point)
-
midValue
private int midValue(int a, int b)
-
midValue
private GlyphRenderer.Point midValue(GlyphRenderer.Point point1, GlyphRenderer.Point point2)
-
-