[cairo] [PATCH] Generate Type 1 fonts from glyph outlines

Behdad Esfahbod behdad at behdad.org
Wed Aug 30 00:55:57 PDT 2006

On Wed, 2006-08-30 at 02:04 -0400, Carl Worth wrote:
> On Sun, 27 Aug 2006 21:58:42 +0930, Adrian Johnson wrote:
> > This patch generates Type 1 fonts for the PS/PDF backends when TrueType
> > or Type 1 subsetting fails. This has the advantage over the current
> > Type 3 fallback of reduced font size and better quality rendering
> > in some PDF viewers. xpdf shows a large improvement in text display
> > quality with this patch.
> This looks like a non-trivial amount of new code to add to cairo, and
> I'm not sure how significant the benefits are. Can you help me
> understand them better?

Main reason that I like it is that Type1 fonts go through FreeType with
most of our viewers while Type3 doesn't.  To know whether this is a good
thing or bad, we need to know which fonts will go that route.  There are
two cases I can think of:

  1) When Type1 and TrueType subsettings fail.  Which are these fonts?
Why may Type1 subsetting fail for a Type1 font?

  2) User fonts.  For user fonts, not going through FreeType may be
preferable, as user fonts typically are rendered using cairo operation,
and going through the same cairo paths may be desired.  On the other
hand, one may be using other cairo font API in the user font (to do a
shadowed font style for example).  So that argument doesn't completely
hold.  But then again, user fonts can may have COLOR_ALPHA content that
I guess FreeType doesn't handle.

I think I tend to prefer Type3 after writing the above.


> For example, how big are the file size improvements? Are these
> significant in light of the other known inefficiencies of text output?
> (emitting a new font for every scale, emitting absolute positions for
> every glyph even when offset by exactly the advance values of the
> previous glyph, etc.) And, yes, I do realize that you are already
> submitting patches for some of these other inefficiencies.
> Beyond the file size improvements, are there other benefits besides
> the xpdf rendering issue? The xpdf thing sounds like just a poor
> implementation strategy in that application, (that it doesn't do
> antialiasing for vectors in type 3 fonts while its use of freetype for
> type 1 fonts does provide antialiasing).
> -Carl
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"

More information about the cairo mailing list