[cairo] [PATCH] OpenType/CFF Subsetting

Adrian Johnson ajohnson at redneon.com
Mon Oct 30 03:38:33 PST 2006


Behdad Esfahbod wrote:
> Nice piece of work.  I didn't review it in detail, just letting my
> question out:  is there any code that can be shared with the Type1
> fallback code?

I don't think there is anything that could be shared with Type1
fallback. There is some code for reading the hmtx and name tables that
could be shared between cff and truetype subsetting.

> Also, is there a commonly available font that is CFF OpenType?

There are plenty of OpenType fonts on ctan.org. If you are looking
for a suitable font to use with the tests it would probably be easiest
to use fontforge to create a small subset of a free font and include it
with the test.

> Finally, do you think it's a good idea to have (and can you hack!) a
> _cairo_test_*() function for forcing what font subsetter is chosen?

I don't think forcing a font subsetter is a good idea. Instead I would
allow disabling specific font subsetters and let cairo choose the next
best option. For example:

  _cairo_test_disable_truetype_font()
  _cairo_test_disable_type1_font()
  _cairo_test_disable_cff_font()
  _cairo_test_disable_type1_fallback_font()

As well as supporting testing this would also provide a workaround for
when a printer (or ghostscript) has issues with a particular font. See
bug #8180 for an example of this.

There is also a case where the ability to control which PostScript fonts
are used would be useful as part of the API. Currently cairo claims to
generate Level 2 PostScript. However Type42 (truetype) fonts are not
part of the Level 2 specification. While most Level 2 printers probably
do support Type42 it would be better if printing APIs (such as GtkPrint)
 could enable Type42 fonts based on the value of the "TTRasterizer" PPD
keyword.



More information about the cairo mailing list