org.foray.font
Class FSType1Font

java.lang.Object
  extended by org.foray.font.Font4a
      extended by org.foray.font.FreeStandingFont
          extended by org.foray.font.FSType1Font
All Implemented Interfaces:
org.axsl.font.Font

public class FSType1Font
extends FreeStandingFont

Class representing FreeStanding Type 1 fonts.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.axsl.font.Font
org.axsl.font.Font.Baseline, org.axsl.font.Font.Complexity, org.axsl.font.Font.Embedding, org.axsl.font.Font.Format, org.axsl.font.Font.LineHeightAlgorithm, org.axsl.font.Font.SelectionStrategy, org.axsl.font.Font.Stretch, org.axsl.font.Font.Style, org.axsl.font.Font.Variant, org.axsl.font.Font.Weight, org.axsl.font.Font.WritingMode
 
Field Summary
 
Fields inherited from interface org.axsl.font.Font
INVALID_STRING, NORMAL_STRING
 
Constructor Summary
FSType1Font(RegisteredFont rf)
          This constructor should be used for fonts that are registered before they are created.
 
Method Summary
 int[] getFontBBox()
          Returns the bounding box for this font.
 org.axsl.font.Font.Format getFontFormat()
           
 byte[] getRawFontFile(FontUse4a fontUse)
          Returns the font file contents in a byte array.
 int getStemV()
          Returns the StemV value for this font, used in a PDF Font Descriptor, as defined in the PDF Reference, Second Edition, Section 5.7.
 Type1Font getType1File()
          Returns the related Type1File.
 int getUnitsPerTextSpaceUnit()
          Returns the units per text-space unit that is used in this font for internal font measurements.
 boolean glyphAvailable(int c)
          Reports on the availability of a glyph in this font, without regard to encoding issues.
 boolean isPdfStandardFont()
           
 int metricIndex(int codePoint)
          For a given Unicode code point index, returns the metric index.
 int overlinePosition(int fontSize)
           
 int overlineSize(int fontSize)
           
 void parseFont()
          Parses the font to get needed information.
 int strikeoutPosition(int fontSize)
           
 int strikeoutSize(int fontSize)
           
 boolean supportsUnicode()
          Indicates whether this font has the ability to map Unicode characters to font glyphs.
 int underlinePosition(int fontSize)
           
 int underlineSize(int fontSize)
           
 int width(int metricIndex, int fontSize)
           
 int widthUndefinedGlyph(int fontSize)
          Returns the width of the undefined or missing glyph.
 
Methods inherited from class org.foray.font.FreeStandingFont
allowsEmbedding, extractBaseline, getAscender, getAwtFont, getAWTFontFormat, getCapHeight, getCharSet, getDefaultWidth, getDescender, getFamilyName, getFlags, getFontComplexity, getFontInputStream, getFontName, getInternalEncoding, getItalicAngle, getKerning, getNumGlyphs, getPanose, getPanoseInstance, getPostscriptName, getWidths, getXHeight, isEmbeddable, isSubsettable, kerningActive, setAllowsEmbedding, setAscender, setCapHeight, setCharSet, setDescender, setFamilyName, setFlags, setFontComplexity, setFontName, setInternalEncoding, setItalicAngle, setKerning, setMissingWidth, setNumGlyphs, setPanose, setPostscriptName, setWidths, setXHeight, systemFontManifestation, usableInPostScriptOutput
 
Methods inherited from class org.foray.font.Font4a
baseline, baselineOffset, estimateBaseline, getEstimatedOverlinePosition, getEstimatedOverlineSize, getEstimatedStrikeoutPosition, getEstimatedStrikeoutSize, getEstimatedUnderlinePosition, getEstimatedUnderlineSize, getLogger, getRegisteredFont, kern, kerningAvailable, normalLineHeightFactor, subscriptShift, superscriptShift, width, widthEstimate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSType1Font

public FSType1Font(RegisteredFont rf)
            throws org.axsl.font.FontException
This constructor should be used for fonts that are registered before they are created.

Parameters:
rf - The RegisteredFont that should be used to create this font.
Throws:
org.axsl.font.FontException - For error creating font.
Method Detail

getRawFontFile

public byte[] getRawFontFile(FontUse4a fontUse)
                      throws IOException,
                             org.axsl.font.FontException
Description copied from class: FreeStandingFont
Returns the font file contents in a byte array.

Specified by:
getRawFontFile in class FreeStandingFont
Parameters:
fontUse - The specific font use, which is needed to get encoding and subsetting information.
Returns:
The font file contents.
Throws:
IOException - For I/O errors.
org.axsl.font.FontException - For errors parsing the font.

getType1File

public Type1Font getType1File()
                       throws org.axsl.font.FontException
Returns the related Type1File.

Returns:
The related Type1File.
Throws:
org.axsl.font.FontException - For errors parsing the font.

parseFont

public void parseFont()
               throws org.axsl.font.FontException
Parses the font to get needed information.

Throws:
org.axsl.font.FontException - For errors during font parsing.

getFontBBox

public int[] getFontBBox()
Description copied from class: FreeStandingFont
Returns the bounding box for this font.

Specified by:
getFontBBox in class FreeStandingFont
Returns:
The bounding box for this font.

getStemV

public int getStemV()
Description copied from class: FreeStandingFont
Returns the StemV value for this font, used in a PDF Font Descriptor, as defined in the PDF Reference, Second Edition, Section 5.7.

Specified by:
getStemV in interface org.axsl.font.Font
Specified by:
getStemV in class FreeStandingFont
Returns:
The StemV value, in 1/1000ths of a text space unit.

getFontFormat

public org.axsl.font.Font.Format getFontFormat()
Specified by:
getFontFormat in interface org.axsl.font.Font
Specified by:
getFontFormat in class Font4a

width

public int width(int metricIndex,
                 int fontSize)

widthUndefinedGlyph

public int widthUndefinedGlyph(int fontSize)
Description copied from class: Font4a
Returns the width of the undefined or missing glyph.

Specified by:
widthUndefinedGlyph in class Font4a
Parameters:
fontSize - The font size at which the width should be computed.
Returns:
The width, in millipoints, of the undefined glyph at the specified point size.

isPdfStandardFont

public boolean isPdfStandardFont()
Specified by:
isPdfStandardFont in interface org.axsl.font.Font
Specified by:
isPdfStandardFont in class Font4a

glyphAvailable

public boolean glyphAvailable(int c)
Description copied from class: Font4a
Reports on the availability of a glyph in this font, without regard to encoding issues.

Specified by:
glyphAvailable in class Font4a
Parameters:
c - The Unicode code point to be tested.
Returns:
True iff this font can paint a glyph for c.

strikeoutSize

public int strikeoutSize(int fontSize)

strikeoutPosition

public int strikeoutPosition(int fontSize)

underlineSize

public int underlineSize(int fontSize)

underlinePosition

public int underlinePosition(int fontSize)

overlineSize

public int overlineSize(int fontSize)

overlinePosition

public int overlinePosition(int fontSize)

getUnitsPerTextSpaceUnit

public int getUnitsPerTextSpaceUnit()
Description copied from class: Font4a
Returns the units per text-space unit that is used in this font for internal font measurements. For PostScript Type 1 fonts, this is 1000. For TrueType fonts, it is usually 2048, but can be specified in the font itself.

Specified by:
getUnitsPerTextSpaceUnit in class Font4a
Returns:
The units per text-space unit used by this font.

supportsUnicode

public boolean supportsUnicode()
Description copied from class: Font4a
Indicates whether this font has the ability to map Unicode characters to font glyphs.

Specified by:
supportsUnicode in class Font4a
Returns:
True iff this font can map Unicode characters to font glyphs.

metricIndex

public int metricIndex(int codePoint)
Description copied from class: Font4a
For a given Unicode code point index, returns the metric index.

Specified by:
metricIndex in class Font4a
Parameters:
codePoint - The Unicode code point to be converted.
Returns:
The metric index.


Copyright © 2017. All rights reserved.