Forum How do I...?

? for armenian characters

taske
Hi,

We have two servers where Armenian support works on one servers but on the other doesn't. Here is the output of

# server 1 which works,
prince: debug: init locking for OpenSSL
prince: debug: loading license: /usr/lib/prince/license/license.dat
prince: loading document: /usr/lib/prince/license/license.dat
prince: debug: loaded resource: /usr/lib/prince/license/license.dat
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/fonts.css
prince: debug: loaded resource: /usr/lib/prince/style/fonts.css
prince: debug: loaded resource: type: no
prince: Loading document...
prince: debug: starting prefetch threads (max 6)
prince: loading HTML5 input: 404.html
prince: loading document: 404.html
prince: debug: loaded resource: 404.html
prince: debug: loaded resource: type: no
prince: debug: loaded document: 404.html
prince: debug: sniffed doctype: XHTML
prince: Applying style sheets...
prince: loading style sheet: /usr/lib/prince/style/common.css
prince: debug: loaded resource: /usr/lib/prince/style/common.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/html.css
prince: debug: loaded resource: /usr/lib/prince/style/html.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/hyph.css
prince: debug: loaded resource: /usr/lib/prince/style/hyph.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/mathml.css
prince: debug: loaded resource: /usr/lib/prince/style/mathml.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/svg.css
prince: debug: loaded resource: /usr/lib/prince/style/svg.css
prince: debug: loaded resource: type: no
prince: 404.html: warning: unsupported properties: text-shadow
prince: Preparing document...
prince: debug: stopping prefetch threads
prince: Converting document...
prince: debug: pack
prince: debug: font request: bold Lucida Grande, Segoe UI, Trebuchet MS, Verdana, Arial, Helvetica, sans-serif
prince: debug: font scan: Lucida Grande
prince: debug: font scan: Lucida Grande, 0 matches
prince: debug: font scan: Segoe UI
prince: debug: font scan: Segoe UI, 0 matches
prince: debug: font scan: Trebuchet MS
prince: debug: font scan: Trebuchet MS, 0 matches
prince: debug: font scan: Verdana
prince: debug: font scan: Verdana, 0 matches
prince: debug: font scan: Arial
prince: debug: font scan: Arial, 0 matches
prince: debug: font scan: Helvetica
prince: debug: font scan: Helvetica, 0 matches
prince: debug: font scan: DejaVu Sans
prince: debug: font scan: DejaVu Sans, 9 matches
prince: debug: font scan: DejaVu LGC Sans
prince: debug: font scan: DejaVu LGC Sans, 0 matches
prince: debug: font scan: Liberation Sans
prince: debug: font scan: Liberation Sans, 4 matches
prince: debug: font scan: OpenSymbol
prince: debug: font scan: OpenSymbol, 1 matches
prince: debug: font scan: AR PL UKai CN
prince: debug: font scan: AR PL UKai CN, 1 matches
prince: debug: font scan: AR PL KaitiM GB
prince: debug: font scan: AR PL KaitiM GB, 1 matches
prince: debug: font scan: Kochi Gothic
prince: debug: font scan: Kochi Gothic, 0 matches
prince: debug: font scan: IPAGothic
prince: debug: font scan: IPAGothic, 2 matches
prince: debug: font scan: UnDotum
prince: debug: font scan: UnDotum, 2 matches
prince: debug: font scan: Baekmuk Gulim
prince: debug: font scan: Baekmuk Gulim, 0 matches
prince: debug: font scan: Times New Roman
prince: debug: font scan: Times New Roman, 0 matches
prince: debug: font scan: DejaVu Serif
prince: debug: font scan: DejaVu Serif, 8 matches
prince: debug: font scan: DejaVu LGC Serif
prince: debug: font scan: DejaVu LGC Serif, 0 matches
prince: debug: font scan: Liberation Serif
prince: debug: font scan: Liberation Serif, 4 matches
prince: debug: font scan: AR PL UMing CN
prince: debug: font scan: AR PL UMing CN, 1 matches
prince: debug: font scan: AR PL SungtiL GB
prince: debug: font scan: AR PL SungtiL GB, 1 matches
prince: debug: font scan: Kochi Mincho
prince: debug: font scan: Kochi Mincho, 0 matches
prince: debug: font scan: IPAMincho
prince: debug: font scan: IPAMincho, 2 matches
prince: debug: font scan: UnBatang
prince: debug: font scan: UnBatang, 2 matches
prince: debug: font scan: Baekmuk Batang
prince: debug: font scan: Baekmuk Batang, 0 matches
prince: debug: font scan: Lohit Devanagari
prince: debug: font scan: Lohit Devanagari, 1 matches
prince: debug: font scan: Lohit Bengali
prince: debug: font scan: Lohit Bengali, 0 matches
prince: debug: font scan: Ani
prince: debug: font scan: Ani, 0 matches
prince: debug: font scan: Mukti Narrow
prince: debug: font scan: Mukti Narrow, 0 matches
prince: debug: font scan: Lohit Punjabi
prince: debug: font scan: Lohit Punjabi, 0 matches
prince: debug: font scan: Lohit Gujarati
prince: debug: font scan: Lohit Gujarati, 0 matches
prince: debug: font scan: Lohit Tamil
prince: debug: font scan: Lohit Tamil, 0 matches
prince: debug: font scan: Lohit Telugu
prince: debug: font scan: Lohit Telugu, 0 matches
prince: debug: font scan: Lohit Kannada
prince: debug: font scan: Lohit Kannada, 0 matches
prince: debug: font scan: Lohit Malayalam
prince: debug: font scan: Lohit Malayalam, 0 matches
prince: debug: font scan: Lohit Oriya
prince: debug: font scan: Lohit Oriya, 0 matches
prince: debug: font scan: Garuda
prince: debug: font scan: Garuda, 4 matches
prince: used font: DejaVu Sans, Bold
prince: debug: font request: Lucida Grande, Segoe UI, Trebuchet MS, Verdana, Arial, Helvetica, sans-serif
prince: used font: DejaVu Sans, Book
prince: debug: writing PDF to file: 404.pdf
prince: Finished: success



# server 2 which doesn't
prince: debug: init locking for OpenSSL
prince: debug: loading license: /usr/lib/prince/license/license.dat
prince: loading document: /usr/lib/prince/license/license.dat
prince: debug: loaded resource: /usr/lib/prince/license/license.dat
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/fonts.css
prince: debug: loaded resource: /usr/lib/prince/style/fonts.css
prince: debug: loaded resource: type: no
prince: Loading document...
prince: debug: starting prefetch threads (max 6)
prince: loading HTML5 input: 404.html
prince: loading document: 404.html
prince: debug: loaded resource: 404.html
prince: debug: loaded resource: type: no
prince: debug: loaded document: 404.html
prince: debug: sniffed doctype: XHTML
prince: Applying style sheets...
prince: loading style sheet: /usr/lib/prince/style/common.css
prince: debug: loaded resource: /usr/lib/prince/style/common.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/html.css
prince: debug: loaded resource: /usr/lib/prince/style/html.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/hyph.css
prince: debug: loaded resource: /usr/lib/prince/style/hyph.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/mathml.css
prince: debug: loaded resource: /usr/lib/prince/style/mathml.css
prince: debug: loaded resource: type: no
prince: loading style sheet: /usr/lib/prince/style/svg.css
prince: debug: loaded resource: /usr/lib/prince/style/svg.css
prince: debug: loaded resource: type: no
prince: 404.html: warning: unsupported properties: text-shadow
prince: Preparing document...
prince: debug: stopping prefetch threads
prince: Converting document...
prince: debug: pack
prince: debug: font request: bold Lucida Grande, Segoe UI, Trebuchet MS, Verdana, Arial, Helvetica, sans-serif
prince: debug: font scan: Lucida Grande
prince: debug: font scan: Lucida Grande, 0 matches
prince: debug: font scan: Segoe UI
prince: debug: font scan: Segoe UI, 0 matches
prince: debug: font scan: Trebuchet MS
prince: debug: font scan: Trebuchet MS, 8 matches
prince: debug: font scan: Verdana
prince: debug: font scan: Verdana, 7 matches
prince: debug: font scan: Arial
prince: debug: font scan: Arial, 7 matches
prince: debug: font scan: Helvetica
prince: debug: font scan: Helvetica, 0 matches
prince: debug: font scan: DejaVu Sans
prince: debug: font scan: DejaVu Sans, 9 matches
prince: debug: font scan: DejaVu LGC Sans
prince: debug: font scan: DejaVu LGC Sans, 0 matches
prince: debug: font scan: Liberation Sans
prince: debug: font scan: Liberation Sans, 4 matches
prince: debug: font scan: OpenSymbol
prince: debug: font scan: OpenSymbol, 1 matches
prince: debug: font scan: AR PL UKai CN
prince: debug: font scan: AR PL UKai CN, 1 matches
prince: debug: font scan: AR PL KaitiM GB
prince: debug: font scan: AR PL KaitiM GB, 1 matches
prince: debug: font scan: Kochi Gothic
prince: debug: font scan: Kochi Gothic, 0 matches
prince: debug: font scan: IPAGothic
prince: debug: font scan: IPAGothic, 2 matches
prince: debug: font scan: UnDotum
prince: debug: font scan: UnDotum, 2 matches
prince: debug: font scan: Baekmuk Gulim
prince: debug: font scan: Baekmuk Gulim, 0 matches
prince: debug: font scan: Times New Roman
prince: debug: font scan: Times New Roman, 8 matches
prince: debug: font scan: DejaVu Serif
prince: debug: font scan: DejaVu Serif, 8 matches
prince: debug: font scan: DejaVu LGC Serif
prince: debug: font scan: DejaVu LGC Serif, 0 matches
prince: debug: font scan: Liberation Serif
prince: debug: font scan: Liberation Serif, 4 matches
prince: debug: font scan: AR PL UMing CN
prince: debug: font scan: AR PL UMing CN, 1 matches
prince: debug: font scan: AR PL SungtiL GB
prince: debug: font scan: AR PL SungtiL GB, 1 matches
prince: debug: font scan: Kochi Mincho
prince: debug: font scan: Kochi Mincho, 0 matches
prince: debug: font scan: IPAMincho
prince: debug: font scan: IPAMincho, 2 matches
prince: debug: font scan: UnBatang
prince: debug: font scan: UnBatang, 2 matches
prince: debug: font scan: Baekmuk Batang
prince: debug: font scan: Baekmuk Batang, 0 matches
prince: debug: font scan: Lohit Devanagari
prince: debug: font scan: Lohit Devanagari, 1 matches
prince: debug: font scan: Lohit Bengali
prince: debug: font scan: Lohit Bengali, 0 matches
prince: debug: font scan: Ani
prince: debug: font scan: Ani, 0 matches
prince: debug: font scan: Mukti Narrow
prince: debug: font scan: Mukti Narrow, 0 matches
prince: debug: font scan: Lohit Punjabi
prince: debug: font scan: Lohit Punjabi, 0 matches
prince: debug: font scan: Lohit Gujarati
prince: debug: font scan: Lohit Gujarati, 0 matches
prince: debug: font scan: Lohit Tamil
prince: debug: font scan: Lohit Tamil, 0 matches
prince: debug: font scan: Lohit Telugu
prince: debug: font scan: Lohit Telugu, 0 matches
prince: debug: font scan: Lohit Kannada
prince: debug: font scan: Lohit Kannada, 0 matches
prince: debug: font scan: Lohit Malayalam
prince: debug: font scan: Lohit Malayalam, 0 matches
prince: debug: font scan: Lohit Oriya
prince: debug: font scan: Lohit Oriya, 0 matches
prince: debug: font scan: Garuda
prince: debug: font scan: Garuda, 4 matches
prince: used font: Trebuchet MS, Bold
prince: debug: font request: Lucida Grande, Segoe UI, Trebuchet MS, Verdana, Arial, Helvetica, sans-serif
prince: used font: Trebuchet MS, Regular
prince: debug: font metrics: OS/2 typo descender is positive
prince: debug: font metrics: using inconsistent OS/2 typo ascender
prince: debug: font metrics: using inconsistent OS/2 typo descender
prince: page 1: warning: no font for Armenian character U+0540, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0561, fallback to '?'
prince: page 1: warning: no font for Armenian character U+057E, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0565, fallback to '?'
prince: page 1: warning: no font for Armenian character U+056C, fallback to '?'
prince: page 1: warning: no font for Armenian character U+056E, fallback to '?'
prince: page 1: warning: no font for Armenian character U+054A, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0575, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0574, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0576, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0563, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0580, fallback to '?'
prince: page 1: warning: no font for Armenian character U+056B, fallback to '?'
prince: page 1: warning: no font for Armenian character U+053F, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0578, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0572, fallback to '?'
prince: page 1: warning: no font for Armenian character U+0568, fallback to '?'
prince: debug: writing PDF to file: 404.pdf
prince: Finished: success


On server #1 Prince is using DejaVu on server #1 Trebuchet.
Both servers are Ubuntu 16.04. But have same fonts installed. Both are using same Prince version 12.2.


Any ideas where to look for the problem?

Thanks
mikeday
Based on the logs they do not appear to have the same fonts installed, and I find that Armenian does not work out of the box on Ubuntu 16.04. Can you use "dpkg --list" or "fc-list" to compare which fonts are installed on the two servers?
taske
Hi Mikeday, thanks for the reply.

Please check attached files.
  1. font_server_1.txt87.9 kB
  2. font_server_2.txt87.9 kB
mikeday
Something doesn't make sense, server #1 was not finding Trebuchet MS so it was falling back to DejaVu Sans, which does support Armenian characters like U+0540, but server #2 was finding Trebuchet MS and not falling back to DejaVu Sans, even though it was available, and even though both servers have Trebuchet MS installed, I don't understand this.

Can you replicate the problem when running Prince from the command-line with the same input document? Have you edited fonts.css at all, or are you using any custom @font-face rules in your style sheets?
taske
Can you replicate the problem when running Prince from the command-line with the same input document?

In the first post is the output of prince --debug test.html

Have you edited fonts.css at all

Nope, its the default

are you using any custom


Here are style sheets for pdf

@font-face {
  font-family: 'NanumGothic';
  font-weight: 400;
  src: url('font/NanumGothic-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'NanumGothic';
  font-weight: 700;
  src: url('font/NanumGothic-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'NanumGothic';
  font-weight: 800;
  src: url('font/NanumGothic-ExtraBold.ttf') format('truetype');
}

/* Additional Icons from Fontello */
@font-face {
  font-family: 'fontello';
  src: url('font/fontello.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* open-sans-300 - latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300;
  src: url('font/open-sans-v13-latin-300.ttf') format('truetype');
}
/* open-sans-regular - latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: url('font/open-sans-v13-latin-regular.ttf') format('truetype');
}
/* open-sans-600 - latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  src: url('font/open-sans-v13-latin-600.ttf') format('truetype');
}
/* open-sans-700 - latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  src: url('font/open-sans-v13-latin-700.ttf') format('truetype');
}
mikeday
What font-family are you applying to the Armenian text?
taske
Hi,

it has been a while since I opened this issue but here is an update

Only difference is that the non-working server has extra fonts installed:
- ttf-mscorefonts-installer
- ttf-opensymbol
- fonts-arphic-*
- ttf-unfonts-core
- ttf-unfonts-extra
- fonts-vlgothic
- fonts-ipafont-gothic
- fonts-deva
- fonts-khmeros-core
- fonts-khmeros
- fonts-thai-tlwg

This time is falling to Times New Roman font. Seems its using fonts from ttf-mscorefonts-installer package.
So I uninstalled the ttf-mscorefonts-installer and it started working.
Not sure why ttf-mscorefonts-installer fonts package has precedence over other fonts.
mikeday
Prince looks for Times New Roman ahead of DejaVu Serif by default, although in latest builds we have also started falling back to DejaVu Sans which supports symbols not found in the other fonts.

Unfortunately configuring default fonts across every possible platform is quite difficult, but perhaps we should consider defaulting to the DejaVu fonts in future instead of the Microsoft Core Fonts, at least on Linux platforms.
taske
Fixed by moving DejaVu font before Times New Roman

@font-face {
font-family: serif; /* Latin */
src: prince-lookup("DejaVu Serif"), prince-lookup("Times New Roman"), prince-lookup("DejaVu LGC Serif"), prince-lookup("Liberation Serif")
}

in /usr/lib/prince/style/fonts.css