Package com.itextpdf.kernel.font
Class Type3Glyph
- java.lang.Object
-
- com.itextpdf.kernel.pdf.canvas.PdfCanvas
-
- com.itextpdf.kernel.font.Type3Glyph
-
public final class Type3Glyph extends PdfCanvas
The content where Type3 glyphs are written to.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
D_0_STR
private static java.lang.String
D_1_STR
private static byte[]
d0
private static byte[]
d1
private boolean
isColor
private float
llx
private float
lly
private float
urx
private float
ury
private float
wx
-
Fields inherited from class com.itextpdf.kernel.pdf.canvas.PdfCanvas
contentStream, currentGs, document, drawingOnPage, gsStack, layerDepth, mcDepth, resources
-
-
Constructor Summary
Constructors Constructor Description Type3Glyph(PdfDocument pdfDocument, float wx, float llx, float lly, float urx, float ury, boolean isColor)
Creates a Type3Glyph canvas with a new Content Stream.Type3Glyph(PdfStream pdfStream, PdfDocument document)
Creates a Type3Glyph canvas with a non-empty Content Stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfXObject
addImageWithTransformationMatrix(ImageData image, float a, float b, float c, float d, float e, float f, boolean inlineImage)
Creates Image XObject from image and adds it to canvas.private void
fillBBFromBytes(byte[] bytes)
float
getLlx()
float
getLly()
float
getUrx()
float
getUry()
float
getWx()
boolean
isColor()
Indicates if the glyph color specified in the glyph description or not.private void
writeMetrics(float wx, float llx, float lly, float urx, float ury, boolean isColor)
Writes the width and optionally the bounding box parameters for a glyph-
Methods inherited from class com.itextpdf.kernel.pdf.canvas.PdfCanvas
addImageAt, addImageFittedIntoRectangle, addImageWithTransformationMatrix, addInlineImage, addXObject, addXObjectAt, addXObjectFittedIntoRectangle, addXObjectWithTransformationMatrix, arc, arcContinuous, attachContentStream, beginLayer, beginMarkedContent, beginMarkedContent, beginText, beginVariableText, bezierArc, circle, clip, closePath, closePathEoFillStroke, closePathFillStroke, closePathStroke, closeTag, concatMatrix, concatMatrix, concatMatrix, curveFromTo, curveTo, curveTo, ellipse, endLayer, endMarkedContent, endPath, endText, endVariableText, eoClip, eoFill, eoFillStroke, fill, fillStroke, getContentStream, getDocument, getGraphicsState, getResources, lineTo, moveText, moveTextWithLeading, moveTo, newlineShowText, newlineShowText, newlineText, openTag, openTag, paintShading, rectangle, rectangle, release, resetFillColorCmyk, resetFillColorGray, resetFillColorRgb, resetStrokeColorCmyk, resetStrokeColorGray, resetStrokeColorRgb, restoreState, roundRectangle, saveState, setCharacterSpacing, setColor, setColor, setColor, setDrawingOnPage, setExtGState, setExtGState, setFillColor, setFillColorCmyk, setFillColorGray, setFillColorRgb, setFillColorShading, setFlatnessTolerance, setFontAndSize, setHorizontalScaling, setLeading, setLineCapStyle, setLineDash, setLineDash, setLineDash, setLineDash, setLineJoinStyle, setLineWidth, setMiterLimit, setRenderingIntent, setStrokeColor, setStrokeColorCmyk, setStrokeColorGray, setStrokeColorRgb, setStrokeColorShading, setTextMatrix, setTextMatrix, setTextMatrix, setTextRenderingMode, setTextRise, setWordSpacing, showText, showText, showText, showText, stroke, writeLiteral, writeLiteral, writeLiteral
-
-
-
-
Field Detail
-
D_0_STR
private static final java.lang.String D_0_STR
- See Also:
- Constant Field Values
-
D_1_STR
private static final java.lang.String D_1_STR
- See Also:
- Constant Field Values
-
d0
private static final byte[] d0
-
d1
private static final byte[] d1
-
wx
private float wx
-
llx
private float llx
-
lly
private float lly
-
urx
private float urx
-
ury
private float ury
-
isColor
private boolean isColor
-
-
Constructor Detail
-
Type3Glyph
Type3Glyph(PdfDocument pdfDocument, float wx, float llx, float lly, float urx, float ury, boolean isColor)
Creates a Type3Glyph canvas with a new Content Stream.- Parameters:
pdfDocument
- the document that this canvas is created for
-
Type3Glyph
Type3Glyph(PdfStream pdfStream, PdfDocument document)
Creates a Type3Glyph canvas with a non-empty Content Stream.- Parameters:
pdfStream
-PdfStream
from existed document.document
- document to whichPdfStream
belongs.
-
-
Method Detail
-
getWx
public float getWx()
-
getLlx
public float getLlx()
-
getLly
public float getLly()
-
getUrx
public float getUrx()
-
getUry
public float getUry()
-
isColor
public boolean isColor()
Indicates if the glyph color specified in the glyph description or not.- Returns:
- whether the glyph color is specified in the glyph description or not
-
writeMetrics
private void writeMetrics(float wx, float llx, float lly, float urx, float ury, boolean isColor)
Writes the width and optionally the bounding box parameters for a glyph- Parameters:
wx
- the advance this character will havellx
- the X lower left corner of the glyph bounding box. If theisColor
option istrue
the value is ignoredlly
- the Y lower left corner of the glyph bounding box. If theisColor
option istrue
the value is ignoredurx
- the X upper right corner of the glyph bounding box. If theisColor
option istrue
the value is ignoredury
- the Y upper right corner of the glyph bounding box. If theisColor
option istrue
the value is ignoredisColor
- defines whether the glyph color is specified in the glyph description in the font. The consequence of valuetrue
is that the bounding box parameters are ignored.
-
addImageWithTransformationMatrix
public PdfXObject addImageWithTransformationMatrix(ImageData image, float a, float b, float c, float d, float e, float f, boolean inlineImage)
Creates Image XObject from image and adds it to canvas. Performs additional checks to make sure that we only add mask images to not colorized type 3 fonts.- Overrides:
addImageWithTransformationMatrix
in classPdfCanvas
- Parameters:
image
- thePdfImageXObject
objecta
- an element of the transformation matrixb
- an element of the transformation matrixc
- an element of the transformation matrixd
- an element of the transformation matrixe
- an element of the transformation matrixf
- an element of the transformation matrixinlineImage
- true if to add image as in-line.- Returns:
- created Image XObject or null in case of in-line image (asInline = true).
- See Also:
PdfCanvas.concatMatrix(double, double, double, double, double, double)
-
fillBBFromBytes
private void fillBBFromBytes(byte[] bytes)
-
-