org.freehep.graphicsio.svg
Class SVGFontTable

java.lang.Object
  extended by org.freehep.graphicsio.svg.SVGFontTable

public class SVGFontTable
extends java.lang.Object

A table to remember which glyphs were used while writing a svg file. Entries are added by calling addGlyphs(String, java.awt.Font). The final SVG tag for the section is generated using toString(). Use normalize(java.util.Map) for referencing embedded glyphs in tags.

Version:
$Id: SVGFontTable.java 12753 2007-06-12 22:32:31Z duns $
Author:
Steffen Greiffenberg

Constructor Summary
SVGFontTable()
           
 
Method Summary
protected  void addGlyphs(java.lang.String string, java.awt.Font font)
          creates the glyph for the string
static void normalize(java.util.Map attributes)
          Replaces TextAttribute.FAMILY by values of replaceFonts.
 java.lang.String toString()
          creates the font entry:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SVGFontTable

public SVGFontTable()
Method Detail

addGlyphs

protected void addGlyphs(java.lang.String string,
                         java.awt.Font font)
creates the glyph for the string

Parameters:
string -
font -

toString

public java.lang.String toString()
creates the font entry:
 
 
 ...
 
 

Overrides:
toString in class java.lang.Object
Returns:
string representing the entry

normalize

public static void normalize(java.util.Map attributes)
Replaces TextAttribute.FAMILY by values of replaceFonts. 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


Copyright © 2000-2007 FreeHEP. All Rights Reserved.