apmuthu / frontaccounting

Front Accounting - a web based ERP
http://www.frontaccounting.com
69 stars 108 forks source link

Tamil (Indic) font support in TCPDF in FA does not support consonants in vowels on both it's sides #6

Open apmuthu opened 9 years ago

apmuthu commented 9 years ago

The unofficial ta_IN Tamil Language extension for FA displays correctly in the browser but does not render correctly in PDF reports. Excel reports are fine though.

In Debian Squeeze, it is installed with:

sed -i -e 's/# ta_IN UTF-8/ta_IN UTF-8/' /etc/locale.gen
dpkg-reconfigure --frontend=noninteractive locales

Additional Tamil fonts can be installed in Debian Squeeze with:

apt-get install ttf-tamil-fonts

Tamil Font Installation is discussed in the FA forums.

Online fonts and conversions are at: http://www.xml-convert.com/en/convert-tff-font-to-afm-pfa-fpdf-tcpdf http://azhagi.com/freefonts.html

apmuthu commented 9 years ago

Browser Display fa_tamil_2015-05-01_163523 fa_tamil_setup_company_2015-05-01_163754

apmuthu commented 9 years ago

Excel Report Rendering fa_tamil_xls_pl The worksheet name is mangled.

apmuthu commented 9 years ago

Poor rendering of PDF reports in both browser and external reader fa_tamil_pdf_pl fa_tamil_pdf_pl_in_ff

apmuthu commented 9 years ago
Although:
ட + ு = டு
0B9F + 0BC1
the following is displayed:
ட ு

Ila.Sundaram font is used but all Unicode fonts like Akshar, etc have the same issue.

apmuthu commented 9 years ago

tamil_font_inclusion

apmuthu commented 9 years ago

Generation of Tamil Unicode font files:

C:\php53\php tcpdf_addfont.php -b -t TrueTypeUnicode -f 32 -i Sundaram.ttf,SundaramB.ttf
C:\php53\php tcpdf_addfont.php -b -t TrueTypeUnicode -f 96 -i SundaramBI.ttf,SundaramI.ttf

Each font will have a ttf, z, php and ctg.z extensions that need to be uploaded to the reporting/fonts folder. The file tcpdf_addfont.php is in the original TCPDF v4.0.027 release in the tcpdf/tools/ folder.

Reference links: http://symbolcodes.tlt.psu.edu/bylanguage/tamilchart.html http://www.wazu.jp/gallery/Fonts_Tamil.html http://barathonline.blogspot.sg/2008/03/tamil-fonts-collection_06.html http://stackoverflow.com/questions/18200919/using-unicode-with-tcpdf http://rrbits.com/epb/2013/02/23/tcpdf-indic-script-support/ http://www.azhagi.com/fonts-sample5.html http://www.higopi.com/fonts/ http://people.w3.org/rishida/scripts/indic-overview/

apmuthu commented 9 years ago

The necessary Tamil FA font files are at http://www.apmuthu.com/frontaccounting/sundaram_tamil_fonts.zip

The ta_IN language extension needs to be detailed in the lang/installed_languages.inc file and is available for download.

installed_languages

apmuthu commented 9 years ago

TAMIL LETTER TTA 2975 (Dec) => 0B9F Category: Letter, Other [Lo]

TAMIL VOWEL SIGN U 3009 (Dec) => 0BC1 Category: Mark, Spacing Combining [Mc]

Tamil Unicode Block From U+0B80 To U+0BFF 72 characters No Mirroring BIDI: LTR UTF Browser Test

Supported Fonts Support Font
100% FreeSerif 100% GNU Unifont 100% Unicode BMP Fallback SIL 99% Code2000 (71 of 72) 99% LastResort (71 of 72) 85% Arial Unicode MS (61 of 72) 68% Samyak_Multilingual (49 of 72) 14% Segoe UI (10 of 72) 14% Segoe UI Bold (10 of 72) 14% Segoe UI Light (10 of 72)

FreeSerif supported Tamil character fonts are here: http://ftp.gnu.org/gnu/freefont/freefont-ttf-20120503.zip http://ftp.gnu.org/gnu/freefont/freefont-otf-20120503.tar.gz

apmuthu commented 9 years ago

http://www.unicode.org/faq/indic.html

Character width adjustments: http://bytethinker.com/blog/correct-display-of-imported-fonts-in-tcpdf

apmuthu commented 9 years ago

Possible Alternatives to TCPDF for Tamil / Indic Scripts: