Package com.sun.pdfview.font.ttf
Class Glyf
- java.lang.Object
-
- com.sun.pdfview.font.ttf.Glyf
-
- Direct Known Subclasses:
GlyfCompound,GlyfSimple
public class Glyf extends java.lang.ObjectA single glyph in a pdf font. May be simple or compound via subclasses
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisCompoundIf true, the glyf is compoundprivate shortmaxXthe maximum x valueprivate shortmaxYthe maximum y valueprivate shortminXthe minimum x valueprivate shortminYthe minimum y valueprivate shortnumContoursthe number of contours
-
Constructor Summary
Constructors Modifier Constructor Description protectedGlyf()Creates a new instance of glyf Don't use this directly, useGlyf.getGlyf()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffergetData()Get the data in this glyf as a byte buffer.static GlyfgetGlyf(java.nio.ByteBuffer data)Get a map from the given data This method reads the format, data and length variables of the map.shortgetLength()Get the length of this glyf.shortgetMaxX()Get the maximum x in this glyfshortgetMaxY()Get the maximum y in this glyfshortgetMinX()Get the minimum x in this glyfshortgetMinY()Get the minimum y in this glyfshortgetNumContours()Get the number of contours in this glyfbooleanisCompound()Get whether this is a simple or compound glyfprotected voidsetCompound(boolean isCompound)Set whether this is a simple or compound glyfvoidsetData(java.nio.ByteBuffer data)Set the data for this glyf.protected voidsetMaxX(short maxX)Set the maximum X in this glyfprotected voidsetMaxY(short maxY)Set the maximum Y in this glyfprotected voidsetMinX(short minX)Set the minimum X in this glyfprotected voidsetMinY(short minY)Set the minimum Y in this glyfprotected voidsetNumContours(short numContours)Set the number of contours in this glyf
-
-
-
Field Detail
-
isCompound
private boolean isCompound
If true, the glyf is compound
-
numContours
private short numContours
the number of contours
-
minX
private short minX
the minimum x value
-
minY
private short minY
the minimum y value
-
maxX
private short maxX
the maximum x value
-
maxY
private short maxY
the maximum y value
-
-
Method Detail
-
getGlyf
public static Glyf getGlyf(java.nio.ByteBuffer data)
Get a map from the given data This method reads the format, data and length variables of the map.
-
setData
public void setData(java.nio.ByteBuffer data)
Set the data for this glyf. Do nothing, since a glyf with no contours has no glyf data.
-
getData
public java.nio.ByteBuffer getData()
Get the data in this glyf as a byte buffer. Return the basic glyf data only, since there is no specific data. This method returns the data un-flipped, so subclasses can simply append to the allocated buffer.
-
getLength
public short getLength()
Get the length of this glyf. A glyf with no data has a length of 10 (2 bytes each for 5 short values)
-
isCompound
public boolean isCompound()
Get whether this is a simple or compound glyf
-
setCompound
protected void setCompound(boolean isCompound)
Set whether this is a simple or compound glyf
-
getNumContours
public short getNumContours()
Get the number of contours in this glyf
-
setNumContours
protected void setNumContours(short numContours)
Set the number of contours in this glyf
-
getMinX
public short getMinX()
Get the minimum x in this glyf
-
setMinX
protected void setMinX(short minX)
Set the minimum X in this glyf
-
getMinY
public short getMinY()
Get the minimum y in this glyf
-
setMinY
protected void setMinY(short minY)
Set the minimum Y in this glyf
-
getMaxX
public short getMaxX()
Get the maximum x in this glyf
-
setMaxX
protected void setMaxX(short maxX)
Set the maximum X in this glyf
-
getMaxY
public short getMaxY()
Get the maximum y in this glyf
-
setMaxY
protected void setMaxY(short maxY)
Set the maximum Y in this glyf
-
-