org.apache.fop.fonts

Class FontUtil


public class FontUtil
extends java.lang.Object

Font utilities.

Method Summary

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)

Method Details

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".
Parameters:
text - the font weight to parse
Returns:
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)
Parameters:
s - the string
Returns:
the processed result

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