You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Antti Karanta <an...@napa.fi> on 2008/05/07 10:11:09 UTC

Problem using Lucida Console font


                     Hi!

   My adventures with fonts continue. Now I run into trouble trying to use  
Lucida Console (in pdf).


   What I have is this:

<fo:block space-before.minimum="0.8em" space-before.optimum="1em"  
space-before.maximum="1.2em" space-after.minimum="0.8em"  
space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false"  
wrap-option="no-wrap" white-space-collapse="false"  
white-space-treatment="preserve" linefeed-treatment="preserve"  
text-align="start" font-family="'Lucida Console'" id="d0e69">blah  
blah</fo:block>

   I also tried

font-family="Lucida Console"

   (i.e. without the single quotes)

   FOP says

WARNING: Font 'Lucida Console,normal,400' not found. Substituting with  
'any,normal,400'.


   This is strange since the other fonts in c:\WINDOWS\Fonts directory seem  
to work ok when referenced (e.g. Tahoma, Verdana).

   Could there be a problem because the font name has a space in it?

   Do I have to create a separate font metrics file? If so, why is this  
necessary for Lucida Console, but not e.g. for Tahoma and Verdana?


   My environment: win xp sp 2, java 1.5.0_15, fop 0.95beta

in my fop.xconf I have

   <renderers>
     <renderer mime="application/pdf">
       <fonts>
         <auto-detect/>
       </fonts>



       -::Antti::-



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by Antti Karanta <an...@napa.fi>.
On Wed, 07 May 2008 11:30:32 +0300, Jeremias Maerki  
<de...@jeremias-maerki.ch> wrote:

> Worked fine for me with and without additional quotes in 0.95beta (same
> setup as yours except I used Sun JVM 1.5.0_14). Are you sure that your
> config file gets used?

   Turns out I had messed up my PATH and was using 0.94 when I thought I  
was using 0.95 beta. Everything works just fine w/ 0.95 beta.

   My mistake, sorry about the trouble, thanks for the help!



       -::Antti::-


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Worked fine for me with and without additional quotes in 0.95beta (same
setup as yours except I used Sun JVM 1.5.0_14). Are you sure that your
config file gets used?

Test file:
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Lucida Console">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" margin="2cm">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="A4">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>Hello World!</fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

Config file:
<?xml version="1.0" encoding="UTF-8"?>
<fop>
  <renderers>
    <renderer mime="application/pdf">
      <fonts>
        <auto-detect/>  
      </fonts>
    </renderer>
  </renderers>
</fop>


On 07.05.2008 10:11:09 Antti Karanta wrote:
> 
> 
>                      Hi!
> 
>    My adventures with fonts continue. Now I run into trouble trying to use  
> Lucida Console (in pdf).
> 
> 
>    What I have is this:
> 
> <fo:block space-before.minimum="0.8em" space-before.optimum="1em"  
> space-before.maximum="1.2em" space-after.minimum="0.8em"  
> space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false"  
> wrap-option="no-wrap" white-space-collapse="false"  
> white-space-treatment="preserve" linefeed-treatment="preserve"  
> text-align="start" font-family="'Lucida Console'" id="d0e69">blah  
> blah</fo:block>
> 
>    I also tried
> 
> font-family="Lucida Console"
> 
>    (i.e. without the single quotes)
> 
>    FOP says
> 
> WARNING: Font 'Lucida Console,normal,400' not found. Substituting with  
> 'any,normal,400'.
> 
> 
>    This is strange since the other fonts in c:\WINDOWS\Fonts directory seem  
> to work ok when referenced (e.g. Tahoma, Verdana).
> 
>    Could there be a problem because the font name has a space in it?
> 
>    Do I have to create a separate font metrics file? If so, why is this  
> necessary for Lucida Console, but not e.g. for Tahoma and Verdana?
> 
> 
>    My environment: win xp sp 2, java 1.5.0_15, fop 0.95beta
> 
> in my fop.xconf I have
> 
>    <renderers>
>      <renderer mime="application/pdf">
>        <fonts>
>          <auto-detect/>
>        </fonts>
> 
> 
> 
>        -::Antti::-
> 
> 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 08.05.2008 10:48:33 John Brown wrote:
> Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:
> 
> > 
> > I have an Ubuntu 8.04 in a VM to play with. So I copied over the Bodoni
> > fonts from that ZIP file you indicated. However, the ZIP does not
> > contain any AFM files for the Bodoni font, just the PFB and PFM.
> 
> You are right. The timestamp was different for the AFM files (2007 as 
> opposed to 1990), so I looked inside one and saw:
> 
> Comment AFM Generated by Ghostscript/pf2afm
> 
> > Looking
> > at these fonts, BTW, gives me a strong impression that these are illegal
> > and altered copies (Some of the fonts give a BBS phone number). Anyway,
> > I had no problems
> 
> Oh well...
> 
> > auto-detecting and using the fonts with FOP 0.95beta.
> 
> fop-trunk also works.
> 
> > If you've installed the fonts in a location other than the directory
> > mentioned in the following Java class:
> >
> http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/UnixFontDirFinder.java
> > you'll have to use the "directory" element in the font configuration.
> >
> 
> It worked. All fonts that I have tried so far (TT and Type1) can now
> be used.

Great. Thanks for the feedback. BTW, I've added the additional Unix font
directory: http://svn.apache.org/viewvc?rev=654453&view=rev

> By the way, the FOP-trunk online documentation says:
> 
> "Font registration via XML font metrics file is still supported and is still
> necessary if you want to use a TrueType Collection (*.ttc). Direct support for
> TrueType collections may be added later."
> 
> This should be updated, as I can use such fonts. Cambria is an MS font that
> comes with Office 2007, but, for whatever reason, it is included in the
> latest PowerPoint viewer, the installer of which runs on Linux. Cambria.ttf
> contains "Cambria" and "Cambria Math" (which I know only because FOP
> told me) and I can select either one.

I've updated the documentation in SVN. It will go live the next time the
website is published. Thanks for the hint.

> Thanks.
> 
> <snip/>



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by John Brown <jo...@hotmail.com>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:

> 
> I have an Ubuntu 8.04 in a VM to play with. So I copied over the Bodoni
> fonts from that ZIP file you indicated. However, the ZIP does not
> contain any AFM files for the Bodoni font, just the PFB and PFM.

You are right. The timestamp was different for the AFM files (2007 as 
opposed to 1990), so I looked inside one and saw:

Comment AFM Generated by Ghostscript/pf2afm

> Looking
> at these fonts, BTW, gives me a strong impression that these are illegal
> and altered copies (Some of the fonts give a BBS phone number). Anyway,
> I had no problems

Oh well...

> auto-detecting and using the fonts with FOP 0.95beta.

fop-trunk also works.

> If you've installed the fonts in a location other than the directory
> mentioned in the following Java class:
>
http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/UnixFontDirFinder.java
> you'll have to use the "directory" element in the font configuration.
>

It worked. All fonts that I have tried so far (TT and Type1) can now
be used. By the way, the FOP-trunk online documentation says:

"Font registration via XML font metrics file is still supported and is still
necessary if you want to use a TrueType Collection (*.ttc). Direct support for
TrueType collections may be added later."

This should be updated, as I can use such fonts. Cambria is an MS font that
comes with Office 2007, but, for whatever reason, it is included in the
latest PowerPoint viewer, the installer of which runs on Linux. Cambria.ttf
contains "Cambria" and "Cambria Math" (which I know only because FOP
told me) and I can select either one.

Thanks.

<snip/>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by Andreas Delmelle <an...@telenet.be>.
On May 8, 2008, at 09:06, Jeremias Maerki wrote:
> <snip />
> It looks like /usr/local/share/fonts is another place where fonts  
> can be
> on Unixes but that's not used by FOP, yet. Can a Unix Guru confirm  
> that
> it would be correct to add this directory to the other ones in
> UnitFontDirFinder?

FWIW, no Guru over here, but anyway:
I think this can be safely added. If the directory does not exist, I  
assume IOCommons' DirectoryHandler simply adds nothing to the result  
list (see FontInfoFinder.find())? Only if the DirectoryWalker would  
not handle non-existing directories, we'd have to take care of that  
on our side as well, but checking the Javadocs, DirectoryWalker.walk 
() only throws an IOException if you pass null as the starting-point.


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I have an Ubuntu 8.04 in a VM to play with. So I copied over the Bodoni
fonts from that ZIP file you indicated. However, the ZIP does not
contain any AFM files for the Bodoni font, just the PFB and PFM. Looking
at these fonts, BTW, gives me a strong impression that these are illegal
and altered copies (Some of the fonts give a BBS phone number). Anyway,
I had no problems auto-detecting and using the fonts with FOP 0.95beta.
If you've installed the fonts in a location other than the directory
mentioned in the following Java class:
http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/UnixFontDirFinder.java
you'll have to use the "directory" element in the font configuration.

It looks like /usr/local/share/fonts is another place where fonts can be
on Unixes but that's not used by FOP, yet. Can a Unix Guru confirm that
it would be correct to add this directory to the other ones in
UnitFontDirFinder?

On 07.05.2008 22:16:06 John Brown wrote:
> Andreas Delmelle <andreas.delmelle <at> telenet.be> writes:
> 
> > 
> > 
> > On May 7, 2008, at 10:30, Andreas Delmelle wrote:
> > > <snip />
> > >
> > > Can you try to checkout and build FOP 0.95 (*), and see if that  
> > > helps already? 
> 
> <snip/>
> 
> > If you still need it, the URL to use with SVN for 0.95 head:
> > http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95
> > 
> > Cheers
> > 
> > Andreas
> > 
> 
> 
> I am on Linux (Kubuntu Gutsy Gibbon (7.10?)). Auto-detection of
> fonts does not work most of the time. For example, I cannot use
> Bodoni (Type 1 font - the download page says that it is shareware,
> but neither the site nor the ZIP file says who should be paid).
> I downloaded the font at
> http://www.winsite.com/bin/Info?500000017011.
> 
> Scribus lets me embed this font in a PDF, and Scribus itself
> says that it is strict about the fonts that it allows to be
> embedded, so I assume that nothing is wrong with the font.
> 
> 'fc-list Bodoni' gives:
> Bodoni:style=Bold
> Bodoni:style=Normal-Italic
> Bodoni:style=Normal
> 
> 'ls /usr/local/share/fonts/bodoni*' gives:
> /usr/local/share/fonts/bodoni.afm   /usr/local/share/fonts/bodonii.pfb
> /usr/local/share/fonts/bodonib.afm  /usr/local/share/fonts/bodonii.pfm
> /usr/local/share/fonts/bodonib.pfb  /usr/local/share/fonts/bodoni.pfb
> /usr/local/share/fonts/bodonib.pfm  /usr/local/share/fonts/bodoni.pfm
> /usr/local/share/fonts/bodonii.afm
> 
> AFM, PFM and PFB files are all present.
> 
> However fop-trunk svn (653186, 2008-05-03) and fop-0.95beta svn
> (653537, 2008-05-05) both say:
> WARNING: Font 'Bodoni,normal,400' not found. Substituting 
> with 'any,normal,400'.
> 
> I used the same FO and fop.xconf that was posted.
> 
> I noticed that fop printed a lot of warnings like:
> 
> May 7, 2008 2:05:22 PM org.apache.fop.fonts.truetype.TTFFile determineAscDesc
> WARNING: Ascender and descender together are larger than the em box. This 
> could lead to a wrong baseline placement in Apache FOP.
> 
> and
> 
> May 7, 2008 2:05:35 PM org.apache.fop.fonts.truetype.TTFFile 
> guessVerticalMetricsFromGlyphBBox
> WARNING: xHeight value could not be determined. The font may not work as 
> expected.
> May 7, 2008 2:05:35 PM org.apache.fop.fonts.type1.PFMFile loadExtMetrics
> WARNING: Size of extension block was expected to be 52 bytes, but was 0 bytes.
> 
> The messages do not say which fonts cause the warnings. I do
> not know if it matters.
> 
> By the way, I have found a few Type 1 fonts that fop
> recognises, but no TrueType fonts so far.
> 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by Andreas Delmelle <an...@telenet.be>.
On May 7, 2008, at 22:16, John Brown wrote:

Hi John

> I am on Linux (Kubuntu Gutsy Gibbon (7.10?)). Auto-detection of
> fonts does not work most of the time.

Judging from the info, it's not so much the font-detection that isn't  
working, but rather, it points to issues with the loading/parsing of  
the font-files.

The AFM parser is a relatively new addition IIC, so could be that  
there are still some hiccups in there.

Personally, I have seen issues with the TrueType fonts for Mac, where  
the Windows variant is perfectly parsed.
I suspect this is due to the fact that the devs working on the font- 
loading code did most of their work on a Windows box and had no Mac  
TTFs available to test.

On another note: which JVM are you using? One thing I did notice when  
I once looked closer at the TTFLoader is a lot of bit-shifting. It  
would only require a small quirk in the JVM in that respect to make  
the loader parse the file completely wrong...




Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by John Brown <jo...@hotmail.com>.
Andreas Delmelle <andreas.delmelle <at> telenet.be> writes:

> 
> 
> On May 7, 2008, at 10:30, Andreas Delmelle wrote:
> > <snip />
> >
> > Can you try to checkout and build FOP 0.95 (*), and see if that  
> > helps already? 

<snip/>

> If you still need it, the URL to use with SVN for 0.95 head:
> http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95
> 
> Cheers
> 
> Andreas
> 


I am on Linux (Kubuntu Gutsy Gibbon (7.10?)). Auto-detection of
fonts does not work most of the time. For example, I cannot use
Bodoni (Type 1 font - the download page says that it is shareware,
but neither the site nor the ZIP file says who should be paid).
I downloaded the font at
http://www.winsite.com/bin/Info?500000017011.

Scribus lets me embed this font in a PDF, and Scribus itself
says that it is strict about the fonts that it allows to be
embedded, so I assume that nothing is wrong with the font.

'fc-list Bodoni' gives:
Bodoni:style=Bold
Bodoni:style=Normal-Italic
Bodoni:style=Normal

'ls /usr/local/share/fonts/bodoni*' gives:
/usr/local/share/fonts/bodoni.afm   /usr/local/share/fonts/bodonii.pfb
/usr/local/share/fonts/bodonib.afm  /usr/local/share/fonts/bodonii.pfm
/usr/local/share/fonts/bodonib.pfb  /usr/local/share/fonts/bodoni.pfb
/usr/local/share/fonts/bodonib.pfm  /usr/local/share/fonts/bodoni.pfm
/usr/local/share/fonts/bodonii.afm

AFM, PFM and PFB files are all present.

However fop-trunk svn (653186, 2008-05-03) and fop-0.95beta svn
(653537, 2008-05-05) both say:
WARNING: Font 'Bodoni,normal,400' not found. Substituting 
with 'any,normal,400'.

I used the same FO and fop.xconf that was posted.

I noticed that fop printed a lot of warnings like:

May 7, 2008 2:05:22 PM org.apache.fop.fonts.truetype.TTFFile determineAscDesc
WARNING: Ascender and descender together are larger than the em box. This 
could lead to a wrong baseline placement in Apache FOP.

and

May 7, 2008 2:05:35 PM org.apache.fop.fonts.truetype.TTFFile 
guessVerticalMetricsFromGlyphBBox
WARNING: xHeight value could not be determined. The font may not work as 
expected.
May 7, 2008 2:05:35 PM org.apache.fop.fonts.type1.PFMFile loadExtMetrics
WARNING: Size of extension block was expected to be 52 bytes, but was 0 bytes.

The messages do not say which fonts cause the warnings. I do
not know if it matters.

By the way, I have found a few Type 1 fonts that fop
recognises, but no TrueType fonts so far.



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by Andreas Delmelle <an...@telenet.be>.
On May 7, 2008, at 10:30, Andreas Delmelle wrote:
> <snip />
>
> Can you try to checkout and build FOP 0.95 (*), and see if that  
> helps already? If you don't have them yet: Subversion, a JDK and  
> Apache Ant are needed to do this.
> If you don't have those tools handy, and you won't ever need them  
> for anything else, then it is probably overkill to set up.
> In that case, I hope someone out there chimes in to confirm/refute  
> what I mentioned above. I currently have no Windows-box to test on...
>
> (*) http://xmlgraphics.apache.org/fop/download.html#source

Apologies, I overlooked that the 0.95 branch is not referenced on  
this page (only the 0.95beta tag, which would give you the exact same  
version you're working with now)

If you still need it, the URL to use with SVN for 0.95 head:
http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95

Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem using Lucida Console font

Posted by Andreas Delmelle <an...@telenet.be>.
On May 7, 2008, at 10:11, Antti Karanta wrote:

Hi

> My adventures with fonts continue. Now I run into trouble trying to  
> use Lucida Console (in pdf).
>
> What I have is this:
>
> <fo:block space-before.minimum="0.8em" space-before.optimum="1em"  
> space-before.maximum="1.2em" space-after.minimum="0.8em" space- 
> after.optimum="1em" space-after.maximum="1.2em" hyphenate="false"  
> wrap-option="no-wrap" white-space-collapse="false" white-space- 
> treatment="preserve" linefeed-treatment="preserve" text- 
> align="start" font-family="'Lucida Console'" id="d0e69">blah blah</ 
> fo:block>
>
>   I also tried
>
> font-family="Lucida Console"
>
>   (i.e. without the single quotes)

FWIW: Both should work. XSL-FO refers to CSS for the definition, and  
the CSS spec only /recommends/ to use quotes for font-family names  
with spaces, but FOP should allow and process both variants correctly.

> FOP says
>
> WARNING: Font 'Lucida Console,normal,400' not found. Substituting  
> with 'any,normal,400'.
>
>
> This is strange since the other fonts in c:\WINDOWS\Fonts directory  
> seem to work ok when referenced (e.g. Tahoma, Verdana).
>
> Could there be a problem because the font name has a space in it?

Very close. IIC, the problem would be that the TTF-file itself  
contains another font-name than 'Lucida Console'.
I seem to remember a similar issue popping up recently (but that was  
for Type1 fonts). That issue was confirmed to be fixed in 0.95 head  
(to be released in a couple of weeks). Maybe it also solves your  
problem...?


Can you try to checkout and build FOP 0.95 (*), and see if that helps  
already? If you don't have them yet: Subversion, a JDK and Apache Ant  
are needed to do this.
If you don't have those tools handy, and you won't ever need them for  
anything else, then it is probably overkill to set up.
In that case, I hope someone out there chimes in to confirm/refute  
what I mentioned above. I currently have no Windows-box to test on...

(*) http://xmlgraphics.apache.org/fop/download.html#source

Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org