Package org.loboevolution.pdfview.font
Class Type1CFont
java.lang.Object
org.loboevolution.pdfview.font.PDFFont
org.loboevolution.pdfview.font.OutlineFont
org.loboevolution.pdfview.font.Type1CFont
-
Constructor Summary
ConstructorDescriptionType1CFont
(String baseFont, PDFObject src, PDFFontDescriptor descriptor) create a new Type1CFont based on a font data stream and a descriptor -
Method Summary
Modifier and TypeMethodDescriptionint
calcoffset
(int base) calculate an offset code for a dictionary.int
getIndexSize
(int loc) get the size of the dictionary located within the stream at some offset.protected GeneralPath
getOutline
(char src, float width) Get a glyph outline by character codeprotected GeneralPath
getOutline
(String name, float width) Get a glyph outline by nameint
getTableLength
(int loc) return the number of entries in an Index table.void
readFNum()
read the next funky floating point number from the input stream.Methods inherited from class org.loboevolution.pdfview.font.OutlineFont
getCharCount, getDefaultWidth, getGlyph, getWidth
-
Constructor Details
-
Type1CFont
create a new Type1CFont based on a font data stream and a descriptor- Parameters:
baseFont
- the postscript name of this fontsrc
- a stream containing the fontdescriptor
- the descriptor for this font- Throws:
IOException
- if any.
-
-
Method Details
-
readFNum
public void readFNum()read the next funky floating point number from the input stream. value gets put into the fnum field. -
getIndexSize
public int getIndexSize(int loc) get the size of the dictionary located within the stream at some offset.- Parameters:
loc
- the index of the start of the dictionary- Returns:
- the size of the dictionary, in bytes.
-
getTableLength
public int getTableLength(int loc) return the number of entries in an Index table. -
calcoffset
public int calcoffset(int base) calculate an offset code for a dictionary. Uses the count of entries to determine what the offset should be.- Parameters:
base
- the index of the start of the dictionary- Returns:
- a
Integer
object.
-
getOutline
Get a glyph outline by nameGet a glyph outline by name
- Specified by:
getOutline
in classOutlineFont
- Parameters:
name
- the name of the desired glyphwidth
- a float.- Returns:
- the glyph outline, or null if unavailable
-
getOutline
Get a glyph outline by character codeNote this method must always return an outline Get a glyph outline by character code Note this method must always return an outline
- Specified by:
getOutline
in classOutlineFont
- Parameters:
src
- the character code of the desired glyphwidth
- a float.- Returns:
- the glyph outline
-