PDF fonts for central eupean languages

A place to discuss Joomla! translation matters.

Moderator: wendhausen

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

PDF fonts for central eupean languages

Post by H13 » Fri Feb 09, 2007 11:59 am

This is an instruction how to create PDF document with Latin 2 characters under Joomla! 1.5  (I have tried only CZECH language, but I think, other central European languages - Czech, Slovak, Croatian, Slovenian, ... - will work too)

1. Create new ufm file e.g. freemono - ttf2ufm -a -F freemono.ttf - you need ttf2ufm.exe in joomla/libraries/tcpdf/tools
2. Attention - ttf2ufm.exe creates ufm file with error: Character "Ċ" instead of "č". You need to edit this ufm file:

Change this code from:
U 266 ; WX 600 ; N Cdotaccent ; G 204 ;
U 269 ; WX 600 ; N ccaron ; G 207 ;


to:
U 266 ; WX 600 ; N Cdotaccent ; G 207 ;
U 269 ; WX 600 ; N ccaron ; G 204 ;


(Changing values: Cdotaccent -> ccaron, ccaron -> Cdotaccent - you must change G values and WX values too, if they are different)
It is only example. Some ufm files doesn't contain "Cdotaccent" but only "Cdot". If you need "Ċ", don't do this change (Thanks karol.cejka for his advice)

At the end, you create freemono.php , freemono.z, freemono.ctg.z: php -q makefontuni.php freemono.ttf freemono.ufm - you need makefontuni.php in joomla/libraries/tcpdf/tools
and you copy this files (freemono.php , freemono.z, freemono.ctg.z) to joomla/language/pdf_fonts/

Don't forget to change your language xml file (e.g cs-CZ.xml in joomla/language/cs-CZ/):

Code: Select all

<pdfFontName>freemono</pdfFontName>
And it should work.  :P
You do not have the required permissions to view the files attached to this post.
Last edited by H13 on Fri Feb 09, 2007 7:29 pm, edited 1 time in total.
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Fri Feb 09, 2007 1:41 pm

Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Fri Feb 09, 2007 1:52 pm

infograf768 wrote: Thanks H13,
Please have alook here
http://forge.joomla.org/sf/frs/do/viewR ... .pdf_fonts
I don't understand. There are fonts, they don't support latin 2 languages?
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Fri Feb 09, 2007 1:54 pm

all utf8, see the list I posted in the other thread concerning their usage.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

karol.cejka
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 177
Joined: Thu Nov 10, 2005 10:22 am
Location: Prague, Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by karol.cejka » Fri Feb 09, 2007 2:00 pm

ttf2ufm have a bug. H13 have pretty cool hack/update for Czech / Slovak language.
Karol Čejka · CET (UTC+1)
* Slovak (sk-SK) Joomla! Translation
* Slovak (sk-SK) Translation Services

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Fri Feb 09, 2007 2:11 pm

Could you specify which glyphs are available for that font and advantages compared to those already provided?

We may just include the new font on Forge.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Fri Feb 09, 2007 2:33 pm

It is not so easy.

Fonts in forge.joomla.org don't support Czech/Slovak/...(Latin 2) languages (or they do but not correctly).

If we create new font with help of ttf2ufm, it supports Czech/Slovak/... languages but ttf2ufm have a bug and PDF document shows "Ċ" instead of "č". We can hack it and PDF document will show it correctly. But character "Ċ" will be missing. Czech and Slovak languages don't need this character "Ċ", so it is all right. But there can be languages (I don't know), they need both characters "Ċ" and "č" and this can be problem. This solution isn't 100% for some Latin2 languages.
Last edited by H13 on Fri Feb 09, 2007 2:54 pm, edited 1 time in total.
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Fri Feb 09, 2007 3:27 pm

This hack can be used in the following languages (They contain character "č") : Lithuanian, Latvian, Croatian, Slovenian, Slovak, Czech, ...
Last edited by H13 on Fri Feb 09, 2007 3:33 pm, edited 1 time in total.
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

inglia
Joomla! Explorer
Joomla! Explorer
Posts: 266
Joined: Thu Aug 18, 2005 1:47 pm
Contact:

Re: PDF fonts for central eupean languages

Post by inglia » Fri Feb 09, 2007 4:15 pm

Yes I've had the same problem with every font I compiled.
Thank you for the solution, I'll try it later and report back.

all utf8, see the list I posted in the other thread concerning their usage
Jean-Marie, I've read those threads several times and it looks to me that included Vera font should work for latin2 range of languages. Am I wrong about this?
Please read the Forum rules regarding signatures: http://forum.joomla.org/viewtopic.php?t=65

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Sat Feb 10, 2007 6:14 am

UNhappily I am not the specialist on these matters.
At reading David's post, this is what we get for Vera:
Specifications for Vera font - this font is suitable for Western and Central European languages
Bitstream Vera Sans :
Basic Latin (95 out of 128 characters)
Latin-1 Supplement (96 out of 128 characters)
Latin Extended-A (20 out of 128 characters)
Latin Extended-B (1 out of 194 characters)

Spacing Modifier Letters (8 out of 80 characters)
Greek and Coptic (2 out of 124 characters)
General Punctuation (15 out of 106 characters)
Currency Symbols (1 out of 22 characters)
Letterlike Symbols (1 out of 77 characters)
Mathematical Operators (14 out of 256 characters)
Geometric Shapes (1 out of 96 characters)
Alphabetic Presentation Forms (2 out of 58 characters)
So it looks like some characters are missing indeed.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Sat Feb 10, 2007 1:10 pm

Jean-Marie, Vera font (forge.joomla.org) doesn't support Central European languages. There (forge.joomla.org) are other fonts, they support Central European languages but they contain error. This error ("Ċ" instead of "č") affects following languages:

- Lithuanian
- Latvian
- Croatian
- Slovenian
- Slovak
- Czech.

There are three possibilities how we can solve it:

1. We do nothing. Every user will create own font.
2. Somebody repair a bug in ttf2ufm (there is a source code).
3. We will create special font for affected languages.

???
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Sat Feb 10, 2007 4:07 pm

H13, I would not know how to repair that ttf2ufm file.

If there are errors in the files present on Forge (which specific files please?), do you think you could correct them and let me know when available?
I will be pleased to replace the buggy ones with the corrected ones so as to let all Partners and users have access to them..

Thanks for your support.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Sat Feb 10, 2007 4:58 pm

Vera – doesn't support: č, ď, ě, ň, ř, ť, ů, Ď, Ě, Ň, Ř, Ť, Ů (Czech characters) – this font doesn't support Latin 2 characters

DejaVuSans – supports Latin 2 characters but with one error ("Ċ" instead of "č")
CyberBase - supports Latin 2 characters but with one error ("Ċ" instead of "č")
FreeSans - supports Latin 2 characters but with one error ("Ċ" instead of "č")
Romanuni - supports Latin 2 characters but with one error ("Ċ" instead of "č")
FreeSerif - supports Latin 2 characters but with one error ("Ċ" instead of "č")
Cyberbit - supports Latin 2 characters but with one error ("Ċ" instead of "č")
CyberCJK - supports Latin 2 characters but with one error ("Ċ" instead of "č")

But I can't correct these files, I can replace "Ċ" by "č". It is solution for discussed languages. If I do it, character "Ċ" will be missing and this can cause problems in other languages  ???
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Sat Feb 10, 2007 6:33 pm

Understood now fully.

I'll ask if this glyph is used or not by any of our Translators.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Sat Feb 10, 2007 6:37 pm

That is great. ;)
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Sat Feb 10, 2007 6:51 pm

Last question:

Have you tried the last releases of Unicode GPL fonts (december 2006):
http://download.savannah.gnu.org/releases/freefont/

I am asking because David did the job before these were released.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Sat Feb 10, 2007 7:45 pm

Now I have tried it. The outcome is the same because there isn't problem in ttf (font) but in the ttf2ufm.exe.
ttf2ufm.exe creates ufm file with error.
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Sun Feb 11, 2007 8:10 am

I may have good News for you all.
tcpdf library has been updated last night and we also get a new font package.
I tested the Ċ and č and it looks like working.

Please install last SVN (6576+) and download these new fonts

http://forge.joomla.org/sf/frs/do/downl ... s8747?dl=1

Waiting for your feedback
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Sun Feb 11, 2007 1:17 pm

Jean-Marie, m'incliner devant toi.

It works great! The following code in tcpdf class is the solution:

Code: Select all

function _escape($s) 
{
     // the chr(13) substitution fixes the Bugs item #1421290.
     return strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\', chr(13) => '\r'));	
}
Thank you very much.
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Sun Feb 11, 2007 2:13 pm

All the merit goes to Louis Landry...
I happened to bug him about this as he was just committing the new library, explaining what was our problem.
I tested on the fly, that's all.  :D
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Sun Feb 11, 2007 4:28 pm

I don't thank you for the solution (thanks to Louis Landry), I thank you for the output.  :)
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: PDF fonts for central eupean languages

Post by infograf768 » Sun Feb 11, 2007 4:52 pm

inglia wrote: Jean-Marie, I've read those threads several times and it looks to me that included Vera font should work for latin2 range of languages. Am I wrong about this?
I have not tested Vera fully, Inglia, but Vera  for sure does not display the Ċ
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

inglia
Joomla! Explorer
Joomla! Explorer
Posts: 266
Joined: Thu Aug 18, 2005 1:47 pm
Contact:

Re: PDF fonts for central eupean languages

Post by inglia » Sun Feb 11, 2007 5:36 pm

It's not important any more, Vera was just confusing because it has all the glyphs (for hr) but not all of them are represented with both lowercase and uppercase variant.

Thank you, all 3 of you, for the solution  :)
Please read the Forum rules regarding signatures: http://forum.joomla.org/viewtopic.php?t=65

enoreth
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jun 21, 2007 3:21 pm

Re: PDF fonts for central eupean languages

Post by enoreth » Thu Jun 21, 2007 4:07 pm

Hi to everyone in this forum.
I'm working with tcpdf and the pdf files that we create are about 240K, The pdf files come with Unicode support for Latin 2 characters. My question is how can we make the files smaller.

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Thu Jun 21, 2007 7:23 pm

I have the same problem. I think, PDF document saves all utf-8 characters in font, because if I create PDF with e.g. Vera fonts, it takes 70 KB but without characters I need.
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

enoreth
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jun 21, 2007 3:21 pm

Re: PDF fonts for central eupean languages

Post by enoreth » Fri Jun 22, 2007 8:39 am

In FPDF also the father of TCPDF it is possible too convert fonts with different encodings and only the subsets for the needed languages. the unneeded chars in map files can be deleted. The font files are therefore smaller and smaller PDF files can be created.

Does anyone have an idea if the same can be achieved with tcpdf? I tried to convert fonts with subsets, the converted font files were as big as normal converted fonts.

User avatar
pajonkhfat
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Sun Jul 29, 2007 11:26 am
Location: Warszawa

Re: PDF fonts for central eupean languages

Post by pajonkhfat » Sun Aug 05, 2007 3:44 pm

H13: Considering that your conversation about PDF fonts generating for central eu languages took place in march, i assume that fix was already implemented in RC1. I found the same problem with polish language. Instead of ¶æñ¼¿± etc. I have squares in PDF. Do you have any solution for that already or I need to wait for full polish translation project finish?

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: PDF fonts for central eupean languages

Post by H13 » Sun Aug 05, 2007 4:04 pm

Pajonkhfat,

Try to change font, because Vera (default PDF font for Joomla!1.5) doesn't support central European languages (Latin2). Now I use FreeSans and I have no problems with PDF creating. I think, FreeSans contains polish characters too.
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

User avatar
pajonkhfat
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Sun Jul 29, 2007 11:26 am
Location: Warszawa

Re: PDF fonts for central eupean languages

Post by pajonkhfat » Wed Aug 08, 2007 8:38 am

H13 wrote: Pajonkhfat,

Try to change font, because Vera (default PDF font for Joomla!1.5) doesn't support central European languages (Latin2). Now I use FreeSans and I have no problems with PDF creating. I think, FreeSans contains polish characters too.
Thanks for help. I've got freesans.php, freesans.ctg.z, freesansbold.z and freesansbold.ctg.z in my joomla/language/pdf_fonts/ directory. One more thing. How I can force joomla fpdf to use freesans instead of vera fonts? ??? I could rename it to vera and overwrite old vera files, but it does not seems to be the best way for me :)

User avatar
ot2sen
Joomla! Master
Joomla! Master
Posts: 10381
Joined: Thu Aug 18, 2005 9:58 am
Location: Hillerød - Denmark
Contact:

Re: PDF fonts for central eupean languages

Post by ot2sen » Wed Aug 08, 2007 9:59 am

Hi pajonkhfat,

Try change the folllowing in your site language pl-PL.xml
vera
to
freesans
Ole Bang Ottosen
Dansk frivillig Joomla! support websted - joomla.dk
OpenTranslators Core Team opentranslators.org


Locked

Return to “Translations”