Class PCLTTFFontReader
java.lang.Object
org.apache.fop.render.pcl.fonts.PCLFontReader
org.apache.fop.render.pcl.fonts.truetype.PCLTTFFontReader
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InputStream
private static final int
private PCLTTFOS2FontTable
private PCLTTFPCLTFontTable
private PCLTTFPOSTFontTable
protected FontFileReader
private int
private PCLSymbolSet
protected TTFFile
private PCLTTFTableFactory
Fields inherited from class org.apache.fop.render.pcl.fonts.PCLFontReader
font, typeface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
private int
convertTTFWeightClass
(int weightClass) private int
convertTTFWidthClass
(int widthClass) private ByteArrayOutputStream
copyTables
(List<PCLTTFFontReader.TableOffset> tableOffsets, ByteArrayOutputStream baos, byte[] hmtxTable, int hmtxSize) protected byte[]
createHmtx
(Map<Character, Integer> mappedGlyphs) int
int
int
int
private byte[]
See Font Header Format 11-35 (Character Complement Array) in the PCL 5 Specification.Character Definitionsprotected static int
getCheckSum
(byte[] data, int start, int size) int
Header Dataint
int
int
getFontSegments
(Map<Character, Integer> mappedGlyphs) Segmented Font Dataint
private byte[]
getGlobalTrueTypeData
(Map<Character, Integer> mappedGlyphs) int
int
int
int
int
int
int
int
getPitch()
int
int
int
int
int
int
int
int
int
int
int
int
private PCLTTFTableFactory
int
int
int
int
int
int
int
protected void
loadFont()
private PCLTTFTable
readFontTable
(OFTableName tableName) protected void
private byte[]
updateHHEA
(byte[] tableData, int hmtxSize) private ByteArrayOutputStream
updateOffsets
(ByteArrayOutputStream baos, Map<Integer, byte[]> offsets) private void
private void
writeSubsetHMTX
(ByteArrayOutputStream baos, OFTableName table, List<PCLTTFFontReader.TableOffset> tableOffsets, byte[] hmtxTable) private void
writeTrueTypeTable
(ByteArrayOutputStream baos, OFTableName table, List<PCLTTFFontReader.TableOffset> tableOffsets) private void
writeUShort
(byte[] out, int offset, int s) Appends a USHORT to the output array, updates currentPost but not realSizeMethods inherited from class org.apache.fop.render.pcl.fonts.PCLFontReader
getLSB, getMSB, setFont
-
Field Details
-
ttfFont
-
fontStream
-
reader
-
pcltTable
-
os2Table
-
postTable
-
ttfTableFactory
-
charOffsets
-
charMtxOffsets
-
HMTX_RESTRICT_SIZE
private static final int HMTX_RESTRICT_SIZE- See Also:
-
FONT_WEIGHT
-
FONT_SERIF
-
FONT_WIDTH
-
scaleFactor
private int scaleFactor -
symbolSet
-
-
Constructor Details
-
PCLTTFFontReader
- Throws:
IOException
-
-
Method Details
-
loadFont
- Throws:
IOException
-
readFontTables
- Throws:
IOException
-
readFontTable
- Throws:
IOException
-
getTTFTableFactory
-
getDescriptorSize
public int getDescriptorSize()Description copied from class:PCLFontReader
Header Data- Specified by:
getDescriptorSize
in classPCLFontReader
-
getHeaderFormat
public int getHeaderFormat()- Specified by:
getHeaderFormat
in classPCLFontReader
-
getFontType
public int getFontType()- Specified by:
getFontType
in classPCLFontReader
-
getStyleMSB
public int getStyleMSB()- Specified by:
getStyleMSB
in classPCLFontReader
-
getBaselinePosition
public int getBaselinePosition()- Specified by:
getBaselinePosition
in classPCLFontReader
-
getCellWidth
public int getCellWidth()- Specified by:
getCellWidth
in classPCLFontReader
-
getCellHeight
public int getCellHeight()- Specified by:
getCellHeight
in classPCLFontReader
-
getOrientation
public int getOrientation()- Specified by:
getOrientation
in classPCLFontReader
-
getSpacing
public int getSpacing()- Specified by:
getSpacing
in classPCLFontReader
-
getSymbolSet
public int getSymbolSet()- Specified by:
getSymbolSet
in classPCLFontReader
-
getPitch
public int getPitch()- Specified by:
getPitch
in classPCLFontReader
-
getHeight
public int getHeight()- Specified by:
getHeight
in classPCLFontReader
-
getXHeight
public int getXHeight()- Specified by:
getXHeight
in classPCLFontReader
-
getWidthType
public int getWidthType()- Specified by:
getWidthType
in classPCLFontReader
-
convertTTFWidthClass
private int convertTTFWidthClass(int widthClass) -
getStyleLSB
public int getStyleLSB()- Specified by:
getStyleLSB
in classPCLFontReader
-
getStrokeWeight
public int getStrokeWeight()- Specified by:
getStrokeWeight
in classPCLFontReader
-
convertTTFWeightClass
private int convertTTFWeightClass(int weightClass) -
getTypefaceLSB
public int getTypefaceLSB()- Specified by:
getTypefaceLSB
in classPCLFontReader
-
getTypefaceMSB
public int getTypefaceMSB()- Specified by:
getTypefaceMSB
in classPCLFontReader
-
getSerifStyle
public int getSerifStyle()- Specified by:
getSerifStyle
in classPCLFontReader
-
convertFromTTFSerifStyle
private int convertFromTTFSerifStyle() -
getQuality
public int getQuality()- Specified by:
getQuality
in classPCLFontReader
-
getPlacement
public int getPlacement()- Specified by:
getPlacement
in classPCLFontReader
-
getUnderlinePosition
public int getUnderlinePosition()- Specified by:
getUnderlinePosition
in classPCLFontReader
-
getUnderlineThickness
public int getUnderlineThickness()- Specified by:
getUnderlineThickness
in classPCLFontReader
-
getTextHeight
public int getTextHeight()- Specified by:
getTextHeight
in classPCLFontReader
-
getTextWidth
public int getTextWidth()- Specified by:
getTextWidth
in classPCLFontReader
-
getFirstCode
public int getFirstCode()- Specified by:
getFirstCode
in classPCLFontReader
-
getLastCode
public int getLastCode()- Specified by:
getLastCode
in classPCLFontReader
-
getPitchExtended
public int getPitchExtended()- Specified by:
getPitchExtended
in classPCLFontReader
-
getHeightExtended
public int getHeightExtended()- Specified by:
getHeightExtended
in classPCLFontReader
-
getCapHeight
public int getCapHeight()- Specified by:
getCapHeight
in classPCLFontReader
-
getFontNumber
public int getFontNumber()- Specified by:
getFontNumber
in classPCLFontReader
-
getFontName
- Specified by:
getFontName
in classPCLFontReader
-
getScaleFactor
- Specified by:
getScaleFactor
in classPCLFontReader
- Throws:
IOException
-
getMasterUnderlinePosition
- Specified by:
getMasterUnderlinePosition
in classPCLFontReader
- Throws:
IOException
-
getMasterUnderlineThickness
- Specified by:
getMasterUnderlineThickness
in classPCLFontReader
- Throws:
IOException
-
getFontScalingTechnology
public int getFontScalingTechnology()- Specified by:
getFontScalingTechnology
in classPCLFontReader
-
getVariety
public int getVariety()- Specified by:
getVariety
in classPCLFontReader
-
getFontSegments
Description copied from class:PCLFontReader
Segmented Font Data- Specified by:
getFontSegments
in classPCLFontReader
- Throws:
IOException
-
getCharacterComplement
private byte[] getCharacterComplement()See Font Header Format 11-35 (Character Complement Array) in the PCL 5 Specification. Defined as an array of 8 bytes specific to certain character sets. In this case specifying 0 for all values (default complement) means the font is compatible with any character sets. '110' on least significant bits signifies unicode. See specification for further customization. -
getGlobalTrueTypeData
- Throws:
IOException
-
writeTrueTypeTable
private void writeTrueTypeTable(ByteArrayOutputStream baos, OFTableName table, List<PCLTTFFontReader.TableOffset> tableOffsets) throws IOException - Throws:
IOException
-
writeGDIR
- Throws:
IOException
-
copyTables
private ByteArrayOutputStream copyTables(List<PCLTTFFontReader.TableOffset> tableOffsets, ByteArrayOutputStream baos, byte[] hmtxTable, int hmtxSize) throws IOException - Throws:
IOException
-
updateHHEA
private byte[] updateHHEA(byte[] tableData, int hmtxSize) -
updateOffsets
private ByteArrayOutputStream updateOffsets(ByteArrayOutputStream baos, Map<Integer, byte[]> offsets) throws IOException- Throws:
IOException
-
getCharacterOffsets
Description copied from class:PCLFontReader
Character Definitions- Specified by:
getCharacterOffsets
in classPCLFontReader
- Throws:
IOException
-
getFontFile
- Specified by:
getFontFile
in classPCLFontReader
-
getFontFileReader
- Specified by:
getFontFileReader
in classPCLFontReader
-
writeSubsetHMTX
private void writeSubsetHMTX(ByteArrayOutputStream baos, OFTableName table, List<PCLTTFFontReader.TableOffset> tableOffsets, byte[] hmtxTable) throws IOException - Throws:
IOException
-
getCheckSum
protected static int getCheckSum(byte[] data, int start, int size) -
createHmtx
-
writeUShort
private void writeUShort(byte[] out, int offset, int s) Appends a USHORT to the output array, updates currentPost but not realSize -
scanMtxCharacters
- Specified by:
scanMtxCharacters
in classPCLFontReader
- Throws:
IOException
-