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

Description

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

http://gimper.net/viewtopic.php?f=18&t=3625

http://sourceforge.net/forum/forum.php?thread_id=2628533&forum_id=761056

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 Terminal.app and setting an asian localization first, e.g.

export LANG=zh_CN.UTF-8
/path/to/your/gtk-x11-application-startup

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/pango-arabic-fc.so ArabicScriptEngineFc PangoEngineShape PangoRenderFc arabic:* nko:*
/opt/local/lib/pango/1.6.0/modules/pango-arabic-lang.so ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*
/opt/local/lib/pango/1.6.0/modules/pango-basic-atsui.so BasicScriptEngineATSUI PangoEngineShape PangoRenderATSUI common:
/opt/local/lib/pango/1.6.0/modules/pango-basic-fc.so 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/pango-basic-x.so BasicScriptEngineX PangoEngineShape PangoRenderX common:
/opt/local/lib/pango/1.6.0/modules/pango-hangul-fc.so HangulScriptEngineFc PangoEngineShape PangoRenderFc hangul:*
/opt/local/lib/pango/1.6.0/modules/pango-hebrew-fc.so HebrewScriptEngineFc PangoEngineShape PangoRenderFc hebrew:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so devaScriptEngineFc PangoEngineShape PangoRenderFc devanagari:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so bengScriptEngineFc PangoEngineShape PangoRenderFc bengali:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so guruScriptEngineFc PangoEngineShape PangoRenderFc gurmukhi:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so gujrScriptEngineFc PangoEngineShape PangoRenderFc gujarati:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so oryaScriptEngineFc PangoEngineShape PangoRenderFc oriya:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so tamlScriptEngineFc PangoEngineShape PangoRenderFc tamil:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so teluScriptEngineFc PangoEngineShape PangoRenderFc telugu:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so kndaScriptEngineFc PangoEngineShape PangoRenderFc kannada:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so mlymScriptEngineFc PangoEngineShape PangoRenderFc malayalam:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-fc.so sinhScriptEngineFc PangoEngineShape PangoRenderFc sinhala:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so devaIndicScriptEngineLang PangoEngineLang PangoRenderNone devanagari:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so bengIndicScriptEngineLang PangoEngineLang PangoRenderNone bengali:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so guruIndicScriptEngineLang PangoEngineLang PangoRenderNone gurmukhi:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so gujrIndicScriptEngineLang PangoEngineLang PangoRenderNone gujarati:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so oryaIndicScriptEngineLang PangoEngineLang PangoRenderNone oriya:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so tamlIndicScriptEngineLang PangoEngineLang PangoRenderNone tamil:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so teluIndicScriptEngineLang PangoEngineLang PangoRenderNone telugu:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so kndaIndicScriptEngineLang PangoEngineLang PangoRenderNone kannada:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so mlymIndicScriptEngineLang PangoEngineLang PangoRenderNone malayalam:*
/opt/local/lib/pango/1.6.0/modules/pango-indic-lang.so sinhIndicScriptEngineLang PangoEngineLang PangoRenderNone sinhala:*
/opt/local/lib/pango/1.6.0/modules/pango-khmer-fc.so KhmerScriptEngineFc PangoEngineShape PangoRenderFc khmer:*
/opt/local/lib/pango/1.6.0/modules/pango-syriac-fc.so SyriacScriptEngineFc PangoEngineShape PangoRenderFc syriac:*
/opt/local/lib/pango/1.6.0/modules/pango-thai-fc.so ThaiScriptEngineFc PangoEngineShape PangoRenderFc thai:* lao:*
/opt/local/lib/pango/1.6.0/modules/pango-tibetan-fc.so 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 http://developer.apple.com/legacy/mac/library/documentation/Carbon/Conceptual/ATSUI_Concepts/atsui_chap1/atsui_intro.html.

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

Ok

Note: See TracTickets for help on using tickets.