Package org.apache.fop.render.pcl.fonts
Class PCLSoftFontManager
java.lang.Object
org.apache.fop.render.pcl.fonts.PCLSoftFontManager
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PCLFontReader
private Map<Typeface,
PCLFontReader> private List<PCLSoftFont>
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
assignFontID
(int fontID) private int
countNonMatches
(PCLSoftFont font, String text) private byte[]
getFontHeaderCommand
(int headerSize) getSoftFont
(Typeface font, String text) Finds a soft font associated with the given typeface.private PCLSoftFont
getSoftFont
(Typeface font, String text, List<Map<Character, Integer>> mappedGlyphs, PCLSoftFont last) getSoftFontFromID
(int index) int
getTextSegments
(String text, Typeface font) private boolean
isComposite
(CustomFont customFont, int unicode) makeSoftFont
(Typeface font, String text) mapGlyphs
(Map<Integer, Integer> usedGlyphs, CustomFont font) private void
writeFontHeader
(Map<Character, Integer> mappedGlyphs, OutputStream os) private void
writeFontID
(int fontID, OutputStream os) private void
writeFontSegment
(ByteArrayOutputStream header, PCLFontSegment segment) private void
writeSegmentedFontData
(ByteArrayOutputStream header, Map<Character, Integer> mappedGlyphs)
-
Field Details
-
fontReaderMap
-
fontReader
-
fonts
-
SOFT_FONT_SIZE
private static final int SOFT_FONT_SIZE- See Also:
-
-
Constructor Details
-
PCLSoftFontManager
-
-
Method Details
-
makeSoftFont
- Throws:
IOException
-
getSoftFont
private PCLSoftFont getSoftFont(Typeface font, String text, List<Map<Character, Integer>> mappedGlyphs, PCLSoftFont last) -
mapFontGlyphs
- Throws:
IOException
-
mapGlyphs
private List<Map<Character,Integer>> mapGlyphs(Map<Integer, Integer> usedGlyphs, CustomFont font) throws IOException- Throws:
IOException
-
isComposite
- Throws:
IOException
-
writeFontID
- Throws:
IOException
-
assignFontID
- Throws:
IOException
-
writeFontHeader
private void writeFontHeader(Map<Character, Integer> mappedGlyphs, OutputStream os) throws IOException- Throws:
IOException
-
writeSegmentedFontData
private void writeSegmentedFontData(ByteArrayOutputStream header, Map<Character, Integer> mappedGlyphs) throws IOException- Throws:
IOException
-
getFontHeaderCommand
- Throws:
IOException
-
writeFontSegment
private void writeFontSegment(ByteArrayOutputStream header, PCLFontSegment segment) throws IOException - Throws:
IOException
-
getSoftFont
Finds a soft font associated with the given typeface. If more than one instance of the font exists (as each font is bound and restricted to 255 characters) it will find the last font with available capacity.- Parameters:
font
- The typeface associated with the soft font- Returns:
- Returns the PCLSoftFont with available capacity
-
getSoftFontFromID
-
countNonMatches
-
getSoftFontID
- Throws:
IOException
-
getTextSegments
-