JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page
Class FontBase

java.lang.Object
  |
  +--java.awt.Font
        |
        +--com.klg.jclass.page.FontBase
All Implemented Interfaces:
Serializable

public abstract class FontBase
extends Font

Extends Font to provide common code for subclasses.

See Also:
Serialized Form

Field Summary
protected static int DEFAULT_FONT_SIZE
           
protected static char REPLACEMENT_CHARACTER
           
 
Fields inherited from class java.awt.Font
BOLD, CENTER_BASELINE, HANGING_BASELINE, ITALIC, LAYOUT_LEFT_TO_RIGHT, LAYOUT_NO_LIMIT_CONTEXT, LAYOUT_NO_START_CONTEXT, LAYOUT_RIGHT_TO_LEFT, name, PLAIN, pointSize, ROMAN_BASELINE, size, style, TRUETYPE_FONT
 
Constructor Summary
FontBase(String name, int style, int size)
          Constructor
 
Method Summary
static GlyphVector createGlyphVector(Font f, FontRenderContext frc, char[] chars)
          Correctly remaps a call to createGlyphVector() for the current JDK level
static GlyphVector createGlyphVector(Font f, FontRenderContext frc, CharacterIterator iter)
          Correctly remaps a call to createGlyphVector() for the current JDK level
static GlyphVector createGlyphVector(Font f, FontRenderContext frc, String text)
          Correctly remaps a call to createGlyphVector() for the current JDK level
static Font deriveFont(Font f, float size)
          Correctly processes a call to deriveFont() for the current JDK level
static Font deriveFont(Font f, int style)
          Correctly processes a call to deriveFont() for the current JDK level
static Font deriveFont(Font f, int style, float size)
          Correctly processes a call to deriveFont() for the current JDK level
static String getDecodeString(String name, int style, int size)
          Given a font, build the decode string so the corresponding device-dependant font can be decoded
static Font getFont(String nm)
          Overrides Font method.
static Font getFont(String nm, Font font)
          Overrides Font method.
protected static Font[] getFonts(com.klg.jclass.page.FontParser parser, String file, String ext, Hashtable fonts, boolean loaded)
          Return an array of fonts.
static float getSize2D(Font f)
          Reinterprets getSize2D depending on the Java version
protected static String getStyleString(int style)
          Given a style constant return its string.
 
Methods inherited from class java.awt.Font
canDisplay, canDisplayUpTo, canDisplayUpTo, canDisplayUpTo, createFont, createGlyphVector, createGlyphVector, createGlyphVector, createGlyphVector, decode, deriveFont, deriveFont, deriveFont, deriveFont, deriveFont, deriveFont, equals, finalize, getAttributes, getAvailableAttributes, getBaselineFor, getFamily, getFamily, getFont, getFontName, getFontName, getItalicAngle, getLineMetrics, getLineMetrics, getLineMetrics, getLineMetrics, getMaxCharBounds, getMissingGlyphCode, getName, getNumGlyphs, getPeer, getPSName, getSize, getSize2D, getStringBounds, getStringBounds, getStringBounds, getStringBounds, getStyle, getTransform, hashCode, hasUniformLineMetrics, isBold, isItalic, isPlain, isTransformed, layoutGlyphVector, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_FONT_SIZE

protected static int DEFAULT_FONT_SIZE

REPLACEMENT_CHARACTER

protected static char REPLACEMENT_CHARACTER
Constructor Detail

FontBase

public FontBase(String name,
                int style,
                int size)
Constructor

Parameters:
name - the String name of the font
style - the style for this font
size - the size for this font
Method Detail

getFont

public static Font getFont(String nm)
Overrides Font method.


getFont

public static Font getFont(String nm,
                           Font font)
Overrides Font method.


getFonts

protected static Font[] getFonts(com.klg.jclass.page.FontParser parser,
                                 String file,
                                 String ext,
                                 Hashtable fonts,
                                 boolean loaded)
Return an array of fonts. If fonts are not already loaded, loadFonts() is called.


getDecodeString

public static String getDecodeString(String name,
                                     int style,
                                     int size)
Given a font, build the decode string so the corresponding device-dependant font can be decoded


getStyleString

protected static String getStyleString(int style)
Given a style constant return its string. Returns -bolditalic, -bold, -italic, or ""


deriveFont

public static Font deriveFont(Font f,
                              int style,
                              float size)
Correctly processes a call to deriveFont() for the current JDK level


deriveFont

public static Font deriveFont(Font f,
                              int style)
Correctly processes a call to deriveFont() for the current JDK level


deriveFont

public static Font deriveFont(Font f,
                              float size)
Correctly processes a call to deriveFont() for the current JDK level


getSize2D

public static float getSize2D(Font f)
Reinterprets getSize2D depending on the Java version


createGlyphVector

public static GlyphVector createGlyphVector(Font f,
                                            FontRenderContext frc,
                                            String text)
Correctly remaps a call to createGlyphVector() for the current JDK level


createGlyphVector

public static GlyphVector createGlyphVector(Font f,
                                            FontRenderContext frc,
                                            char[] chars)
Correctly remaps a call to createGlyphVector() for the current JDK level


createGlyphVector

public static GlyphVector createGlyphVector(Font f,
                                            FontRenderContext frc,
                                            CharacterIterator iter)
Correctly remaps a call to createGlyphVector() for the current JDK level


Copyright © 2004 Quest Software Inc..
All rights reserved.