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 InputStreamprivate static final intprivate PCLTTFOS2FontTableprivate PCLTTFPCLTFontTableprivate PCLTTFPOSTFontTableprotected FontFileReaderprivate intprivate PCLSymbolSetprotected TTFFileprivate PCLTTFTableFactoryFields inherited from class PCLFontReader
font, typeface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intprivate intconvertTTFWeightClass(int weightClass) private intconvertTTFWidthClass(int widthClass) private ByteArrayOutputStreamcopyTables(List<PCLTTFFontReader.TableOffset> tableOffsets, ByteArrayOutputStream baos, byte[] hmtxTable, int hmtxSize) protected byte[]createHmtx(Map<Character, Integer> mappedGlyphs) intintintintprivate byte[]See Font Header Format 11-35 (Character Complement Array) in the PCL 5 Specification.Character Definitionsprotected static intgetCheckSum(byte[] data, int start, int size) intHeader DataintintintgetFontSegments(Map<Character, Integer> mappedGlyphs) Segmented Font Dataintprivate byte[]getGlobalTrueTypeData(Map<Character, Integer> mappedGlyphs) intintintintintintintintgetPitch()intintintintintintintintintintintintprivate PCLTTFTableFactoryintintintintintintintprotected voidloadFont()private PCLTTFTablereadFontTable(OFTableName tableName) protected voidprivate byte[]updateHHEA(byte[] tableData, int hmtxSize) private ByteArrayOutputStreamupdateOffsets(ByteArrayOutputStream baos, Map<Integer, byte[]> offsets) private voidprivate voidwriteSubsetHMTX(ByteArrayOutputStream baos, OFTableName table, List<PCLTTFFontReader.TableOffset> tableOffsets, byte[] hmtxTable) private voidwriteTrueTypeTable(ByteArrayOutputStream baos, OFTableName table, List<PCLTTFFontReader.TableOffset> tableOffsets) private voidwriteUShort(byte[] out, int offset, int s) Appends a USHORT to the output array, updates currentPost but not realSizeMethods inherited from class 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:PCLFontReaderHeader Data- Specified by:
getDescriptorSizein classPCLFontReader
-
getHeaderFormat
public int getHeaderFormat()- Specified by:
getHeaderFormatin classPCLFontReader
-
getFontType
public int getFontType()- Specified by:
getFontTypein classPCLFontReader
-
getStyleMSB
public int getStyleMSB()- Specified by:
getStyleMSBin classPCLFontReader
-
getBaselinePosition
public int getBaselinePosition()- Specified by:
getBaselinePositionin classPCLFontReader
-
getCellWidth
public int getCellWidth()- Specified by:
getCellWidthin classPCLFontReader
-
getCellHeight
public int getCellHeight()- Specified by:
getCellHeightin classPCLFontReader
-
getOrientation
public int getOrientation()- Specified by:
getOrientationin classPCLFontReader
-
getSpacing
public int getSpacing()- Specified by:
getSpacingin classPCLFontReader
-
getSymbolSet
public int getSymbolSet()- Specified by:
getSymbolSetin classPCLFontReader
-
getPitch
public int getPitch()- Specified by:
getPitchin classPCLFontReader
-
getHeight
public int getHeight()- Specified by:
getHeightin classPCLFontReader
-
getXHeight
public int getXHeight()- Specified by:
getXHeightin classPCLFontReader
-
getWidthType
public int getWidthType()- Specified by:
getWidthTypein classPCLFontReader
-
convertTTFWidthClass
private int convertTTFWidthClass(int widthClass) -
getStyleLSB
public int getStyleLSB()- Specified by:
getStyleLSBin classPCLFontReader
-
getStrokeWeight
public int getStrokeWeight()- Specified by:
getStrokeWeightin classPCLFontReader
-
convertTTFWeightClass
private int convertTTFWeightClass(int weightClass) -
getTypefaceLSB
public int getTypefaceLSB()- Specified by:
getTypefaceLSBin classPCLFontReader
-
getTypefaceMSB
public int getTypefaceMSB()- Specified by:
getTypefaceMSBin classPCLFontReader
-
getSerifStyle
public int getSerifStyle()- Specified by:
getSerifStylein classPCLFontReader
-
convertFromTTFSerifStyle
private int convertFromTTFSerifStyle() -
getQuality
public int getQuality()- Specified by:
getQualityin classPCLFontReader
-
getPlacement
public int getPlacement()- Specified by:
getPlacementin classPCLFontReader
-
getUnderlinePosition
public int getUnderlinePosition()- Specified by:
getUnderlinePositionin classPCLFontReader
-
getUnderlineThickness
public int getUnderlineThickness()- Specified by:
getUnderlineThicknessin classPCLFontReader
-
getTextHeight
public int getTextHeight()- Specified by:
getTextHeightin classPCLFontReader
-
getTextWidth
public int getTextWidth()- Specified by:
getTextWidthin classPCLFontReader
-
getFirstCode
public int getFirstCode()- Specified by:
getFirstCodein classPCLFontReader
-
getLastCode
public int getLastCode()- Specified by:
getLastCodein classPCLFontReader
-
getPitchExtended
public int getPitchExtended()- Specified by:
getPitchExtendedin classPCLFontReader
-
getHeightExtended
public int getHeightExtended()- Specified by:
getHeightExtendedin classPCLFontReader
-
getCapHeight
public int getCapHeight()- Specified by:
getCapHeightin classPCLFontReader
-
getFontNumber
public int getFontNumber()- Specified by:
getFontNumberin classPCLFontReader
-
getFontName
- Specified by:
getFontNamein classPCLFontReader
-
getScaleFactor
- Specified by:
getScaleFactorin classPCLFontReader- Throws:
IOException
-
getMasterUnderlinePosition
- Specified by:
getMasterUnderlinePositionin classPCLFontReader- Throws:
IOException
-
getMasterUnderlineThickness
- Specified by:
getMasterUnderlineThicknessin classPCLFontReader- Throws:
IOException
-
getFontScalingTechnology
public int getFontScalingTechnology()- Specified by:
getFontScalingTechnologyin classPCLFontReader
-
getVariety
public int getVariety()- Specified by:
getVarietyin classPCLFontReader
-
getFontSegments
public List<PCLFontSegment> getFontSegments(Map<Character, Integer> mappedGlyphs) throws IOException Description copied from class:PCLFontReaderSegmented Font Data- Specified by:
getFontSegmentsin 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:PCLFontReaderCharacter Definitions- Specified by:
getCharacterOffsetsin classPCLFontReader- Throws:
IOException
-
getFontFile
- Specified by:
getFontFilein classPCLFontReader
-
getFontFileReader
- Specified by:
getFontFileReaderin 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:
scanMtxCharactersin classPCLFontReader- Throws:
IOException
-