fop 1.0

org.apache.fop.svg
Class PDFTextUtil

java.lang.Object
  extended by org.apache.fop.pdf.PDFTextUtil
      extended by org.apache.fop.svg.PDFTextUtil

public abstract class PDFTextUtil
extends PDFTextUtil

Utility class for generating PDF text objects. It needs to be subclassed to add writing functionality (see PDFTextUtil.write(String)).


Field Summary
 
Fields inherited from class org.apache.fop.pdf.PDFTextUtil
TR_CLIP, TR_FILL, TR_FILL_CLIP, TR_FILL_STROKE, TR_FILL_STROKE_CLIP, TR_INVISIBLE, TR_STROKE, TR_STROKE_CLIP
 
Constructor Summary
PDFTextUtil(FontInfo fontInfo)
          Main constructor.
 
Method Summary
 Font getCurrentFont()
          Returns the current font in use.
protected  void initValues()
          Resets the state fields.
protected  boolean isMultiByteFont(java.lang.String name)
          Determines whether the font with the given name is a multi-byte font.
 Font selectFontForChar(char ch)
          Selects a font from the font list suitable to display the given character.
 void setCurrentFont(Font f)
          Sets the current font.
 void setFont(Font font)
          Sets the current font for the text object.
 void setFonts(Font[] fonts)
          Sets the current fonts for the text object.
 void writeTf(Font f)
          Writes a "Tf" command, setting a new current font.
 void writeTJChar(char ch)
          Writes a char to the "TJ-Buffer".
 
Methods inherited from class org.apache.fop.pdf.PDFTextUtil
adjustGlyphTJ, beginTextObject, concatMatrix, endTextObject, isInTextObject, restoreGraphicsState, saveGraphicsState, setTextRenderingMode, setTextRenderingMode, updateTf, write, writeTextMatrix, writeTf, writeTJ, writeTJMappedChar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFTextUtil

public PDFTextUtil(FontInfo fontInfo)
Main constructor.

Parameters:
fontInfo - the font catalog
Method Detail

initValues

protected void initValues()
Resets the state fields.

Overrides:
initValues in class PDFTextUtil

setFonts

public void setFonts(Font[] fonts)
Sets the current fonts for the text object. For every character, the suitable font will be selected.

Parameters:
fonts - the new fonts

setFont

public void setFont(Font font)
Sets the current font for the text object.

Parameters:
font - the new font

getCurrentFont

public Font getCurrentFont()
Returns the current font in use.

Returns:
the current font or null if no font is currently active.

setCurrentFont

public void setCurrentFont(Font f)
Sets the current font.

Parameters:
f - the new font to use

isMultiByteFont

protected boolean isMultiByteFont(java.lang.String name)
Determines whether the font with the given name is a multi-byte font.

Parameters:
name - the name of the font
Returns:
true if it's a multi-byte font

writeTf

public void writeTf(Font f)
Writes a "Tf" command, setting a new current font.

Parameters:
f - the font to select

selectFontForChar

public Font selectFontForChar(char ch)
Selects a font from the font list suitable to display the given character.

Parameters:
ch - the character
Returns:
the recommended Font to use

writeTJChar

public void writeTJChar(char ch)
Writes a char to the "TJ-Buffer".

Parameters:
ch - the unmapped character

fop 1.0

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.