Commit graph

173 commits

Author SHA1 Message Date
Adrian Johnson
b02b86da5c PDF: Compress the content stream
Use cairo-deflate-stream to compress all content streams emitted by the
PDF surface.
2007-01-17 13:21:26 -08:00
Adrian Johnson
b3440e8530 PDF: Use Td where possible instead of Tm for positioning glyphs
This avoids emitting the font matrix for every single glyph.
2007-01-17 13:20:43 -08:00
Kjartan Maraas
1002d01683 Remove unused variables (#7963) 2007-01-11 17:59:16 -05:00
Behdad Esfahbod
ded08256ef Spell check the docs 2007-01-07 02:08:15 -05:00
Alp Toker
caa3c2e1e7 Fix various code/comment typos 2007-01-07 01:35:15 -05:00
Behdad Esfahbod
5a9642c574 Add/remove const to cairo_glyph_t* arguments consistently
The rule is: cairo_glyph_t* is always passed as const for measurement
purposes.  This was not reflected in our public api previously.  Fixed

Showing glyphs used to have cairo_glyph_t* always as const.  With this
changed, it is only const on cairo_t and cairo_gstate_t operations.
cairo_surface_t, cairo_scaled_font_t, and individual backends receive
cairo_glyph_t* as non-const.  The desired semantics is that they may modify
the contents of the array as long as they do not return
CAIRO_STATUS_UNSUPPORTED.  This makes it possible to avoid copying the glyph
array again and again, and edit it in-place.  Backends are in fact free to use
the array as a generic buffer as they see fit.
2006-12-11 01:39:51 -05:00
Adrian Johnson
bd0f991908 Add OpenType/CFF Subsetting 2006-10-27 00:00:24 +09:30
Behdad Esfahbod
e1ded5b1e0 [PDF] Set CTM before path construction
The previous order is undefined according to the PDF spec.  The resulting PDF
was being misrendered using OS X Preview viewer.  This was reported in this
thread:

  http://lists.freedesktop.org/archives/cairo/2006-October/008271.html
2006-10-25 21:40:08 -04:00
Carl Worth
02096f66f3 Fix typo 2006-10-25 12:52:02 -07:00
Adrian Johnson
830804c7ae PDF: Add cairo version to document info dictionary 2006-10-15 23:11:30 +09:30
Adrian Johnson
216c759d46 Type 1 fallback fonts - use binary encoding in PDF files
PDF files require that embedded Type 1 fonts have the encrypted
portion of the font encoded in binary.
2006-10-15 23:07:38 +09:30
Carl Worth
179f7defdf Use new return value from _cairo_output_stream_destroy
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).
2006-09-07 16:10:40 -07:00
Adrian Johnson
d716020db2 Generate Type 1 fonts from glyph outlines
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.
2006-09-05 15:57:47 -04:00
Adrian Johnson
49fa8d353b Correct the value of /LastChar in the PDF Type 1 font dictionary. 2006-09-05 14:19:48 -04:00
Adrian Johnson
d81de15804 Fix Type 1 embedding in PDF
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.
2006-09-05 14:19:26 -04:00
Carl Worth
b8b507c092 Use &image->base as appropriate to avoid warnings. 2006-08-18 16:12:43 -07:00
Carl Worth
0bfa6d4f33 Fix assertion failures in bitmap-font test by coercing A8 images to A1
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.
2006-08-17 17:50:40 -07:00
Behdad Esfahbod
16c18aea52 [PDF] Fix leak: free glyphs 2006-08-08 15:30:56 -04:00
Behdad Esfahbod
1f854fcf32 Set antialiasing to gray in default font options for PS/PDF/SVG
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.
2006-08-08 06:09:23 -04:00
Carl Worth
401f0ce3c4 Merge branch 'surface-font-options' into cairo 2006-08-08 00:19:51 -07:00
Carl Worth
20c3ff96de Fix some signed/unsigned comparison warnings that cropped up during the warnings-cleanup branch 2006-08-07 15:22:49 -07:00
Carl Worth
959b85e98c Merge branch 'warnings-cleanup' into cairo
Conflicts:

	src/cairo-font-subset.c
2006-08-07 15:06:47 -07:00
Carl Worth
43b579d757 Add -Wswitch-enum compiler flag and fix all trivial warnings 2006-08-07 14:30:06 -07:00
Dominic Lachowicz
761b30792d Add binary garbage to PDF header as recommended in section 3.4.1 of PDF Reference v1.6 2006-08-04 16:39:40 -07:00
Adrian Johnson
a0989f427b Remove freetype dependency for truetype subsetting code.
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.
2006-08-02 19:30:55 -04:00
Behdad Esfahbod
a8a0082c53 Remove dummy create_similar in PS/PDF and let fallback do the same
which is simply creating an image surface.
2006-07-31 14:41:27 -04:00
Carl Worth
eb9caf0833 Add -Wsign-compare compiler flag and fix all warnings 2006-07-28 22:50:06 -07:00
Kent Worsnop
778c4730a8 PDF: Fix for dash-no-dash test case, (so that dashing can be turned off) 2006-07-13 10:22:19 -07:00
Behdad Esfahbod
66436d1327 Update lots of docs. 2006-06-30 02:21:50 +02:00
Behdad Esfahbod
320ce67d63 Add "Since: 1.2" to docs for most new API functions. 2006-06-30 02:21:49 +02:00
Behdad Esfahbod
195b1142e7 Prefix "cairo_*_test_*" symbols with underscore. 2006-06-29 15:22:44 +02:00
Carl Worth
25e0acfee0 PDF: Fix display of bitmapped glyphs (bitmap-font test now passes) 2006-06-21 17:23:35 -07:00
Carl Worth
b4720ca51d PDF: Push glyph stream creation down from emit glyph to outline/bitmap variants 2006-06-21 16:59:29 -07:00
Carl Worth
7026e24548 PS PDF: Drop unused hex_digit functions, (now that output stream supports %02x) 2006-06-19 21:15:26 -07:00
Kristian Høgsberg
cd5e08a9fe Implement 0-padding and field width for _cairo_output_stream_printf().
Use it instead of %c%c in PS and PDF surfaces.
2006-06-19 22:44:39 -04:00
Carl Worth
a3f2d92f11 PDF: Don't fallback due to CAIRO_ANTIALIAS_NONE
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.
2006-06-19 11:03:32 -07:00
Kristian Høgsberg
2cea3a2710 Merge branch 'svg-rewrite' 2006-06-14 15:00:33 -04:00
Carl Worth
1d18af9f5a Merge branch 'type1-subsetting' into cairo
Conflicts:

	src/cairo-ps-surface.c
2006-06-13 15:51:57 -07:00
Carl Worth
c7b194c595 Merge branch 'truetype-subsetting' into cairo
Conflicts:

	src/Makefile.am
	src/cairo-font-subset.c
	src/cairo-pdf-surface.c
	src/cairo-ps-surface.c
2006-06-13 15:46:14 -07:00
Carl Worth
4b063c6072 PS, PDF: Re-organize handling of bitmapped fonts to avoid invalid output.
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.
2006-06-13 12:51:16 -07:00
Kristian Høgsberg
3575c942f8 Make cairo_output_stream_t an embeddable type.
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.
2006-06-12 03:07:19 -04:00
Carl Worth
b2f274b3e8 New API: Replace cairo_{ps,pdf,svg}_set_dpi with new cairo_surface_set_fallback_resolution.
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).
2006-06-09 16:52:17 -07:00
Carl Worth
746f66c3fc Fix bogus cairo_rectangle_fixed_t to be cairo_rectangle_int16_t.
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).
2006-06-06 16:54:03 -07:00
Carl Worth
ef10a0403a Remove initial, final, and duplicate blank lines.
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.
2006-06-06 15:50:33 -07:00
Carl Worth
4670366ede Remove trailing whitespace from lines that look like comments.
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).
2006-06-06 15:35:48 -07:00
Carl Worth
d0dd3b822e New API: Add new function cairo_surface_get_content
This assumes that the directfb, glitz, and quartz backends
always create surfaces with content of COLOR_ALPHA which might
be totally wrong.
2006-05-24 17:19:00 -07:00
Carl Worth
11b2481862 PDF: Add new, private test function: cairo_pdf_test_force_fallbacks 2006-05-24 14:02:30 -07:00
Carl Worth
e4476dda49 PDF: Move dash operator before path construction operators.
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.
2006-05-23 13:41:00 -07:00
Carl Worth
68b41cfd06 PDF: Share path callbacks for fill and stroke. 2006-05-23 12:13:20 -07:00
Carl Worth
7e5bef2439 PDF: Rename pdf_stroke_t to pdf_path_into_t for future sharing with fill 2006-05-23 12:13:20 -07:00