Bug 6019 - RenderAddGlyphs fails with BadLength
Summary: RenderAddGlyphs fails with BadLength
Alias: None
Product: cairo
Classification: Unclassified
Component: xlib backend (show other bugs)
Version: 1.1.1
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
Depends on:
Reported: 2006-02-24 05:35 UTC by Chia-I Wu
Modified: 2008-04-07 07:34 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

mixed outline/bitmap glyphs (2.23 KB, image/png)
2006-02-24 05:38 UTC, Chia-I Wu

Description Chia-I Wu 2006-02-24 05:35:12 UTC

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
Comment 1 Chia-I Wu 2006-02-24 05:38:21 UTC
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)
Comment 2 Chia-I Wu 2006-02-25 21:20:34 UTC
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 name="pixelsize" compare="less_eq">                              
        <edit name="antialias" mode="assign">                                  

Don't know why cairo still renders outlines with anti-alias.
Comment 3 Chris Wilson 2008-04-07 07:34:49 UTC
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.