Hi, cairo uses the same GlyphSet to render all glyphs of a scaled font (see `_cairo_xlib_surface_add_glyph' in cairo-xlib-surface.c. As a GlyphSet requires all glyphs to be of the same PictFormat, this can cause problems with bitmap/outline mixed fonts. For example, the most widely used traditional Chinese font, AR PL New Sung[1], has mixed bitmap/outline glyphs at size 15px. When try to render glyphs of that size, cairo fails with the following error message: X Error of failed request: BadLength (poly request too large or internal Xlib length error) Major opcode of failed request: 157 (RENDER) Minor opcode of failed request: 20 (RenderAddGlyphs) Serial number of failed request: 24 Current serial number in output stream: 29 [1]: http://cle.linux.org.tw/fonts/FireFly/fireflysung-1.3.0.tar.gz
Created attachment 4737 [details] mixed outline/bitmap glyphs The uppercase roman numbers are bitmaps (depth=1) and the lowercase ones are outlines (depth=8, anti-aliased)
In Xft, those outlines are rendered with anti-alias off. All glyphs, bitmaps or outlines, are thus of format PictStandardA1 and everything works well. Actually, I do turn anti-alias off in fontconfig's config file (so that the embeded bitmaps are used when available). <match target="font"> <test qual="any" name="family" compare="eq"> <string>AR PL New Sung</string> </test> <test name="pixelsize" compare="less_eq"> <double>16.5</double> </test> <edit name="antialias" mode="assign"> <bool>False</bool> </edit> </match> Don't know why cairo still renders outlines with anti-alias.
I believe this to be fixed by, in particular, commit 805b668260c47e6d3d854361fcc53f12bd2a57e1 and the work to resolved bug 13479.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.