Comment 31 for bug 344814

Revision history for this message
In , Jfkthame (jfkthame) wrote :

(In reply to comment #19)
> cairo-ft-font uses FT_GlyphSlot_Embolden to do synthetic bold.
> Bug 490475 comment 5 makes me suspect that the emboldened glyph outlines are
> not embedded.
>
> There are two fonts embedded, one for each of regular and bold weights
>
> /f-0-0 1 Tf
> [<0102>-1<030304050406>-1<0307>]TJ
> /f-1-0 1 Tf
> 0 -1.694444 Td
> [<01>-83<02>-84<03>-84<03>-83<04>-83<05>-84<06>-84<04>-83<07>-84<03>-84<08>]TJ
>
> but AFAIK the two fonts might be the same.

Yes, they are identical in the PostScript output. This suggests that the expectation is that emboldening is meant to be achieved via a painting effect rather than by actually modifying the glyph outlines. (That makes sense.)

> I don't know whether there is any
> way to tell the PS/PDF interpreter to embolden one of these by any particular
> amount suitable to match the metrics from FT_GlyphSlot_Embolden.

One way to create "synthetic bold" is to paint the glyphs with both stroke (of some appropriate thickness) and fill. This looks similar to the effect we're seeing on-screen in the browser on Linux (and is better than simply painting the filled glyphs twice with a slight offset). However, PostScript type42 fonts don't offer a PaintType value to directly implement this; it's either 0 (fill) or 2 (stroke), but not both together. So this approach would mean generating the text twice, using two versions of the font with different PaintType values.

And I don't know what metrics FT_GlyphSlot_Embolden is using; the glyph spacing we're seeing on the "bold" line seems rather excessive to me.