Comment 17 for bug 667752

Revision history for this message
In , Adrian Johnson (ajohnson-redneon) wrote :

Created attachment 57075
adjust substitute font width using first character in each string

There are two problems here:
 1) The "hello world" text is too narrow
 2) The "www.pdflib.com" text has spike on each path segment.

The first problem is caused by the code that adjusts the size of text drawn with a substituted font to match the width in the pdf file. This code matches the width of the letter 'm' in the font with the width in the pdf file. The problem in this case is the pdf file has bogus widths for characters not used included the letter 'm'. The attached patch fixes this by using the first letter of each string to set the font size.

The second problem is a cairo bug. In this case the pdf file is stroking the outline of a Type 3 font. Each glyph in the Type 3 font strokes a path. Cairo needs to implement stroke to path to make this work correctly.