Vector Graphics, 2.4

org.freehep.graphicsio.ps
Class PSFontTable

java.lang.Object
  extended by org.freehep.graphicsio.font.FontTable
      extended by org.freehep.graphicsio.ps.PSFontTable

public class PSFontTable
extends FontTable

FontTable for PS files. The fonts name is used as a reference for the font. When the font is first used, it is embedded to the file if it is not a standard font. If it is unknown it is not substituted.

Version:
$Id: freehep-graphicsio-ps/src/main/java/org/freehep/graphicsio/ps/PSFontTable.java 59372df5e0d9 2007/02/06 21:11:19 duns $
Author:
Simon Fischer

Nested Class Summary
 
Nested classes/interfaces inherited from class org.freehep.graphicsio.font.FontTable
FontTable.Entry
 
Constructor Summary
PSFontTable(OutputStream out, FontRenderContext context)
           
 
Method Summary
protected  String createFontReference(Font font)
          Uses the font name as a reference.
protected  void firstRequest(FontTable.Entry e, boolean embed, String embedAs)
           
 CharTable getEncodingTable()
           
static void normalize(Map<AttributedCharacterIterator.Attribute,Object> attributes)
          Replaces TextAttribute.FAMILY by values of replaceFonts.
protected  Font substituteFont(Font font)
          removes any transformation and superscript, changes the names to PS font name
 
Methods inherited from class org.freehep.graphicsio.font.FontTable
fontReference, getEntries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PSFontTable

public PSFontTable(OutputStream out,
                   FontRenderContext context)
Method Detail

getEncodingTable

public CharTable getEncodingTable()
Specified by:
getEncodingTable in class FontTable

firstRequest

protected void firstRequest(FontTable.Entry e,
                            boolean embed,
                            String embedAs)
                     throws IOException
Specified by:
firstRequest in class FontTable
Throws:
IOException

substituteFont

protected Font substituteFont(Font font)
removes any transformation and superscript, changes the names to PS font name

Specified by:
substituteFont in class FontTable
Parameters:
font -
Returns:
derived font

createFontReference

protected String createFontReference(Font font)
Uses the font name as a reference. Whitespace is stripped. The font style (italic/bold) is added as a suffix delimited by a dash. Uses normalize(java.util.Map)

Specified by:
createFontReference in class FontTable

normalize

public static void normalize(Map<AttributedCharacterIterator.Attribute,Object> attributes)
Replaces TextAttribute.FAMILY by values of replaceFonts. Whitespace is family name stripped. When a font created using the result of this method the transformation would be: java.awt.Font[family=SansSerif,name=SansSerif,style=plain,size=30]
will result to:
java.awt.Font[family=SansSerif,name=Helvetica,style=plain,size=30]

Uses FontTable.normalize(java.util.Map) first.

Parameters:
attributes - with font name to change

Vector Graphics, 2.4

Copyright © 2014. All rights reserved.