Melih Ovadya | 1 Sep 2005 01:49
Favicon

RE: creating a PDF document containing UTF-8 characters

Thank you Jeremias, I followed the instructions and now I can make it work
by embedding the font in the document.

Looking at the samples in userconfig.xml, this is how I register the fonts:
<font metrics-file="ttfarialuni.xml"
embed-file="C:\WINDOWS\Fonts\ArialUni.ttf" kerning="yes">
    <font-triplet name="ArialUni" style="normal" weight="normal"/>
    <font-triplet name="ArialUni" style="normal" weight="bold"/>
    <font-triplet name="ArialUni" style="italic" weight="normal"/>
    <font-triplet name="ArialUni" style="italic" weight="bold"/>
   </font>

</fonts>

What happens if I omit the embed-file tag? After the PDF is created, on the
client machine, how will it find the right font to display the characters in
that case? With this flag, does FO include whole font in the PDF, or just a
subset to be able to display the Unicode characters?

Regards,
melih
Daniel Noll | 1 Sep 2005 06:25
Picon

Re: creating a PDF document containing UTF-8 characters

Melih Ovadya wrote:

>Thank you Jeremias, I followed the instructions and now I can make it work
>by embedding the font in the document.
>
>Looking at the samples in userconfig.xml, this is how I register the fonts:
><font metrics-file="ttfarialuni.xml"
>embed-file="C:\WINDOWS\Fonts\ArialUni.ttf" kerning="yes">
>    <font-triplet name="ArialUni" style="normal" weight="normal"/>
>    <font-triplet name="ArialUni" style="normal" weight="bold"/>
>    <font-triplet name="ArialUni" style="italic" weight="normal"/>
>    <font-triplet name="ArialUni" style="italic" weight="bold"/>
>   </font>
>
></fonts>
>
>What happens if I omit the embed-file tag? After the PDF is created, on the
>client machine, how will it find the right font to display the characters in
>that case?
>
You will see # symbols for every character that couldn't be mapped to a 
known font. The # characters are actually generated into the PDF (as far 
as I can tell... because every PDF viewer showed the same placeholder 
character.)

> With this flag, does FO include whole font in the PDF, or just a
>subset to be able to display the Unicode characters?
>  
>
Half way between those two. It will embed enough of the font to display 
(Continue reading)

Jeremias Maerki | 1 Sep 2005 08:48
Picon
Favicon

Re: creating a PDF document containing UTF-8 characters


On 01.09.2005 06:25:54 Daniel Noll wrote:
> Melih Ovadya wrote:
> 
> >Thank you Jeremias, I followed the instructions and now I can make it work
> >by embedding the font in the document.
> >
> >Looking at the samples in userconfig.xml, this is how I register the fonts:
> ><font metrics-file="ttfarialuni.xml"
> >embed-file="C:\WINDOWS\Fonts\ArialUni.ttf" kerning="yes">
> >    <font-triplet name="ArialUni" style="normal" weight="normal"/>
> >    <font-triplet name="ArialUni" style="normal" weight="bold"/>
> >    <font-triplet name="ArialUni" style="italic" weight="normal"/>
> >    <font-triplet name="ArialUni" style="italic" weight="bold"/>
> >   </font>
> >
> ></fonts>
> >
> >What happens if I omit the embed-file tag? After the PDF is created, on the
> >client machine, how will it find the right font to display the characters in
> >that case?
> >
> You will see # symbols for every character that couldn't be mapped to a 
> known font. The # characters are actually generated into the PDF (as far 
> as I can tell... because every PDF viewer showed the same placeholder 
> character.)

Actually, omitting the embed-file tag will result in Acrobat Reader
complaining about not finding the font. FOP is not able to handle this
properly, yet.
(Continue reading)

Daniel Noll | 1 Sep 2005 09:33
Picon

Re: creating a PDF document containing UTF-8 characters

Jeremias Maerki wrote:

>It's more an issue with FOP in my opinion. So let's hope for you two
>that someone will eventually add this missing feature. Did I say that
>the source code of FOP is available? :-)
>
>  
>
So there is a feature in PDF to store the actual content as UTF-8 without the font embedded, and to tell the PDF
viewer to use whatever fonts it can find to render the document?  Because that's what we really need to solve
the problem.

Particularly in our system, we can't guarantee that the person generating the PDF has the same fonts as the
person reading it.  And worse, we can't even guarantee that the person generating it has ARIALUNI.TTF (as
it's not freely redistributable.)  So embedding fonts in any fashion doesn't solve the problem, and
neither does font substitution at the time of generation.

I was thinking that the lack of font substitution at the time of rendering was more of an issue with PDF, but if
you say it's an issue with FOP then I'll take your word for it because I don't know PDF well at all, just its
damage to society. :-)

Daniel

--

-- 
Daniel Noll

NUIX Pty Ltd
Level 8, 143 York Street, Sydney 2000
Phone: (02) 9283 9010
Fax:   (02) 9283 9020
(Continue reading)

Jeremias Maerki | 1 Sep 2005 09:48
Picon
Favicon

Re: creating a PDF document containing UTF-8 characters


On 01.09.2005 09:33:06 Daniel Noll wrote:
> Jeremias Maerki wrote:
> 
> >It's more an issue with FOP in my opinion. So let's hope for you two
> >that someone will eventually add this missing feature. Did I say that
> >the source code of FOP is available? :-)
> >
> >  
> >
> So there is a feature in PDF to store the actual content as UTF-8
> without the font embedded, and to tell the PDF viewer to use whatever
> fonts it can find to render the document?  Because that's what we
> really need to solve the problem.

I know that Acrobat can replace non-embedded Type1 fonts so I believe it
should be possible for TrueType, too. FOP is probably not even far from
supporting that. It's probably only about a few details, but then I'm
not the specialist on TrueType fonts in PDF. I'd have to dive in a lot
further to make a really usable statement in this regard.

But! I don't know how far this font substitution goes. Using "whatever
fonts it can find" is probably stretching the reality considerably. I
think there are some standard to do font substitution but I have never
worked with them.

> Particularly in our system, we can't guarantee that the person
> generating the PDF has the same fonts as the person reading it.  And
> worse, we can't even guarantee that the person generating it has
> ARIALUNI.TTF (as it's not freely redistributable.)  So embedding fonts
(Continue reading)

J.Pietschmann | 1 Sep 2005 23:39
Picon
Favicon

Re: creating a PDF document containing UTF-8 characters

Melih Ovadya wrote:
> What happens if I omit the embed-file tag? After the PDF is created, on the
> client machine, how will it find the right font to display the characters in
> that case?

It wont find anything. Referencing non-standard fonts is broken
in FOP 0.20.5, you'll have to use embedding.

> With this flag, does FO include whole font in the PDF, or just a
> subset to be able to display the Unicode characters?

It includes basically the whole file. Yes, this sucks.

J.PIetschmann
fdbt dbt | 2 Sep 2005 11:59
Picon
Favicon

tabular text reports with width specified by number of characters

Hi,

I'm trying to create text report containing tabular
data using FOP.
Is it possible to specify the width of table column in
terms of number of characters rather than 'mm'?

e.g. <fo:table-column column-width="100mm"/>
to be replaced by 
<fo:table-column column-width="10 char"/> of that sort

Regards,
fd.

		
__________________________________ 
Yahoo! Mail for Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 
Manuel Mall | 2 Sep 2005 12:10
Picon

Re: tabular text reports with width specified by number of characters

If you use a non proportional font the width of the characters is fixed 
and depends on the font size only. For example if you use a non 
proportional font whose character width is 80% of their height in all 
its font sizes you can use something like "10*0.8em" as a column-width 
specification.

If you use a proportional font you can only approximate the actual width 
of n characters by making an assumption on the average width of the 
characters used.

Manuel

On Fri, 2 Sep 2005 05:59 pm, fdbt dbt wrote:
> Hi,
>
> I'm trying to create text report containing tabular
> data using FOP.
> Is it possible to specify the width of table column in
> terms of number of characters rather than 'mm'?
>
> e.g. <fo:table-column column-width="100mm"/>
> to be replaced by
> <fo:table-column column-width="10 char"/> of that sort
>
>
> Regards,
> fd.
>
>
>
(Continue reading)

Jukka Ignatius | 2 Sep 2005 16:35
Picon
Favicon

fo:basic-link over an fo:leader

Hi there!

First of all, it was cool to see the updated comliance page, and to
notice, that the trunk supports the long awaited keeps, orphans and
widows! (Well at least we're waiting for them :)

But at the moment i'm still using 0.20.5, and i'm having trouble
creating links in my PDF's TOC. The generated fo for one TOC item is as
follows: 

<fo:list-item>
  <fo:list-item-label start-indent="0.5cm" end-indent="label-end()">
    <fo:block font-family="Times" font-size="10pt">1 </fo:block>
  </fo:list-item-label>
  <fo:list-item-body start-indent="1.5cm">
    <fo:block font-family="Times" font-size="10pt"
text-align-last="justify">
      <fo:basic-link color="blue" internal-destination="N131081-1">
        Installation
        <fo:leader leader-pattern="dots" 
          leader-pattern-width="5pt" 
          leader-alignment="reference-area"
        />
        <fo:page-number-citation ref-id="N131081-1"/>
      </fo:basic-link>
    </fo:block>
  </fo:list-item-body>
</fo:list-item>

The output renders totally correctly (the whole row is e.g. blue and
(Continue reading)

J.Pietschmann | 2 Sep 2005 23:17
Picon
Favicon

Re: fo:basic-link over an fo:leader

Jukka Ignatius wrote:
> But the links work only approx. on the following area:
> 
> 1  Installation . . . . . . . . . . . . . . . . . . . . 2
>    ^^^^^^^^^^^^^^^

Neither leaders nor page number citations (as well as a few other FO)
generate hot spot areas in FOP 0.20.5. There isn't much you can do
about this.

J.Pietschmann

Gmane