[cairo] Cairo PDF output broken with Noto Nastaliq Urdu font
Adrian Johnson
ajohnson at redneon.com
Wed Nov 19 16:04:32 PST 2014
On 20/11/14 08:28, Behdad Esfahbod wrote:
> On 14-11-19 03:33 AM, Adrian Johnson wrote:
>> Yes, I can have a look when I get time. The best way to ensure this does
>> not get overlooked is to file a bug. I've done this for you at:
>>
>> https://bugs.freedesktop.org/show_bug.cgi?id=86461
>
> Thanks Adrian. Really appreciate it.
>
So it turned out to be an easy fix. Something I noticed while debugging
this is hb-view appears to be emitting a lot of empty glyphs. In large
documents this will unnecessarily increase the file size and increase
rendering time.
Adding some debug to cairo_show_text_glyphs and using the sample text:
کے
I get:
cairo_show_text_glyphs num_glyphs: 5
glyph 0: 1005
glyph 1: 1006
glyph 2: 1007
glyph 3: 248
glyph 4: 409
Using ttx I can see that
<mtx name="glyph01005" width="0" lsb="0"/>
<mtx name="glyph01006" width="0" lsb="0"/>
<mtx name="glyph01007" width="0" lsb="0"/>
and
<TTGlyph name="glyph01005" xMin="0" yMin="0" xMax="0" yMax="0">
<contour>
<pt x="0" y="0" on="1"/>
</contour>
<instructions><assembly>
</assembly></instructions>
</TTGlyph>
<TTGlyph name="glyph01006" xMin="0" yMin="0" xMax="0" yMax="0">
<contour>
<pt x="0" y="0" on="1"/>
</contour>
<instructions><assembly>
</assembly></instructions>
</TTGlyph>
<TTGlyph name="glyph01007" xMin="0" yMin="0" xMax="0" yMax="0">
<contour>
<pt x="0" y="0" on="1"/>
</contour>
<instructions><assembly>
</assembly></instructions>
</TTGlyph>
The cairo PS output is:
24 0 0 24 30.973638 24.414763 Tm
/f-0-1 1 Tf
-0.268014 0.635325 Td
<01>Tj
-0.355888 -0.420035 Td
<02>Tj
1.287346 -0.18717 Td
<03>Tj
-0.317223 -0.114236 Td
<04>Tj
-0.346221 0.086116 Td
<05>Tj
More information about the cairo
mailing list