org.apache.fop.fonts
Class FontUtil
java.lang.Object
org.apache.fop.fonts.FontUtil
public class FontUtil
extends java.lang.Object
Font utilities.
static String | guessStyle(String fontName) - Guesses the font style of a font using its name.
|
static int | guessWeight(String fontName) - Guesses the font weight of a font using its name.
|
static int | parseCSS2FontWeight(String text) - Parses an CSS2 (SVG and XSL-FO) font weight (normal, bold, 100-900) to
an integer.
|
static String | stripWhiteSpace(String s) - Removes all white space from a string (used primarily for font names)
|
guessStyle
public static String guessStyle(String fontName)
Guesses the font style of a font using its name.
guessWeight
public static int guessWeight(String fontName)
Guesses the font weight of a font using its name.
- an integer between 100 and 900
parseCSS2FontWeight
public static int parseCSS2FontWeight(String text)
Parses an CSS2 (SVG and XSL-FO) font weight (normal, bold, 100-900) to
an integer.
See http://www.w3.org/TR/REC-CSS2/fonts.html#propdef-font-weight
TODO: Implement "lighter" and "bolder".
text
- the font weight to parse
- an integer between 100 and 900 (100, 200, 300...)
stripWhiteSpace
public static String stripWhiteSpace(String s)
Removes all white space from a string (used primarily for font names)
Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.