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 Tobias Luikard <T....@exxcellent.de> on 2010/11/16 16:24:08 UTC

Filesize and embedded fonts

  Hi everybody,

since several years I use fop to produce PDFs. Now the request was to 
produce PDF/A documents. So I embedded all fonts necessary for the 
productions of the PDF.

After some test and some errors I was able to produce PDF/A complient 
documents (at least FOP didn't throw any exceptions any more). But the 
problem is, that the size of the files increased 10 times (from 25,3 kB 
to 248 kB).

The fonts where embedded as True Type fonts in the fop.xml
<fonts>
<font embed-url="XXFont.ttf" kerning="yes" metrics-url="XXFont.xml">
<font-triplet name="XX" style="normal" weight="normal" />
</font>
          ...
</fonts>

I tried to convert the file with Acrobat. There the file size has grown 
but not that much. Does anyone have any suggestion how to reduce the 
file size? Do I make any errors when I include the fonts?

The mass of file we have to put into the archive will be a problem when 
the file will be 1/4 MB of size...

Thanks

Tobi

P.S. I'm using FOP 1.0, JDK 1.6.0_13 and Windows Vista....


-- 
  Tobias Luikard

___ |X__________________________________________________________
   X|




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


Re: Filesize and embedded fonts

Posted by TvT <tv...@nepatec.de>.
Hi Lui,

(in PDF) there is the possibility to subset a font - thus to only
include a subset of the font which you need.
Read here:
http://desktoppub.about.com/od/pdf/f/subsetfonts.htm

What you can do in FOP is described here:
http://xmlgraphics.apache.org/fop/1.0/fonts.html

There is a paragraph about 'Embedding' fonts and also a small part
about subsetting.
You are using TrueType Fonts?
"When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a
subset of the original font, containing only the glyphs used, is
embedded in the output document."

Check in the Acrobat Reader under File\Properties\Fonts that there are
only subsets of Fonts. If not try to change your font format. If the
subsetting worked then it will be difficult with plain FOP to reduce
the file size. Then you probably have to use a third party tool to
reduce the file size...

Regards,
ToM

PS:
One other thing, is there a special reason you are still using font
metric files? Since 0.95 this is usually not necessary anymore.

"In earlier FOP versions, it was always necessary to create an XML
font metrics file if you wanted to add a custom font. This
unconvenient step has been removed and in addition to that, FOP
supports auto-registration of fonts, i.e. FOP can find fonts installed
in your operating system or can scan user-specified directories for
fonts. Font registration via XML font metrics file is still supported
and may still be necessary for some very special cases as fallback
variant while we stabilize font auto-detection."





2010/11/16 Tobias Luikard <T....@exxcellent.de>:
>  Hi everybody,
>
> since several years I use fop to produce PDFs. Now the request was to
> produce PDF/A documents. So I embedded all fonts necessary for the
> productions of the PDF.
>
> After some test and some errors I was able to produce PDF/A complient
> documents (at least FOP didn't throw any exceptions any more). But the
> problem is, that the size of the files increased 10 times (from 25,3 kB to
> 248 kB).
>
> The fonts where embedded as True Type fonts in the fop.xml
> <fonts>
> <font embed-url="XXFont.ttf" kerning="yes" metrics-url="XXFont.xml">
> <font-triplet name="XX" style="normal" weight="normal" />
> </font>
>         ...
> </fonts>
>
> I tried to convert the file with Acrobat. There the file size has grown but
> not that much. Does anyone have any suggestion how to reduce the file size?
> Do I make any errors when I include the fonts?
>
> The mass of file we have to put into the archive will be a problem when the
> file will be 1/4 MB of size...
>
> Thanks
>
> Tobi
>
> P.S. I'm using FOP 1.0, JDK 1.6.0_13 and Windows Vista....
>
>
> --
>  Tobias Luikard

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