[cairo] Two problems with Type 1 fonts

Elmar Braun elmar.braun at sh-p.de
Sat Dec 1 02:24:02 PST 2007


> Although yet I've not tried to reproduce the problems
> you reported (on any platforms), I want to know which
> Type1 font I should use to reproduce the problem.

I've tried four different Type 1 fonts, and encountered the same problem 
each time. It's probably not specific to a particular font.

> I wish if the problem can be reproduced by freely
> distributed Type1 font.

A bunch of free Type 1 fonts are distributed for use with TeX. I've 
reproduced the problem with the "NimbusRomNo9L" font from such a 
package. You can download it here:

http://tug.ctan.org/tex-archive/fonts/urw/base35/

(That archive puts .pfm and .pfb files in different subdirectories. I 
think you may have to put them in the same directory, or else Windows 
won't install them.)

Best regards,
Elmar



> The problems you reported made me reminded an issue in
> ghostscript that CFF OpenType made ghostscript confused:
> http://bugs.ghostscript.com/show_bug.cgi?id=689538
> I'm interested in.
> 
> Regards,
> mpsuzuki
> 
> Elmar Braun wrote (2007/12/01 8:00):
>> Hi,
>>
>> I have two (possibly related) problems with Type 1 fonts. I'm using 
>> Cairo 1.4.12 on Windows.
>>
>> The first problem is that text output to any surface other than a 
>> Win32 surface is completely garbled. For example, when I use a Type 1 
>> font to write the string "Type" to a PDF-, SVG- or image surface, the 
>> surface will show the string "5ZQF".
>>
>> The second issue is that cairo_scaled_font_glyph_extents() doesn't 
>> seem to work correctly with Type 1 fonts. When I rely on the results 
>> of that function to draw glyphs with cairo_show_glyphs(), the glyph 
>> positions are skewed. I think this may be related to the first 
>> problem, because the glyph positions seem to be correct for the 
>> garbled glyphs that are emitted on non-screen surfaces.
>>
>> The attached PNG demonstrates the problem. It shows how Cairo renders 
>> four lines: The first uses a Type 1 font and cairo_show_text. The 
>> second uses cairo_scaled_font_glyph_extents and cairo_show_glyphs, 
>> also with a Type 1 font. The third and fourth lines show the output of 
>> using the same code as for the first and second, but with a TrueType 
>> font.
>>
>> I've also attached the PDF output of the same four lines. It shows 
>> that the first two lines are completely garbled, though the second one 
>> has correct glyph positions (for the wrong glyphs).
>>
>> Elmar
>>
>>
>> ------------------------------------------------------------------------
>>
>> This body part will be downloaded on demand.
> 



More information about the cairo mailing list