- Include PS standard encoding table so we can map from standard
encoding indices to glyph names and then make sure to include the
glyph of that name.
- Cut out verbose debugging code.
- Fix a couple of bugs in glyph name to index lookup code.
- Add _cairo_ps_surface_emit_type1_font_subset() which just dumps the
type1 subset into the ps document.
- Add a 'name' parameter to _cairo_type1_subset_init() so it will be
defined under the right name in the ps document.
- Quiet down debug output from type1 subset code.
- Reenable code to output custom /Encoding table.
This patch also factors the word wrap stream setup and teardown
and the call to _cairo_path_fixed_interpret() out into a new function,
_cairo_ps_surface_emit_path().
We probably should figure out from the private dictionary which of the two
pairs the font defines and uses, but I don't actually have fonts that
use -| and |-, so for now for flip the default.
Backends that use the font subsetting code should add the font subsetting
sources to the build. This is dont by setting libcairo_font_subset_sources,
in the conditional section for each backend. If any one is enabled, the
sources will be added to the build.
Same story as for the pdf backend: try to output a truetype subset if
possible, otherwise fall back to a type3 font. Ajdust text output code
to scale font accordingly and scale type3 fonts to unity.
This change changes the text output code to use the Tm operator for
positioning the glyphs. This allows us to set the scale matrix from
the cairo_scaled_font_t so truetype glyphs get transformed correctly.
However, we now need to scale type3 glyph to unity to compensate.
Longer term we should just only output one unit sized type3 subset for
a cairo_font_face_t and use that for all cairo_scaled_font_t's coming from
that font face.
Also, this fixes a num_glyphs initialization bug.
This allows for more sharing of resource objects. It also avoids some
confusion in trying to set independent resources at a global and a
per-page level, (which doesn't work since the inheritance only works
for an entire resources object---it can only be overriden in its
entirety, not for subsets of the resources).
The only expected errors that would lead to this fallback are serious
problems such as out of memory. There's no reason to go to heroic
efforts to draw as much as possible in face of an error like that.
Prefer simpler code instead.
Since we are only ever displaying a single glyph at a time we don't
care about the width values passed to setcachedevice at all---we only
care about the bounding box.
That's what the code was trying to do before, but the arguments were
misaligned and we were instead passing bounding-box values for the
widths and hard-coding half of the bounding-box values as 0.
The return of status from this callback was misleading. The function
actually calling the callback was also a hash table callback function,
which itself is void---so any status value returned was being lost.
Instead, we now stash any errors that occur during the fallback into
surface->status.
Eliminate the named structure cairo_pdf_stream_t. This structure was
being dynamically allocated, passed around, and leaked when only an ID
was actually needed to be passed around.
Similarly, many other uses of PDF resources were passing bare unsigned
int types rather than the safer and more legible cairo_pdf_resource_t.
This is an adaptation of Keith ps-type3 branch for SVG backend.
Main differences with ps stuff are font cache is a property of
document, and there's no need of subfonts.