phelps.awt
Class Fonts
public abstract
class
Fonts
extends Object
Extensions to java.awt.Font.
- Fonts tries hard to find good substitute family
- Fonts
Version: $Revision: 1.1 $ $Date: 2003/11/07 04:44:59 $
Method Summary |
static Font | createFont(String family, int flags, float size)
A more flexible version of Font#Font(String, int, int) that tries harder to find a good substitute
by relying on Fonts. |
static List<String> | getAvailableFamilies() |
static String | getAvailableFamily(String family, int flags)
Given a family name, return closest font family available as java.awt.Font.
|
static String | getCanonicalPDF(String family) Given alternative (or canonical) name for core font, return canonical name. |
public static Font createFont(String family, int flags, float size)
A more flexible version of Font#Font(String, int, int) that tries harder to find a good substitute
by relying on
Fonts.
Returns: Font (never null
) that best matches desired attributes.
public static List<String> getAvailableFamilies()
public static String getAvailableFamily(String family, int flags)
Given a family name, return closest font family available as java.awt.Font.
Sequence to choose font:
- exact font family name as given
- URW/Ghostscript facsimile, if installed
- (when Java supports dynamic loading of Type 1, search for TeX font)
- name normalization such as removing spaces ("Times New Roman" ⇒ "TimesNewRoman")
- name without style information ("Times-Bold" or "Arial,BoldItalic"), Ghostscript facsimile
- family mapped to core PDF 14 family
- renaming by stripping trailing caps ("ArialMT" ⇒ "Arial") or foundary/company ("Apple Chancery" ⇒ "Chancery")
- family with similar properties to flags
Returns: null iff no close match to family and flags set to FLAG_DO_NOT_USE
public static String getCanonicalPDF(String family)
Given alternative (or canonical) name for core font, return canonical name. Returns null if not a canonical or alternative name.