Opened 11 years ago

Closed 10 months ago

#17742 closed defect (fixed)

cairo 1.8.x - no japanese, chinese or other asian fonts are displayed with X11 variant

Reported by: skl@… Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: cairo gtk asian fonts Cc:
Port: cairo


I'm providing pre-build packages of GIMP on "GIMP on OS X", using MacPorts as a basis. Many users have encontered problems with asian fonts (like traditional chinese) not displaying in menu entries. For more details please see these threads

I've tracked this issue down to cairo. The Portfile enables the various quartz configure options if cairo is build with x11 support. This will make pango use the ATSUI font backend and this will lead to asian fonts not being diplayed at all. As far as I know it's not necessary to use the quartz backends in cairo / ATSUI module in pango if both are build with X11 support.

After disabling the quartz configure options (--enable-quartz --enable-quartz-font --enable-quartz-image) in platfom macosx{} and rebuilding cairo, pango, gtk and GIMP, everything worked as expected and the chinese fonts showed up.

This bug can be reproduced by launching some gtk application from and setting an asian localization first, e.g.

export LANG=zh_CN.UTF-8

A sample Portfile is attached.

Attachments (1)

Portfile (5.6 KB) - added by skl@… 11 years ago.

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by skl@…

Attachment: Portfile added

comment:1 Changed 11 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to ryandesign@…

Assigning to maintainer.

comment:2 Changed 10 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

comment:3 Changed 10 years ago by mathieu@…

I confirm that Japanese text doesn't work when cairo and pango are compiled with +quartz. Ascii text does work though.

$ port installed pango-devel cairo-devel
The following ports are currently installed:
  cairo-devel @1.9.2_0+macosx
  cairo-devel @1.9.2_0+macosx+no_x11+quartz
  cairo-devel @1.9.2_0+macosx+quartz (active)
  pango-devel @1.25.6_0+macosx
  pango-devel @1.25.6_0+macosx+no_x11+quartz
  pango-devel @1.25.6_0+macosx+quartz (active)

By default, the "han" script (which is used for Japanese) is associated with the fontconfig backend instead of the atsui backend.

$ pango-querymodules 
# Pango Modules file
# Automatically generated file, do not edit
# ModulesPath = /opt/local/lib/pango/1.6.0/modules
/opt/local/lib/pango/1.6.0/modules/ ArabicScriptEngineFc PangoEngineShape PangoRenderFc arabic:* nko:*
/opt/local/lib/pango/1.6.0/modules/ ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*
/opt/local/lib/pango/1.6.0/modules/ BasicScriptEngineATSUI PangoEngineShape PangoRenderATSUI common:
/opt/local/lib/pango/1.6.0/modules/ BasicScriptEngineFc PangoEngineShape PangoRenderFc latin:* cyrillic:* greek:* armenian:* georgian:* runic:* ogham:* bopomofo:* cherokee:* coptic:* deseret:* ethiopic:* gothic:* han:* hiragana:* katakana:* old-italic:* canadian-aboriginal:* yi:* braille:* cypriot:* limbu:* osmanya:* shavian:* linear-b:* ugaritic:* glagolitic:* cuneiform:* phoenician:* common:
/opt/local/lib/pango/1.6.0/modules/ BasicScriptEngineX PangoEngineShape PangoRenderX common:
/opt/local/lib/pango/1.6.0/modules/ HangulScriptEngineFc PangoEngineShape PangoRenderFc hangul:*
/opt/local/lib/pango/1.6.0/modules/ HebrewScriptEngineFc PangoEngineShape PangoRenderFc hebrew:*
/opt/local/lib/pango/1.6.0/modules/ devaScriptEngineFc PangoEngineShape PangoRenderFc devanagari:*
/opt/local/lib/pango/1.6.0/modules/ bengScriptEngineFc PangoEngineShape PangoRenderFc bengali:*
/opt/local/lib/pango/1.6.0/modules/ guruScriptEngineFc PangoEngineShape PangoRenderFc gurmukhi:*
/opt/local/lib/pango/1.6.0/modules/ gujrScriptEngineFc PangoEngineShape PangoRenderFc gujarati:*
/opt/local/lib/pango/1.6.0/modules/ oryaScriptEngineFc PangoEngineShape PangoRenderFc oriya:*
/opt/local/lib/pango/1.6.0/modules/ tamlScriptEngineFc PangoEngineShape PangoRenderFc tamil:*
/opt/local/lib/pango/1.6.0/modules/ teluScriptEngineFc PangoEngineShape PangoRenderFc telugu:*
/opt/local/lib/pango/1.6.0/modules/ kndaScriptEngineFc PangoEngineShape PangoRenderFc kannada:*
/opt/local/lib/pango/1.6.0/modules/ mlymScriptEngineFc PangoEngineShape PangoRenderFc malayalam:*
/opt/local/lib/pango/1.6.0/modules/ sinhScriptEngineFc PangoEngineShape PangoRenderFc sinhala:*
/opt/local/lib/pango/1.6.0/modules/ devaIndicScriptEngineLang PangoEngineLang PangoRenderNone devanagari:*
/opt/local/lib/pango/1.6.0/modules/ bengIndicScriptEngineLang PangoEngineLang PangoRenderNone bengali:*
/opt/local/lib/pango/1.6.0/modules/ guruIndicScriptEngineLang PangoEngineLang PangoRenderNone gurmukhi:*
/opt/local/lib/pango/1.6.0/modules/ gujrIndicScriptEngineLang PangoEngineLang PangoRenderNone gujarati:*
/opt/local/lib/pango/1.6.0/modules/ oryaIndicScriptEngineLang PangoEngineLang PangoRenderNone oriya:*
/opt/local/lib/pango/1.6.0/modules/ tamlIndicScriptEngineLang PangoEngineLang PangoRenderNone tamil:*
/opt/local/lib/pango/1.6.0/modules/ teluIndicScriptEngineLang PangoEngineLang PangoRenderNone telugu:*
/opt/local/lib/pango/1.6.0/modules/ kndaIndicScriptEngineLang PangoEngineLang PangoRenderNone kannada:*
/opt/local/lib/pango/1.6.0/modules/ mlymIndicScriptEngineLang PangoEngineLang PangoRenderNone malayalam:*
/opt/local/lib/pango/1.6.0/modules/ sinhIndicScriptEngineLang PangoEngineLang PangoRenderNone sinhala:*
/opt/local/lib/pango/1.6.0/modules/ KhmerScriptEngineFc PangoEngineShape PangoRenderFc khmer:*
/opt/local/lib/pango/1.6.0/modules/ SyriacScriptEngineFc PangoEngineShape PangoRenderFc syriac:*
/opt/local/lib/pango/1.6.0/modules/ ThaiScriptEngineFc PangoEngineShape PangoRenderFc thai:* lao:*
/opt/local/lib/pango/1.6.0/modules/ TibetanScriptEngineFc PangoEngineShape PangoRenderFc tibetan:*

If I force the "han" script to be associated with the atsui backend, I get

PangoWarning: failed to choose a font, expect ugly output. engine-type='PangoRenderATSUI', script='han'

although atsui does seem to support CJK according to

I'm wondering if disabling the fontconfig backend in cairo/pango can make any difference. If that's so, adding a variant would be a nice thing to do. I'm willing to help with testing if needed.

The main motivation for me in using the atsui backend is that I need to create an app bundle and it seems wiser to use native libraries whenever possible.

comment:4 Changed 10 months ago by dgilman (David Gilman)

Macports cairo now ships with +quartz enabled by default and the test in #15626 shows that it is able to select fonts for Chinese characters. I believe this ticket can be closed.

comment:5 Changed 10 months ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: newclosed


Note: See TracTickets for help on using tickets.