diff options
author | Jeremias Maerki <jeremias@apache.org> | 2007-11-08 15:13:24 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2007-11-08 15:13:24 +0000 |
commit | 11aa26d46621bd6e74143124868eb22906514677 (patch) | |
tree | da7ad7c0285f6150440fa6050a563c4c83b1211a /src/codegen/fonts | |
parent | 890948b51632025b8d0f7e3157b1cbb68082ede3 (diff) | |
download | xmlgraphics-fop-11aa26d46621bd6e74143124868eb22906514677.tar.gz xmlgraphics-fop-11aa26d46621bd6e74143124868eb22906514677.zip |
Improved font auto-detection and handling of AWT-supplied fonts in order to achieve better results when using multiple output formats. Whenever possible, the font names appearing in the operating system can also be used in XSL-FO.
Better distinction between Font Family Name ("Arial"), Full Font Name ("Arial Bold") and PostScript Name ("Arial-BoldMT"). This allows a better generation of FontTriplets. The same is done for AWT fonts where I have switch from font-family detection to enumerating all java.awt.Font instances so I can extract Family Name, Full Name and PostScript Name. FontInfoFinder and AWT's FontSetup are synchronized as well as possible at this time.
Register "extra-bold" (weight 800) and "light" (weight 200) in triplets when detected.
Tweaked FontInfo.fontLookup() for better fallback behaviour. This approach is rapidly nearing its flexibility limits. We should rethink the FontTriplet structure.
Fixed font-autodetection so fonts with uppercase extensions are detected, too.
Made the way TrueType fonts are embedded in PDF compliant to the specification so viewers correctly identify subset fonts. The name prefix in MultiByteFont was incorrect.
Support the detection of the special Type 1 Symbol font. Symbol used to be detected with "ExpertSubsetEncoding" instead of "SymbolEncoding".
Type1FontLoader tries to construct a "full name" from the PostScript name. This is a temporary hack until we have a PFB or PFA parser.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@593189 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/codegen/fonts')
-rw-r--r-- | src/codegen/fonts/Courier.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/CourierBold.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/CourierBoldOblique.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/CourierOblique.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/Helvetica.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/HelveticaBold.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/HelveticaBoldOblique.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/HelveticaOblique.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/Symbol.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/TimesBold.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/TimesBoldItalic.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/TimesItalic.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/TimesRoman.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/ZapfDingbats.xml | 2 | ||||
-rw-r--r-- | src/codegen/fonts/font-file.xsl | 14 |
15 files changed, 42 insertions, 0 deletions
diff --git a/src/codegen/fonts/Courier.xml b/src/codegen/fonts/Courier.xml index 89c7314db..be977e22e 100644 --- a/src/codegen/fonts/Courier.xml +++ b/src/codegen/fonts/Courier.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Courier</font-name> + <full-name>Courier</full-name> + <family-name>Courier</family-name> <class-name>Courier</class-name> <encoding>StandardEncoding</encoding> <cap-height>562</cap-height> diff --git a/src/codegen/fonts/CourierBold.xml b/src/codegen/fonts/CourierBold.xml index 92a777a50..fa8bed196 100644 --- a/src/codegen/fonts/CourierBold.xml +++ b/src/codegen/fonts/CourierBold.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Courier-Bold</font-name> + <full-name>Courier Bold</full-name> + <family-name>Courier</family-name> <class-name>CourierBold</class-name> <encoding>StandardEncoding</encoding> <cap-height>562</cap-height> diff --git a/src/codegen/fonts/CourierBoldOblique.xml b/src/codegen/fonts/CourierBoldOblique.xml index 914fdab84..5bd26092e 100644 --- a/src/codegen/fonts/CourierBoldOblique.xml +++ b/src/codegen/fonts/CourierBoldOblique.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Courier-BoldOblique</font-name> + <full-name>Courier Bold Oblique</full-name> + <family-name>Courier</family-name> <class-name>CourierBoldOblique</class-name> <encoding>StandardEncoding</encoding> <cap-height>562</cap-height> diff --git a/src/codegen/fonts/CourierOblique.xml b/src/codegen/fonts/CourierOblique.xml index 3b043c17c..2dc300645 100644 --- a/src/codegen/fonts/CourierOblique.xml +++ b/src/codegen/fonts/CourierOblique.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Courier-Oblique</font-name> + <full-name>Courier Oblique</full-name> + <family-name>Courier</family-name> <class-name>CourierOblique</class-name> <encoding>StandardEncoding</encoding> <cap-height>562</cap-height> diff --git a/src/codegen/fonts/Helvetica.xml b/src/codegen/fonts/Helvetica.xml index d63eb5a11..38ae23055 100644 --- a/src/codegen/fonts/Helvetica.xml +++ b/src/codegen/fonts/Helvetica.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Helvetica</font-name> + <full-name>Helvetica</full-name> + <family-name>Helvetica</family-name> <class-name>Helvetica</class-name> <encoding>StandardEncoding</encoding> <cap-height>718</cap-height> diff --git a/src/codegen/fonts/HelveticaBold.xml b/src/codegen/fonts/HelveticaBold.xml index c417937b4..2620a128e 100644 --- a/src/codegen/fonts/HelveticaBold.xml +++ b/src/codegen/fonts/HelveticaBold.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Helvetica-Bold</font-name> + <full-name>Helvetica Bold</full-name> + <family-name>Helvetica</family-name> <class-name>HelveticaBold</class-name> <encoding>StandardEncoding</encoding> <cap-height>718</cap-height> diff --git a/src/codegen/fonts/HelveticaBoldOblique.xml b/src/codegen/fonts/HelveticaBoldOblique.xml index 087b225e4..c11e0ba18 100644 --- a/src/codegen/fonts/HelveticaBoldOblique.xml +++ b/src/codegen/fonts/HelveticaBoldOblique.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Helvetica-BoldOblique</font-name> + <full-name>Helvetica Bold Oblique</full-name> + <family-name>Helvetica</family-name> <class-name>HelveticaBoldOblique</class-name> <encoding>StandardEncoding</encoding> <cap-height>718</cap-height> diff --git a/src/codegen/fonts/HelveticaOblique.xml b/src/codegen/fonts/HelveticaOblique.xml index d913b6d51..7f651a5d9 100644 --- a/src/codegen/fonts/HelveticaOblique.xml +++ b/src/codegen/fonts/HelveticaOblique.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Helvetica-Oblique</font-name> + <full-name>Helvetica Oblique</full-name> + <family-name>Helvetica</family-name> <class-name>HelveticaOblique</class-name> <encoding>StandardEncoding</encoding> <cap-height>718</cap-height> diff --git a/src/codegen/fonts/Symbol.xml b/src/codegen/fonts/Symbol.xml index 241d4d2c6..90685eb5b 100644 --- a/src/codegen/fonts/Symbol.xml +++ b/src/codegen/fonts/Symbol.xml @@ -17,6 +17,8 @@ <!-- $Id$ --> <font-metrics> <font-name>Symbol</font-name> + <full-name>Symbol</full-name> + <family-name>Symbol</family-name> <class-name>Symbol</class-name> <encoding>SymbolEncoding</encoding> <cap-height>1010</cap-height> diff --git a/src/codegen/fonts/TimesBold.xml b/src/codegen/fonts/TimesBold.xml index 12bb17580..20d50fdd8 100644 --- a/src/codegen/fonts/TimesBold.xml +++ b/src/codegen/fonts/TimesBold.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Times-Bold</font-name> + <full-name>Times Bold</full-name> + <family-name>Times</family-name> <class-name>TimesBold</class-name> <encoding>StandardEncoding</encoding> <cap-height>676</cap-height> diff --git a/src/codegen/fonts/TimesBoldItalic.xml b/src/codegen/fonts/TimesBoldItalic.xml index 540e891e1..d1b70872a 100644 --- a/src/codegen/fonts/TimesBoldItalic.xml +++ b/src/codegen/fonts/TimesBoldItalic.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Times-BoldItalic</font-name> + <full-name>Times Bold Italic</full-name> + <family-name>Times</family-name> <class-name>TimesBoldItalic</class-name> <encoding>StandardEncoding</encoding> <cap-height>669</cap-height> diff --git a/src/codegen/fonts/TimesItalic.xml b/src/codegen/fonts/TimesItalic.xml index 4868aed05..514aaa6dd 100644 --- a/src/codegen/fonts/TimesItalic.xml +++ b/src/codegen/fonts/TimesItalic.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Times-Italic</font-name> + <full-name>Times Italic</full-name> + <family-name>Times</family-name> <class-name>TimesItalic</class-name> <encoding>StandardEncoding</encoding> <cap-height>653</cap-height> diff --git a/src/codegen/fonts/TimesRoman.xml b/src/codegen/fonts/TimesRoman.xml index 1f21290de..9ddadfddd 100644 --- a/src/codegen/fonts/TimesRoman.xml +++ b/src/codegen/fonts/TimesRoman.xml @@ -18,6 +18,8 @@ <!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis --> <font-metrics> <font-name>Times-Roman</font-name> + <full-name>Times Roman</full-name> + <family-name>Times</family-name> <class-name>TimesRoman</class-name> <encoding>StandardEncoding</encoding> <cap-height>662</cap-height> diff --git a/src/codegen/fonts/ZapfDingbats.xml b/src/codegen/fonts/ZapfDingbats.xml index 0420908a0..f6ed76d25 100644 --- a/src/codegen/fonts/ZapfDingbats.xml +++ b/src/codegen/fonts/ZapfDingbats.xml @@ -17,6 +17,8 @@ <!-- $Id$ --> <font-metrics> <font-name>ZapfDingbats</font-name> + <full-name>ITC Zapf Dingbats</full-name> + <family-name>ZapfDingbats</family-name> <class-name>ZapfDingbats</class-name> <encoding>ZapfDingbatsEncoding</encoding> <cap-height>820</cap-height> diff --git a/src/codegen/fonts/font-file.xsl b/src/codegen/fonts/font-file.xsl index 94dfa7b4c..316d8a784 100644 --- a/src/codegen/fonts/font-file.xsl +++ b/src/codegen/fonts/font-file.xsl @@ -45,6 +45,8 @@ import org.apache.fop.fonts.CodePointMapping; public class <xsl:value-of select="class-name"/> extends Typeface { private final static String fontName = "<xsl:value-of select="font-name"/>"; + private final static String fullName = "<xsl:value-of select="full-name"/>"; + private final static String familyName = "<xsl:value-of select="family-name"/>"; private final static String encoding = <xsl:choose><xsl:when test="$encoding != $native-encoding">"<xsl:value-of select="$encoding"/>"</xsl:when><xsl:otherwise>null</xsl:otherwise></xsl:choose>; private final static int capHeight = <xsl:value-of select="cap-height"/>; private final static int xHeight = <xsl:value-of select="x-height"/>; @@ -88,6 +90,18 @@ public class <xsl:value-of select="class-name"/> extends Typeface { return fontName; } + public String getEmbedFontName() { + return getFontName(); + } + + public String getFullName() { + return fullName; + } + + public String getFamilyName() { + return familyName; + } + public FontType getFontType() { return FontType.TYPE1; } |