Package org.apache.fontbox.ttf
Class GlyphRenderer
- java.lang.Object
-
- org.apache.fontbox.ttf.GlyphRenderer
-
class GlyphRenderer extends java.lang.ObjectThis 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 classGlyphRenderer.PointThis class represents one point of a glyph.
-
Field Summary
Fields Modifier and Type Field Description private GlyphDescriptionglyphDescriptionprivate static org.apache.commons.logging.LogLOG
-
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.GeneralPathcalculatePath(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.GeneralPathgetPath()Returns the path of the glyph.private voidlineTo(java.awt.geom.GeneralPath path, GlyphRenderer.Point point)private intmidValue(int a, int b)private GlyphRenderer.PointmidValue(GlyphRenderer.Point point1, GlyphRenderer.Point point2)private voidmoveTo(java.awt.geom.GeneralPath path, GlyphRenderer.Point point)private voidquadTo(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 final 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)
-
-