[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-user
Subject:    Re: Configure fonts for FOP
From:       Fernando Israel <kognoz () gmail ! com>
Date:       2011-07-30 12:06:12
Message-ID: CAEnZ3MUsL+xhyBX48PUuQHbzOWerx8GKbGfdhGB8PZC+uTxK6g () mail ! gmail ! com
[Download RAW message or body]

Thanks Mehdi
You've been a great help
Regards
Fernando
On Jul 30, 2011 5:04 AM, "mehdi houshmand" <med1985@gmail.com> wrote:
> Hi Fernando,
>
> Yes, if you've got the fonts configured correctly, then FOP does embed
> a subset of the font within the PDF. If the fonts aren't configured
> properly, FOP outputs error messages indicating as such.
>
> Hope that helps
>
> Mehdi
>
> On 30 July 2011 01:00, Fernando Israel <fernando.israel@kognoz.com> wrote:
>> Hi Mehdi,
>>
>> I have followed your instructions and it works like a charm. Thank you !
>>
>> I have taken the <auto-detect> out of the configuration and it picks the
>> fonts from the directory specified so I guess it is doing what I expect
>> which is only to include the fonts in the configured directory.
>>
>> Regarding the embedding of the fonts with the PDF, I've checked and the
>> fonts are there with the target. Since I haven't told FOP anything about
>> embedding the fonts, all it has is a directory with TTF files, I assume
that
>> the default behaviour is to embbed the fonts - it has the TTF files so it
>> can do that I believe. Can you confirm this is the case ?.
>>
>> Thank you very much for your help !!!
>>
>> Regards,
>> Fernando
>>
>>
>> On Fri, Jul 29, 2011 at 7:59 AM, mehdi houshmand <med1985@gmail.com>
wrote:
>>>
>>> Hi Fernando,
>>>
>>> If you open the example in conf/fop.xconf, you'll see an example has
>>> been created (but commented out) for Arial. That is where you need to
>>> declare the font.
>>>
>>> I personally don't use the <auto-detect> feature, so I won't be able
>>> to help you there. But I'd suggest that you create a definition in the
>>> config file for each font individually, like the example for arial,
>>> the "embed-url" property let's FOP know the URL of the font file. That
>>> way if a specific font doesn't work, you can easily analyse why.
>>>
>>> As for taking TTF files from a Windows box to a Linux box, that should
>>> work fine. I don't know if that's breaking any licensing issues or the
>>> legality, but TTFs are platform independent. You may however have
>>> issues if there are any spaces in the directory or file names.
>>>
>>> Hope that helps
>>>
>>> Mehdi
>>>
>>> On 28 July 2011 12:40, Fernando Israel <fernando.israel@kognoz.com>
wrote:
>>> > Hi Mehdi,
>>> >
>>> > Thank you very much for your response. It is helping me a lot.
>>> >
>>> > I've seen the document on fonts you suggest but your input helps me to
>>> > interpret it better.
>>> >
>>> > So what you suggest is that I just stick all the necessary font files
>>> > TTF or
>>> > TTC in a directory and direct FOP to use these fonts via the
>>> > configuration
>>> > file using the <directory> element to specify that directory. Good !.
>>> >
>>> > Since I am only using the PDF renderer I will have an entry in the
>>> > config
>>> > file for it only. I will stick there the <directory> element with the
>>> > name
>>> > of the directory where I put all the necessary fonts.
>>> >
>>> > 1. What should I do with the <auto-detect> element ?. I would like to
>>> > force
>>> > FOP to use only the fonts in the specified directory so shall I remove
>>> > the
>>> > <auto-detect> ?
>>> > 2. Using this approach will the fonts be embbeded automatically in the
>>> > target (a PDF) ?
>>> > 3. For testing purposes, can I take the TTF files from a Windows OS
and
>>> > stick them on directory on a Linux box where the server (with FOP)
runs
>>> > ?.
>>> > Will that work ?.
>>> >
>>> > Thanks again for your help !
>>> >
>>> > Regards,
>>> > Fernando
>>> >
>>> >
>>> >
>>> > On Thu, Jul 28, 2011 at 3:45 AM, mehdi houshmand <med1985@gmail.com>
>>> > wrote:
>>> >>
>>> >> Hi Fernando,
>>> >>
>>> >> I'll address each question individually:
>>> >>
>>> >>
>>> >> On 27 July 2011 23:29, Fernando Israel <fernando.israel@kognoz.com>
>>> >> wrote:
>>> >> > Hi All,
>>> >> >
>>> >> > I know this is a recurring issue but going through the
documentation
>>> >> > and
>>> >> > forum listings I am still no clear but I hope I know what to ask.
>>> >> </snip>
>>> >>
>>> >> > The questions I have (and pardon my ignorance but fonts is not my
>>> >> > subject)
>>> >> > are:
>>> >> > 1. What type of font files do I have to package ? TTF, TTC .. ?.
>>> >>
>>> >> If you're producing PDF you can use either TTF or TTC.
>>> >>
>>> >> > 2. Once I create the jar file if I put it in the same directory as
>>> >> > fop.jar I
>>> >> > guess FOP will find it, right ?.
>>> >>
>>> >> http://xmlgraphics.apache.org/fop/1.0/fonts.html should help you
>>> >> configure the fonts appropriately. The font metrics files are
>>> >> deprecated, so no need for that, but you will have to configure the
>>> >> fop.xconf to let FOP know the directory of the font file.
>>> >>
>>> >> > 3. If I go this route, do I have to tell FOP anything else (for
>>> >> > instance
>>> >> > in
>>> >> > the configuration file) ?
>>> >>
>>> >> See the link above.
>>> >>
>>> >> > 4. Does FOP always looks first in the classpath for fonts ?
>>> >>
>>> >> No, if FOP isn't explicitly given the font configuration, it looks in
>>> >> the System fonts, which are, as the name suggests, OS dependent. I
>>> >> don't think putting the font in the classpath makes the slightest bit
>>> >> of difference, FOP still won't have a font-name and so no way to link
>>> >> the font to a font-family in the FO.
>>> >>
>>> >>
>>> >> Hope that helps, there is also an example config file in <fop
>>> >> directory>/conf/fop.xconf, which should help you get started
>>> >>
>>> >> Mehdi
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>>> >> For additional commands, e-mail:
fop-users-help@xmlgraphics.apache.org
>>> >>
>>> >
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>

[Attachment #3 (text/html)]

<p>Thanks Mehdi<br>
 You&#39;ve been a great help<br>
Regards<br>
Fernando </p>
<div class="gmail_quote">On Jul 30, 2011 5:04 AM, &quot;mehdi houshmand&quot; &lt;<a \
href="mailto:med1985@gmail.com">med1985@gmail.com</a>&gt; wrote:<br \
type="attribution">&gt; Hi Fernando,<br>&gt; <br>&gt; Yes, if you&#39;ve got the \
fonts configured correctly, then FOP does embed<br> &gt; a subset of the font within \
the PDF. If the fonts aren&#39;t configured<br>&gt; properly, FOP outputs error \
messages indicating as such.<br>&gt; <br>&gt; Hope that helps<br>&gt; <br>&gt; \
Mehdi<br>&gt; <br>&gt; On 30 July 2011 01:00, Fernando Israel &lt;<a \
href="mailto:fernando.israel@kognoz.com">fernando.israel@kognoz.com</a>&gt; \
wrote:<br> &gt;&gt; Hi Mehdi,<br>&gt;&gt;<br>&gt;&gt; I have followed your \
instructions and it works like a charm. Thank you !<br>&gt;&gt;<br>&gt;&gt; I have \
taken the &lt;auto-detect&gt; out of the configuration and it picks the<br> &gt;&gt; \
fonts from the directory specified so I guess it is doing what I expect<br>&gt;&gt; \
which is only to include the fonts in the configured \
directory.<br>&gt;&gt;<br>&gt;&gt; Regarding the embedding of the fonts with the PDF, \
I&#39;ve checked and the<br> &gt;&gt; fonts are there with the target. Since I \
haven&#39;t told FOP anything about<br>&gt;&gt; embedding the fonts, all it has is a \
directory with TTF files, I assume that<br>&gt;&gt; the default behaviour is to \
embbed the fonts - it has the TTF files so it<br> &gt;&gt; can do that I believe. Can \
you confirm this is the case ?.<br>&gt;&gt;<br>&gt;&gt; Thank you very much for your \
help !!!<br>&gt;&gt;<br>&gt;&gt; Regards,<br>&gt;&gt; \
Fernando<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; On Fri, Jul 29, 2011 at 7:59 AM, mehdi \
houshmand &lt;<a href="mailto:med1985@gmail.com">med1985@gmail.com</a>&gt; wrote:<br> \
&gt;&gt;&gt;<br>&gt;&gt;&gt; Hi Fernando,<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; If you open \
the example in conf/fop.xconf, you&#39;ll see an example has<br>&gt;&gt;&gt; been \
created (but commented out) for Arial. That is where you need to<br> &gt;&gt;&gt; \
declare the font.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I personally don&#39;t use the \
&lt;auto-detect&gt; feature, so I won&#39;t be able<br>&gt;&gt;&gt; to help you \
there. But I&#39;d suggest that you create a definition in the<br> &gt;&gt;&gt; \
config file for each font individually, like the example for arial,<br>&gt;&gt;&gt; \
the &quot;embed-url&quot; property let&#39;s FOP know the URL of the font file. \
That<br>&gt;&gt;&gt; way if a specific font doesn&#39;t work, you can easily analyse \
why.<br> &gt;&gt;&gt;<br>&gt;&gt;&gt; As for taking TTF files from a Windows box to a \
Linux box, that should<br>&gt;&gt;&gt; work fine. I don&#39;t know if that&#39;s \
breaking any licensing issues or the<br>&gt;&gt;&gt; legality, but TTFs are platform \
independent. You may however have<br> &gt;&gt;&gt; issues if there are any spaces in \
the directory or file names.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Hope that \
helps<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Mehdi<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On 28 \
July 2011 12:40, Fernando Israel &lt;<a \
href="mailto:fernando.israel@kognoz.com">fernando.israel@kognoz.com</a>&gt; \
wrote:<br> &gt;&gt;&gt; &gt; Hi Mehdi,<br>&gt;&gt;&gt; &gt;<br>&gt;&gt;&gt; &gt; \
Thank you very much for your response. It is helping me a lot.<br>&gt;&gt;&gt; \
&gt;<br>&gt;&gt;&gt; &gt; I&#39;ve seen the document on fonts you suggest but your \
input helps me to<br> &gt;&gt;&gt; &gt; interpret it better.<br>&gt;&gt;&gt; \
&gt;<br>&gt;&gt;&gt; &gt; So what you suggest is that I just stick all the necessary \
font files<br>&gt;&gt;&gt; &gt; TTF or<br>&gt;&gt;&gt; &gt; TTC in a directory and \
direct FOP to use these fonts via the<br> &gt;&gt;&gt; &gt; \
configuration<br>&gt;&gt;&gt; &gt; file using the &lt;directory&gt; element to \
specify that directory. Good !.<br>&gt;&gt;&gt; &gt;<br>&gt;&gt;&gt; &gt; Since I am \
only using the PDF renderer I will have an entry in the<br> &gt;&gt;&gt; &gt; \
config<br>&gt;&gt;&gt; &gt; file for it only. I will stick there the \
&lt;directory&gt; element with the<br>&gt;&gt;&gt; &gt; name<br>&gt;&gt;&gt; &gt; of \
the directory where I put all the necessary fonts.<br> &gt;&gt;&gt; \
&gt;<br>&gt;&gt;&gt; &gt; 1. What should I do with the &lt;auto-detect&gt; element ?. \
I would like to<br>&gt;&gt;&gt; &gt; force<br>&gt;&gt;&gt; &gt; FOP to use only the \
fonts in the specified directory so shall I remove<br> &gt;&gt;&gt; &gt; \
the<br>&gt;&gt;&gt; &gt; &lt;auto-detect&gt; ?<br>&gt;&gt;&gt; &gt; 2. Using this \
approach will the fonts be embbeded automatically in the<br>&gt;&gt;&gt; &gt; target \
(a PDF) ?<br>&gt;&gt;&gt; &gt; 3. For testing purposes, can I take the TTF files from \
a Windows OS and<br> &gt;&gt;&gt; &gt; stick them on directory on a Linux box where \
the server (with FOP) runs<br>&gt;&gt;&gt; &gt; ?.<br>&gt;&gt;&gt; &gt; Will that \
work ?.<br>&gt;&gt;&gt; &gt;<br>&gt;&gt;&gt; &gt; Thanks again for your help !<br> \
&gt;&gt;&gt; &gt;<br>&gt;&gt;&gt; &gt; Regards,<br>&gt;&gt;&gt; &gt; \
Fernando<br>&gt;&gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;<br>&gt;&gt;&gt; \
&gt;<br>&gt;&gt;&gt; &gt; On Thu, Jul 28, 2011 at 3:45 AM, mehdi houshmand &lt;<a \
href="mailto:med1985@gmail.com">med1985@gmail.com</a>&gt;<br> &gt;&gt;&gt; &gt; \
wrote:<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; Hi Fernando,<br>&gt;&gt;&gt; \
&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; I&#39;ll address each question \
individually:<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt;<br> &gt;&gt;&gt; \
&gt;&gt; On 27 July 2011 23:29, Fernando Israel &lt;<a \
href="mailto:fernando.israel@kognoz.com">fernando.israel@kognoz.com</a>&gt;<br>&gt;&gt;&gt; \
&gt;&gt; wrote:<br>&gt;&gt;&gt; &gt;&gt; &gt; Hi All,<br>&gt;&gt;&gt; &gt;&gt; \
&gt;<br> &gt;&gt;&gt; &gt;&gt; &gt; I know this is a recurring issue but going \
through the documentation<br>&gt;&gt;&gt; &gt;&gt; &gt; and<br>&gt;&gt;&gt; &gt;&gt; \
&gt; forum listings I am still no clear but I hope I know what to ask.<br> \
&gt;&gt;&gt; &gt;&gt; &lt;/snip&gt;<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; \
&gt; The questions I have (and pardon my ignorance but fonts is not \
my<br>&gt;&gt;&gt; &gt;&gt; &gt; subject)<br>&gt;&gt;&gt; &gt;&gt; &gt; are:<br> \
&gt;&gt;&gt; &gt;&gt; &gt; 1. What type of font files do I have to package ? TTF, TTC \
.. ?.<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; If you&#39;re producing PDF \
you can use either TTF or TTC.<br>&gt;&gt;&gt; &gt;&gt;<br> &gt;&gt;&gt; &gt;&gt; \
&gt; 2. Once I create the jar file if I put it in the same directory \
as<br>&gt;&gt;&gt; &gt;&gt; &gt; fop.jar I<br>&gt;&gt;&gt; &gt;&gt; &gt; guess FOP \
will find it, right ?.<br>&gt;&gt;&gt; &gt;&gt;<br> &gt;&gt;&gt; &gt;&gt; <a \
href="http://xmlgraphics.apache.org/fop/1.0/fonts.html">http://xmlgraphics.apache.org/fop/1.0/fonts.html</a> \
should help you<br>&gt;&gt;&gt; &gt;&gt; configure the fonts appropriately. The font \
metrics files are<br> &gt;&gt;&gt; &gt;&gt; deprecated, so no need for that, but you \
will have to configure the<br>&gt;&gt;&gt; &gt;&gt; fop.xconf to let FOP know the \
directory of the font file.<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt; 3. \
If I go this route, do I have to tell FOP anything else (for<br> &gt;&gt;&gt; \
&gt;&gt; &gt; instance<br>&gt;&gt;&gt; &gt;&gt; &gt; in<br>&gt;&gt;&gt; &gt;&gt; &gt; \
the configuration file) ?<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; See the \
link above.<br>&gt;&gt;&gt; &gt;&gt;<br> &gt;&gt;&gt; &gt;&gt; &gt; 4. Does FOP \
always looks first in the classpath for fonts ?<br>&gt;&gt;&gt; \
&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; No, if FOP isn&#39;t explicitly given the font \
configuration, it looks in<br>&gt;&gt;&gt; &gt;&gt; the System fonts, which are, as \
the name suggests, OS dependent. I<br> &gt;&gt;&gt; &gt;&gt; don&#39;t think putting \
the font in the classpath makes the slightest bit<br>&gt;&gt;&gt; &gt;&gt; of \
difference, FOP still won&#39;t have a font-name and so no way to \
link<br>&gt;&gt;&gt; &gt;&gt; the font to a font-family in the FO.<br> &gt;&gt;&gt; \
&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; Hope that helps, there is \
also an example config file in &lt;fop<br>&gt;&gt;&gt; &gt;&gt; \
directory&gt;/conf/fop.xconf, which should help you get started<br> &gt;&gt;&gt; \
&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; Mehdi<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; \
&gt;&gt; ---------------------------------------------------------------------<br>&gt;&gt;&gt; \
&gt;&gt; To unsubscribe, e-mail: <a \
href="mailto:fop-users-unsubscribe@xmlgraphics.apache.org">fop-users-unsubscribe@xmlgraphics.apache.org</a><br>
 &gt;&gt;&gt; &gt;&gt; For additional commands, e-mail: <a \
href="mailto:fop-users-help@xmlgraphics.apache.org">fop-users-help@xmlgraphics.apache.org</a><br>&gt;&gt;&gt; \
&gt;&gt;<br>&gt;&gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;<br> &gt;&gt;&gt;<br>&gt;&gt;&gt; \
---------------------------------------------------------------------<br>&gt;&gt;&gt; \
To unsubscribe, e-mail: <a \
href="mailto:fop-users-unsubscribe@xmlgraphics.apache.org">fop-users-unsubscribe@xmlgraphics.apache.org</a><br>
 &gt;&gt;&gt; For additional commands, e-mail: <a \
href="mailto:fop-users-help@xmlgraphics.apache.org">fop-users-help@xmlgraphics.apache.org</a><br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt; \
<br>&gt; ---------------------------------------------------------------------<br> \
&gt; To unsubscribe, e-mail: <a \
href="mailto:fop-users-unsubscribe@xmlgraphics.apache.org">fop-users-unsubscribe@xmlgraphics.apache.org</a><br>&gt; \
For additional commands, e-mail: <a \
href="mailto:fop-users-help@xmlgraphics.apache.org">fop-users-help@xmlgraphics.apache.org</a><br>
 &gt; <br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic