public class CharacterSetBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
LOG
Static logging instance
|
Modifier and Type | Method and Description |
---|---|
CharacterSet |
build(java.lang.String characterSetName,
java.lang.String codePageName,
java.lang.String encoding,
ResourceAccessor accessor)
Load the font details and metrics into the CharacterSetMetric object,
this will use the actual afp code page and character set files to load
the object with the necessary metrics.
|
CharacterSet |
build(java.lang.String characterSetName,
java.lang.String codePageName,
java.lang.String encoding,
Typeface typeface)
Load the font details and metrics into the CharacterSetMetric object,
this will use the actual afp code page and character set files to load
the object with the necessary metrics.
|
protected void |
closeInputStream(java.io.InputStream inputStream)
Closes the inputstream
|
static CharacterSetBuilder |
getDoubleByteInstance()
Factory method for the double-byte (CID Keyed font (Type 0)) implementation of AFPFontReader.
|
static CharacterSetBuilder |
getInstance()
Factory method for the single-byte implementation of AFPFontReader.
|
protected java.util.Map |
loadCodePage(java.lang.String codePage,
java.lang.String encoding,
ResourceAccessor accessor)
Load the code page information from the appropriate file.
|
protected java.io.InputStream |
openInputStream(ResourceAccessor accessor,
java.lang.String filename)
Returns an InputStream to a given file path and filename
* @param accessor the resource accessor
|
protected org.apache.fop.afp.fonts.CharacterSetBuilder.FontControl |
processFontControl(StructuredFieldReader structuredFieldReader)
Process the font control details using the structured field reader.
|
protected static org.apache.fop.afp.fonts.CharacterSetBuilder.FontDescriptor |
processFontDescriptor(StructuredFieldReader structuredFieldReader)
Process the font descriptor details using the structured field reader.
|
protected void |
processFontIndex(StructuredFieldReader structuredFieldReader,
CharacterSetOrientation cso,
java.util.Map codepage,
double metricNormalizationFactor)
Process the font index details for the character set orientation.
|
protected CharacterSetOrientation[] |
processFontOrientation(StructuredFieldReader structuredFieldReader)
Process the font orientation details from using the structured field
reader.
|
protected void |
processFontPosition(StructuredFieldReader structuredFieldReader,
CharacterSetOrientation[] characterSetOrientations,
double metricNormalizationFactor)
Populate the CharacterSetOrientation object in the suplied array with the
font position details using the supplied structured field reader.
|
public static CharacterSetBuilder getInstance()
public static CharacterSetBuilder getDoubleByteInstance()
protected java.io.InputStream openInputStream(ResourceAccessor accessor, java.lang.String filename) throws java.io.IOException
filename
- the file namejava.io.IOException
- in the event that an I/O exception of some sort has occurredprotected void closeInputStream(java.io.InputStream inputStream)
inputStream
- the inputstream to closepublic CharacterSet build(java.lang.String characterSetName, java.lang.String codePageName, java.lang.String encoding, ResourceAccessor accessor) throws java.io.IOException
characterSetName
- name of the charactersetcodePageName
- name of the code page fileencoding
- encoding nameaccessor
- used to load codepage and charactersetjava.io.IOException
- if an I/O error occurspublic CharacterSet build(java.lang.String characterSetName, java.lang.String codePageName, java.lang.String encoding, Typeface typeface)
characterSetName
- the CharacterSetMetric object to populatecodePageName
- the name of the code page to useencoding
- name of the encoding in usetypeface
- base14 font nameprotected java.util.Map loadCodePage(java.lang.String codePage, java.lang.String encoding, ResourceAccessor accessor) throws java.io.IOException
codePage
- the code page identifierencoding
- the encoding to use for the character decodingaccessor
- the resource accessorjava.io.IOException
- if an I/O exception of some sort has occurred.protected static org.apache.fop.afp.fonts.CharacterSetBuilder.FontDescriptor processFontDescriptor(StructuredFieldReader structuredFieldReader) throws java.io.IOException
structuredFieldReader
- the structured field readerjava.io.IOException
- if an I/O exception of some sort has occurred.protected org.apache.fop.afp.fonts.CharacterSetBuilder.FontControl processFontControl(StructuredFieldReader structuredFieldReader) throws java.io.IOException
structuredFieldReader
- the structured field readerjava.io.IOException
- if an I/O exception of some sort has occurred.protected CharacterSetOrientation[] processFontOrientation(StructuredFieldReader structuredFieldReader) throws java.io.IOException
structuredFieldReader
- the structured field readerjava.io.IOException
- if an I/O exception of some sort has occurred.protected void processFontPosition(StructuredFieldReader structuredFieldReader, CharacterSetOrientation[] characterSetOrientations, double metricNormalizationFactor) throws java.io.IOException
structuredFieldReader
- the structured field readercharacterSetOrientations
- the array of CharacterSetOrientation objectsmetricNormalizationFactor
- factor to apply to the metrics to get normalized
font metric valuesjava.io.IOException
- if an I/O exception of some sort has occurred.protected void processFontIndex(StructuredFieldReader structuredFieldReader, CharacterSetOrientation cso, java.util.Map codepage, double metricNormalizationFactor) throws java.io.IOException
structuredFieldReader
- the structured field readercso
- the CharacterSetOrientation object to populatecodepage
- the map of code pagesmetricNormalizationFactor
- factor to apply to the metrics to get normalized
font metric valuesjava.io.IOException
- if an I/O exception of some sort has occurred.Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.