This is a little simpler than the old idiom of calling
_cairo_output_stream_get_status just before calling
_cairo_output_stream_destroy.
I had hoped this technique would apply in more cases, but
many cases want to separate the two actions anyway to do
conditional assignment of the status value, (in order to
not overwrite an earlier error value).
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.
PDF Files with Type 1 fonts fail to open in any version of
ghostscript prior to 8.54. The problem is the hex encoding of the
encrypted portion of the font. The PDF reference says this should
only be in binary.
There are still some problems in the resulting output:
PDF: Rotated font ends up being blurry in final PNG (not too important)
PS and SVG: There's an incorrect offset being applied somewhere.
This only affects the image fallback in those backends, and avoids getting
colored pixels there if user's fontconfig configuration turns subpixel on.
This doesn't quite fix that problem though, more changes are needed/coming.
Add a load_truetype_table function to cairo_scaled_font_backend_t and
use it to load the truetype sfnt tables. Implement this with freetype
for the freetype font backend and use GetFontData for win32. Atsui
remains unimplemented, and still falls back to type3 fonts.
This was a gratuitous thing that was causing excessive fallbacks in
mozilla printing to PDF. The only reason it was ever there was to
get some of the tests that rely on CAIRO_ANTIALIAS_NONE to pass.
Instead we now simply don't run those tests against the PDF backend.
Previously, using the ps or pdf backend with a bitmapped font would
result in a coorupt output file, filled with uninitialized values and
missing procedures for drawing the glyphs.
Now, the file should actually be valid, but it's simply drawing black
boxes instead of the correct glyphs.
Most internal cairo types are transparent within cairo and have init and fini
functions to intialize and finialize them in place. This way they can be
easily be embedded in other structs or derived from. Initially, the
cairo_output_stream_t type was proposed as a publically visible type and
thus kept opaque. However, now it's only used internally and derived from
in a number of places so let's make it an embeddable type for consistency
and ease of use.
The patch keeps _cairo_output_stream_create() and _cairo_output_stream_close()
around for (internal) backwards compatibility by deriving a
cairo_output_stream_with_closure_t stream type.
The patch also moves all cairo_output_stream_t functions out of cairoint.h
and into new file cairo-output-stream-private.h, thus chipping away at the
monolithic cairoint.h.
This just provides the mechanics for storing the value and removing the old
function calls. The new value is still not used anywhere (though nor where
the old values), so there should be no functional change (other than forcing
any programs calling the old API to be updated).
This rectangle has regular integer values, not fixed-point values.
So the old name was horribly wrong and misleading, (and yes I think
it was even I that had suggested it).
This patch was produced by running git-stripspace on all *.[ch] files
within cairo. Note that this script would have also created all the changes
from the previous commits to remove trailing whitespace.
This patch was produced with the following (GNU) sed script:
sed -i -r -e '/^[ \t]*\/?\*/ s/[ \t]+$//'
run on all *.[ch] files within cairo, (though I manually excluded
src/cairo-atsui-font.c which has a code line that appears as a comment
to this script).
I don't recall anything about this in the PDF reference, (though I
also didn't look specifically for it), but without this acroread
is quite unhappy with cairo's PDF output when it includes dashing.
- 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 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).