Sun

12

Mar

2006

PDF Fonts in Joomla 1.5

The new pdf generator can handle utf-8 text sources. This requires using suitable Unicode fonts. The font files are actually in postscript form with a php file for lookup references. There are not too many postscript free fonts out there so the solution is to convert Truetype Unicode fonts to the format needed for the pdf generator. This raises some dilemmas:
  • There is no single pan-Unicode font that has all glyphs
  • Anything that gets close to it is very large - 400k or so and this gets embedded in the pdf
  • Some info regarding the fonts:
  • A font that covers Latin and extended Latin might be about 40k
  • A Latin font (like above) that also includes Cyrillic and Greek might be about 130K which is about the reasonable size limit
  • We can say that a regional font (Middle East, Indic, Far East CJK, Far East Other, etc.) would be manageable size wise.
  • There are many many fonts for single language glyphs with many resources available (see below)
  • We have implemented a solution that allows the language packs to define which pdf font file set should be used with the language. The pdf font files can optionally be included in the language pack and will be installed together with the language. Details of the solution:
  • The Vera font (see specifications below) is installed with the eng_GB language pack and will be shipped already installed and selected
  • Selection of a pdf font file set is via a new metadata tag in the language.xml file
  • English (GB) eng_GB 0 eng_GB, en_GB, en, english, english-uk, uk, Vera
  • A pdf_fonts folder has been added under the site language folder. Additional pdf font file sets can be loaded manually into this folder. To use the font, the metadata tag in the language.xml needs to be edited.
  • Alternately additional fonts can be automatically loaded when the language pack is installed
  • To include pdf font file sets with the language packs the font files need to be included in the zip file and the language.xml file needs to have the following tags added after the ini files
  • Cyberbas.php Cyberbas.z Cyberbas.ctg.z
  • Several "Regional" font file sets (specificaitons below) willl be made available to translation teams to include in their respective language packs as they choose
  • Tools to convert Truetype Unicode fonts to suitable font file sets have been included in the svn under the tcpdf library in a tools folder (instructions included)
  • 0 Votes

    7 Comments

    Feed
    1. :mrgreen:
      Wasn't there a time when PDF was going to be removed from Joomla?
      Great job!
      Missing: the regional font file sets specifications and the ressources you mention at the beginning (fonts for single language glyphs)...
      Thanks for this update.
    2. I have a number of clients that will be thrilled to see that PDF still has support in future Joomla! releases!!

      Thanks -- keep up the awesome work.

      route101
    3. I agree with eyezberg and route101. It is great to see that support for PDF will be continued!
    4. I think it's great to keep the PDF options, too... I'm curious if it will also insert graphic elements into the PDF instead of just the text?
    5. Is there no way to determine which subset of characters given document uses and then choose aplicable version of font for .pdf file?
    6. @Roman Blanty

      The PDF file is part of the language pack. If several language packs are installed the pdf file that is used corresponds with the selected UI language. The language pack authors need to ensure that the attached pdf files cover all characters of the language. It is possible to have common pdf files.
    7. Good Site! Thanks!

    Add Comment


      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)