Solved: section needed in config file (was: Re: problem with custom fonts: ,400,normal not found)

2007-11-29 Thread Diana Walther

Jeremias Maerki wrote:

The triplet associates the name, style and weight with a particular font.
You can associate multiple triplets with one font. So if you use 
"Frutiger45Light"
in the triplet, you have to use "Frutiger45Light" in the FO, not "Frutiger 45 
Light".

You could, for example, do this:

  
  


  

2. How do I get the correct font name? Is it the one given in the font
metrics file? Or is it the one given during font metrics file
compilation (in my cases, the second one has spaces).



The name in the metrics file is irrelevant and not used at all. Again,
it's the triplet that plays the tune here.

  

Hi Jeremias,

thanks a lot for the information. Finally, I solved my problem. It was 
not only related to the name of the font.


I did not specify the "renderers"-elements in my config file for the pdf 
renderer. The -elements have to be a child of this. 
http://xmlgraphics.apache.org/fop/0.94/configuration.html


I found the hint here:
http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/200703.mbox/[EMAIL 
PROTECTED]

Best regards, Diana



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problem with custom fonts: ,400,normal not found

2007-11-26 Thread Jeremias Maerki
Most probably, the problem you experience is simply to do the missing
spaces in the font-triplet. You specified "Frutiger45Light" in the
configuration, but "Frutiger 45 Light" in the FO.

More details below.

On 24.11.2007 17:03:15 Diana Walther wrote:
> Hi there,
> 
> I've got trouble using customized fonts with FOP 0.94 on a Windows XP
> machine. My java version is: 1.6.02.
> 
> I know the problem has been discussed before. However, none of the
> suggestions given here or in other mailing lists or forums worked for
> me.
> 
> My problem:
> ---
> I get an error message like
> 
>   "Font Frutiger 45 Light, 400, normal not found"
> 
> during pdf compilation, the system is using the standard font. I also 
> tried to apply the bold or the italics font triplet, but the system 
> can't find them either.
> 
> What has worked so far? I followed the route given here:
> http://xmlgraphics.apache.org/fop/trunk/fonts.html
> 
> 1. I built font-metrics xml files for my desired font with the TFReader. 
> The related ttf-file has been discribed to me as, say "Frutiger 45 
> Light" and I assume that it contains at least the triplets for the 
> style="normal" and weight="normal".
> 
> 2. I specified a baseDir and an fontDir in my config file for fop (in my 
>   case, both are similar).
> 
> Here is a part of my fop config file:
> 
> -- part starts --
> 
> baseDir
> D:\fop094
>   
> 
> fontBaseDir
> D:\fop094
>   
> 
> --- end of part ---
> 
> I also registered my font in the config file:
> 
> -- part starts --
> 
> 
> 
> 
> 
> --- end of part ---
> 
> 3. The XML font metrics file and ttf file are in the font basedir. to be 
> sure, I also put them
> a) into the directory where the xslt-file is stored and
> b) in the directory where the batch file that calls fop.bat (the one in 
>   fop basedir) is located.
> 
> 4. I refer to new custom font name via "font-family" in the xslt-file.
> As font name, I use the one that is given in the font metrics xml-file
> and during font metrics building process in the dos shell (I have tried 
> with and without the spaces).
> 
> 5.  I used the config file on the command line (i.e, in a simple batch
> file). It seems to be used (my hyphenation specifiations, also given in
> the config file, are used), so why can't it find my font files?
> 
> 
> Maybe I made a mistake regarding the following two things?
> 
> 1. How do I know which font-triplet (regarding italics, bold) goes with
> which ttf-file? Can I only use a)  the name of the file as indicator or
> b) the information given during font metrics file compilation? In the
> examples given in the fop config file, some files go with multiple
> triplets, others do not.

The triplet associates the name, style and weight with a particular font.
You can associate multiple triplets with one font. So if you use 
"Frutiger45Light"
in the triplet, you have to use "Frutiger45Light" in the FO, not "Frutiger 45 
Light".

You could, for example, do this:

  
  


> 2. How do I get the correct font name? Is it the one given in the font
> metrics file? Or is it the one given during font metrics file
> compilation (in my cases, the second one has spaces).

The name in the metrics file is irrelevant and not used at all. Again,
it's the triplet that plays the tune here.

> Thanks for any answers and best regards,
> Diana

HTH
Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



problem with custom fonts: ,400,normal not found

2007-11-24 Thread Diana Walther

Hi there,

I've got trouble using customized fonts with FOP 0.94 on a Windows XP
machine. My java version is: 1.6.02.

I know the problem has been discussed before. However, none of the
suggestions given here or in other mailing lists or forums worked for
me.

My problem:
---
I get an error message like

"Font Frutiger 45 Light, 400, normal not found"

during pdf compilation, the system is using the standard font. I also 
tried to apply the bold or the italics font triplet, but the system 
can't find them either.


What has worked so far? I followed the route given here:
http://xmlgraphics.apache.org/fop/trunk/fonts.html

1. I built font-metrics xml files for my desired font with the TFReader. 
The related ttf-file has been discribed to me as, say "Frutiger 45 
Light" and I assume that it contains at least the triplets for the 
style="normal" and weight="normal".


2. I specified a baseDir and an fontDir in my config file for fop (in my 
 case, both are similar).


Here is a part of my fop config file:

-- part starts --

   baseDir
   D:\fop094
 

   fontBaseDir
   D:\fop094
 

--- end of part ---

I also registered my font in the config file:

-- part starts --





--- end of part ---

3. The XML font metrics file and ttf file are in the font basedir. to be 
sure, I also put them

a) into the directory where the xslt-file is stored and
b) in the directory where the batch file that calls fop.bat (the one in 
 fop basedir) is located.


4. I refer to new custom font name via "font-family" in the xslt-file.
As font name, I use the one that is given in the font metrics xml-file
and during font metrics building process in the dos shell (I have tried 
with and without the spaces).


5.  I used the config file on the command line (i.e, in a simple batch
file). It seems to be used (my hyphenation specifiations, also given in
the config file, are used), so why can't it find my font files?


Maybe I made a mistake regarding the following two things?

1. How do I know which font-triplet (regarding italics, bold) goes with
which ttf-file? Can I only use a)  the name of the file as indicator or
b) the information given during font metrics file compilation? In the
examples given in the fop config file, some files go with multiple
triplets, others do not.

2. How do I get the correct font name? Is it the one given in the font
metrics file? Or is it the one given during font metrics file
compilation (in my cases, the second one has spaces).

Thanks for any answers and best regards,
Diana






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-19 Thread Daniel Noll

Chris Bowditch wrote:
I thought the command was basically the same for all fonts, except 
where .ttc collections were involved.  I was (and still am) 
considering writing some magic code which autocreates the metrics when 
a new font is discovered.


No need ;) such code already exists in FOP trunk.


Convenient I guess, assuming you never need to use AWT.  No more writing 
lines and lines of font config. :-)


The patch for autodetection of Fonts is only for PDF and PS Renderers. 
The AWT Renderer gets its Fonts from the JDK which in turn gets its 
fonts from the Operating System. The difference in font metrics between 
AWT and PS/PDF exists regardless of the new auto font detection patch.


That's a shame.

I wonder if there is some way to grab the autogenerating metrics from 
the PDF code, and somehow push it into the AWT metrics.


At the moment my hack is sitting in the FontMetricsMapper constructor, 
and it overrides the metrics for only the fonts which I've hard-coded. 
It would be much better if I could just delegate to the PDF metrics 
loader for a given font name.  It may even make the code good enough to 
go into trunk, whereas right now it's very much a hack. :-(


Daniel


--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, AustraliaPh: +61 2 9280 0699
Web: http://nuix.com/   Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-19 Thread Chris Bowditch

Daniel Noll wrote:

Thomas Zastrow wrote:


I agree. I didn't thought of bundling FOP directly with the fonts.
Instead, they could be put on another webpage and the user can download
them optional. It was just an  idea, as it was some labour to build the
metrics for my preferred fonts ;-)



I thought the command was basically the same for all fonts, except where 
.ttc collections were involved.  I was (and still am) considering 
writing some magic code which autocreates the metrics when a new font is 
discovered.


No need ;) such code already exists in FOP trunk.




We better try to discover the fonts installed on the system and
automatically configure them. Good news, Adrian Cumiskey recently
submitted a patch which does exactly that. Review and application 
pending...



Huh, that would be the perfect solution ;-)



Only if it results in consistent metrics between PDF and AWT renderers. 
Otherwise we'll just be bypassing all that convenience to make things 
render right. :-/


The patch for autodetection of Fonts is only for PDF and PS Renderers. 
The AWT Renderer gets its Fonts from the JDK which in turn gets its 
fonts from the Operating System. The difference in font metrics between 
AWT and PS/PDF exists regardless of the new auto font detection patch.


Chris




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-18 Thread Daniel Noll

Thomas Zastrow wrote:

I agree. I didn't thought of bundling FOP directly with the fonts.
Instead, they could be put on another webpage and the user can download
them optional. It was just an  idea, as it was some labour to build the
metrics for my preferred fonts ;-)


I thought the command was basically the same for all fonts, except where 
.ttc collections were involved.  I was (and still am) considering 
writing some magic code which autocreates the metrics when a new font is 
discovered.



We better try to discover the fonts installed on the system and
automatically configure them. Good news, Adrian Cumiskey recently
submitted a patch which does exactly that. Review and application pending...


Huh, that would be the perfect solution ;-)


Only if it results in consistent metrics between PDF and AWT renderers. 
Otherwise we'll just be bypassing all that convenience to make things 
render right. :-/


Daniel

--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, AustraliaPh: +61 2 9280 0699
Web: http://nuix.com/   Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-18 Thread Thomas Zastrow
Vincent Hennebert wrote:
> Hi Thomas,
>
> Thomas Zastrow a écrit :
> 
>   
>> Sorry for that, but I'm not realy satisfied with the fonts which are
>> implemented in the FOP, so I converted some of my most beloved free /
>> OpenSource fonts. When the license of the font allows it, it would be
>> nice to have something like an additional font pack wich could be simply
>> downloaded and integrated into FOP. What do you think about this idea?
>> 
>
> Hmmm, FOP does not really /implement/ any fonts. That's not the wording
> I would use anyway.
> For PDF and PS output, FOP uses the default base 14 PDF fonts (the
> well-known Times, Helvetica, Courier plus Symbol and ZapfDingbats).
> Those are the fonts that are guaranteed to be found on any system, so
> which may be usable everywhere without any configuration. I perfectly
> understand that you don't like those fonts because (1) they are missing
> many (non-western) glyphs; (2) they are seen everywhere so we get tired
> of them. But they work...
> For AWT output FOP relies on the Java font system which to a certain
> extent may use fonts installed on the system.
>
> It's difficult to find fonts distributable with FOP. Many open-source
> fonts have a license incompatible with the Apache license. And even if
> that were possible that would not really make sense, users generally
> just want to use the fonts they have on their systems.
>   

I agree. I didn't thought of bundling FOP directly with the fonts.
Instead, they could be put on another webpage and the user can download
them optional. It was just an  idea, as it was some labour to build the
metrics for my preferred fonts ;-)

> We better try to discover the fonts installed on the system and
> automatically configure them. Good news, Adrian Cumiskey recently
> submitted a patch which does exactly that. Review and application pending...
>
>
>   
Huh, that would be the perfect solution ;-)

Best,

Tom



-- 

http://www.thomas-zastrow.de

German Forum - DTP under Linux:

http://www.opendtp.de



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-18 Thread Vincent Hennebert
Hi Thomas,

Thomas Zastrow a écrit :

> Sorry for that, but I'm not realy satisfied with the fonts which are
> implemented in the FOP, so I converted some of my most beloved free /
> OpenSource fonts. When the license of the font allows it, it would be
> nice to have something like an additional font pack wich could be simply
> downloaded and integrated into FOP. What do you think about this idea?

Hmmm, FOP does not really /implement/ any fonts. That's not the wording
I would use anyway.
For PDF and PS output, FOP uses the default base 14 PDF fonts (the
well-known Times, Helvetica, Courier plus Symbol and ZapfDingbats).
Those are the fonts that are guaranteed to be found on any system, so
which may be usable everywhere without any configuration. I perfectly
understand that you don't like those fonts because (1) they are missing
many (non-western) glyphs; (2) they are seen everywhere so we get tired
of them. But they work...
For AWT output FOP relies on the Java font system which to a certain
extent may use fonts installed on the system.

It's difficult to find fonts distributable with FOP. Many open-source
fonts have a license incompatible with the Apache license. And even if
that were possible that would not really make sense, users generally
just want to use the fonts they have on their systems.

We better try to discover the fonts installed on the system and
automatically configure them. Good news, Adrian Cumiskey recently
submitted a patch which does exactly that. Review and application pending...

Cheers,
Vincent


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-17 Thread Thomas Zastrow
Vincent Hennebert wrote:


>
>   
>>> OK, I added . to the fop.xconf. But the result is
>>> the same ... btw., I'm not sure which directory is meant with "."?
>>>   
>> Errm, if I'm correct then the "." is to be interpreted as relative to
>> the source document...
>> 
>
> Actually it corresponds to the working directory i.e., the directory
> from which you launch the command.
> Which is totally counter-intuitive... According to the URI
> specification, relative URIs inside the fop.xconf file should be
> resolved against the URI of the config file itself, which sounds pretty
> logical.
> This needs to be improved, but meanwhile the workaround is to use
> absolute URIs, as you did.
>   
I agree: for example, I got the FOP somwhere in /opt and symbolic links
from /usr/local/bin to it, my fonts are again in other locations
somewhere in the filesystem :-) - so, this is a little bit confusing and
a little bit complicated to write a good tutorial for adding fonts.

Sorry for that, but I'm not realy satisfied with the fonts which are
implemented in the FOP, so I converted some of my most beloved free /
OpenSource fonts. When the license of the font allows it, it would be
nice to have something like an additional font pack wich could be simply
downloaded and integrated into FOP. What do you think about this idea?

Best,

Tom


-- 

http://www.thomas-zastrow.de

German Forum - DTP under Linux:

http://www.opendtp.de



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-16 Thread Vincent Hennebert
Hi,

Andreas L Delmelle a écrit :
> On Apr 14, 2007, at 20:55, Thomas Zastrow wrote:
> 
>> Andreas L Delmelle wrote:
>>> On Apr 14, 2007, at 17:41, Thomas Zastrow wrote:
>>>
 
 The files LinLibertine.xml and LinLibertineU-Re-2.2.5.ttf are in the
 root-directory of the FOP (version 0.93). The base-tag in the
 config-file is untouched, it is still   .
>>>
>>> Keep in mind that they are influenced by . I /think/ both
>>> of them. At least, I hope so... :/

If  isn't specified,  is used. Otherwise it overrides
the value of .


>> OK, I added . to the fop.xconf. But the result is
>> the same ... btw., I'm not sure which directory is meant with "."?
> 
> Errm, if I'm correct then the "." is to be interpreted as relative to
> the source document...

Actually it corresponds to the working directory i.e., the directory
from which you launch the command.
Which is totally counter-intuitive... According to the URI
specification, relative URIs inside the fop.xconf file should be
resolved against the URI of the config file itself, which sounds pretty
logical.
This needs to be improved, but meanwhile the workaround is to use
absolute URIs, as you did.



HTH,
Vincent


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-14 Thread Andreas L Delmelle

On Apr 14, 2007, at 23:12, Thomas Zastrow wrote:


Andreas L Delmelle wrote:
In any case, now that you mention it, it does seem to lean towards  
bad

practice to use a relative url as base-url for anything... :/





I solved the "problem": I used absolute paths, which is - in my  
oppinion

- just a workaround :-)


Note that I don't mean that hardcoding absolute urls in (inherently  
relocatable) config files is such a good idea, but the fact alone  
that it made you ask the question what the "." points to seems to  
demonstrate that it is not in the interest of clarity to do so. :-)



Cheers,

Andreas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-14 Thread Thomas Zastrow
Andreas L Delmelle wrote:
> On Apr 14, 2007, at 20:55, Thomas Zastrow wrote:
>
>> Andreas L Delmelle wrote:
>>> On Apr 14, 2007, at 17:41, Thomas Zastrow wrote:
>>>
 
 The files LinLibertine.xml and LinLibertineU-Re-2.2.5.ttf are in the
 root-directory of the FOP (version 0.93). The base-tag in the
 config-file is untouched, it is still   .
>>>
>>> Keep in mind that they are influenced by . I /think/ both
>>> of them. At least, I hope so... :/
>>>
>> OK, I added . to the fop.xconf. But the result is
>> the same ... btw., I'm not sure which directory is meant with "."?
>
> Errm, if I'm correct then the "." is to be interpreted as relative to
> the source document...
> In any case, now that you mention it, it does seem to lean towards bad
> practice to use a relative url as base-url for anything... :/
>
>> Is it the conf-directory? Or the root-directory? I copied both the
>> metric xml
>> file and the ttf-file also to conf, but FOP still can't find them.
>>
>> Is conf/fop.xconf read by default or have I to specify it as
>> config-file?
>
> You have to specify it. The fop.xconf file contains the settings that
> are used by FOP if no config file is specified, but the file itself is
> not used unless you tell FOP to use it. If you leave it unchanged, and
> start FOP with "-c conf/fop.xconf", then the result is the same as if
> no config file has been used.
>
Andreas, again, thank you :-)

I solved the "problem": I used absolute paths, which is - in my oppinion
- just a workaround :-)

But now it works. Take a look at the "Using LinuxLibertine with the
Apache FOP" on my examples page:

http://www.thomas-zastrow.de/st/examples.php

Best,

Tom



-- 

http://www.thomas-zastrow.de

German Forum - DTP under Linux:

http://www.opendtp.de



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-14 Thread Andreas L Delmelle

On Apr 14, 2007, at 20:55, Thomas Zastrow wrote:


Andreas L Delmelle wrote:

On Apr 14, 2007, at 17:41, Thomas Zastrow wrote:



The files LinLibertine.xml and LinLibertineU-Re-2.2.5.ttf are in the
root-directory of the FOP (version 0.93). The base-tag in the
config-file is untouched, it is still   .


Keep in mind that they are influenced by . I /think/ both
of them. At least, I hope so... :/

OK, I added . to the fop.xconf. But the  
result is

the same ... btw., I'm not sure which directory is meant with "."?


Errm, if I'm correct then the "." is to be interpreted as relative to  
the source document...
In any case, now that you mention it, it does seem to lean towards  
bad practice to use a relative url as base-url for anything... :/


Is it the conf-directory? Or the root-directory? I copied both the  
metric xml

file and the ttf-file also to conf, but FOP still can't find them.

Is conf/fop.xconf read by default or have I to specify it as config- 
file?


You have to specify it. The fop.xconf file contains the settings that  
are used by FOP if no config file is specified, but the file itself  
is not used unless you tell FOP to use it. If you leave it unchanged,  
and start FOP with "-c conf/fop.xconf", then the result is the same  
as if no config file has been used.


Cheers,

Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-14 Thread Thomas Zastrow
Andreas L Delmelle wrote:
> On Apr 14, 2007, at 17:41, Thomas Zastrow wrote:
>
>> 
>> The files LinLibertine.xml and LinLibertineU-Re-2.2.5.ttf are in the
>> root-directory of the FOP (version 0.93). The base-tag in the
>> config-file is untouched, it is still   .
>
> Keep in mind that they are influenced by . I /think/ both
> of them. At least, I hope so... :/
>
OK, I added . to the fop.xconf. But the result is
the same ... btw., I'm not sure which directory is meant with "."? Is it
the conf-directory? Or the root-directory? I copied both the metric xml
file and the ttf-file also to conf, but FOP still can't find them.

Is conf/fop.xconf read by default or have I to specify it as config-file?

Best,

Tom



-- 

http://www.thomas-zastrow.de

German Forum - DTP under Linux:

http://www.opendtp.de



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with custom fonts

2007-04-14 Thread Andreas L Delmelle

On Apr 14, 2007, at 17:41, Thomas Zastrow wrote:



The files LinLibertine.xml and LinLibertineU-Re-2.2.5.ttf are in the
root-directory of the FOP (version 0.93). The base-tag in the
config-file is untouched, it is still   .


Keep in mind that they are influenced by . I /think/ both  
of them. At least, I hope so... :/



Cheers,

Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with custom fonts

2007-04-14 Thread Thomas Zastrow
Hi there,

I try to use another TTF font with the FOP. As described here:
http://xmlgraphics.apache.org/fop/0.93/fonts.html, I build the metric
file which seems to have worked without problems (LinLibertine.xml).
Now, I added the following to the font-section of conf/fop.xconf:


   


The files LinLibertine.xml and LinLibertineU-Re-2.2.5.ttf are in the
root-directory of the FOP (version 0.93). The base-tag in the
config-file is untouched, it is still   .

But when trying to use the font LinLibertine, I got the error:

14.04.2007 17:36:15 org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNUNG: Font 'LinLibertine,normal,400' not found. Substituting with
'any,normal,400'.
Process ended with exit code: 0

I think, I have to put the fonts somewhere else?

Thanks!

Tom


-- 

http://www.thomas-zastrow.de

German Forum - DTP under Linux:

http://www.opendtp.de



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]