Class PSFontUtils
java.lang.Object
org.apache.xmlgraphics.ps.PSFontUtils
Utility code for font handling in PostScript.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PSResourcethe PSResource representing the AdobeStandardCyrillicEncoding.static final PSResourcethe PSResource representing the WinAnsiEncoding. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDefines the AdobeStandardCyrillic encoding for use in PostScript files.static voidDefines the WinAnsi encoding for use in PostScript files.static voidembedType1Font(PSGenerator gen, InputStream in) This method reads a Type 1 font from a stream and embeds it into a PostScript stream.static voidredefineFontEncoding(PSGenerator gen, String fontName, String encoding) Redefines the encoding of a font.
-
Field Details
-
WINANSI_ENCODING_RESOURCE
the PSResource representing the WinAnsiEncoding. -
ADOBECYRILLIC_ENCODING_RESOURCE
the PSResource representing the AdobeStandardCyrillicEncoding.
-
-
Constructor Details
-
PSFontUtils
public PSFontUtils()
-
-
Method Details
-
embedType1Font
This method reads a Type 1 font from a stream and embeds it into a PostScript stream. Note: Only the IBM PC Format as described in section 3.3 of the Adobe Technical Note #5040 is supported.- Parameters:
gen- The PostScript generatorin- the InputStream from which to read the Type 1 font- Throws:
IOException- in case an I/O problem occurs
-
defineWinAnsiEncoding
Defines the WinAnsi encoding for use in PostScript files.- Parameters:
gen- the PostScript generator- Throws:
IOException- In case of an I/O problem
-
defineAdobeCyrillicEncoding
Defines the AdobeStandardCyrillic encoding for use in PostScript files.- Parameters:
gen- the PostScript generator- Throws:
IOException- In case of an I/O problem
-
redefineFontEncoding
public static void redefineFontEncoding(PSGenerator gen, String fontName, String encoding) throws IOException Redefines the encoding of a font.- Parameters:
gen- the PostScript generatorfontName- the font nameencoding- the new encoding (must be predefined in the PS file)- Throws:
IOException- In case of an I/O problem
-