Commit graph

1957 commits

Author SHA1 Message Date
Kristian Høgsberg
fb7ae2a28e Remember to call cairo_type1_font_subset_destroy(). 2006-05-18 21:01:20 -04:00
Kristian Høgsberg
1d2b60454f Consolidate a few arrays into a array of structs. 2006-05-18 20:50:36 -04:00
Kristian Høgsberg
6d53687058 Look for /-| or /RD tokens to determine the charstring delimiter tokens. 2006-05-18 20:03:53 -04:00
Kristian Høgsberg
d09d95a323 Track glyph subset indices and use them in the output. 2006-05-18 15:10:05 -04:00
Kristian Høgsberg
5f55ae7d91 Make ps surface use type1 subset 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.
2006-05-18 13:57:03 -04:00
Kristian Høgsberg
fe58e7a81f Only use the word wrap stream when emitting paths.
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().
2006-05-18 13:35:57 -04:00
Kristian Høgsberg
2fafbac390 Use RD and ND for delimiting glyph data instead of -| and |-.
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.
2006-05-18 02:24:02 -04:00
Kristian Høgsberg
466d3da4ef Add code to emit type1 dicts to the pdf backend. 2006-05-18 02:16:45 -04:00
Kristian Høgsberg
c36de5b7c5 Pull in type1 subset code from the cvs repo it was sitting in. 2006-05-18 02:16:45 -04:00
Kristian Høgsberg
127fab4695 Remember to call _cairo_truetype_subset_fini() after outputting subset. 2006-05-18 02:12:06 -04:00
Kristian Høgsberg
b16c29ff0c Set libcairo_font_subset_sources for ps, pdf, and svg backends.
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.
2006-05-17 01:30:43 -04:00
Kristian Høgsberg
d42b2c7a89 Remember to destroy cairo_pdf_ft_font_t once we've generated the subset.
Also, remove cairo_private from function definitions.
2006-05-16 23:56:38 -04:00
Kristian Høgsberg
f3209660c3 Print out ps comment in the truetype emit code and update type3 ps comment. 2006-05-16 23:24:09 -04:00
Kristian Høgsberg
3975d7f8a2 Add support for truetype subset to ps backend.
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.
2006-05-16 23:20:08 -04:00
Kristian Høgsberg
2c6e799ee6 Switch to using Tm for text positioning and scale type3 fonts to unit size.
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.
2006-05-16 22:53:05 -04:00
Kristian Høgsberg
e846dca44e Hook _cairo_truetype_subset_init() up to existing truetype subset code.
This is a minimal first change to get things working.  The truetype
subset code still needs to be renamed and moved around a bit.
2006-05-16 21:41:07 -04:00
Kristian Høgsberg
f4f11eba5b Output pdf dicts for truetype subset fonts. 2006-05-16 19:01:15 -04:00
Kristian Høgsberg
13a05830f5 Update pdf font emit code to try to emit a truetype subset before type3. 2006-05-16 16:42:44 -04:00
Carl Worth
05b1d2f9c5 PDF: Fix broken per-page sizes in PDF output.
This was first broken in:

	PDF: Fold (unused) cairo_pdf_document_t into cairo_pdf_surface_t
	f500cef19f

Thanks, git bisect!
2006-05-16 01:04:59 -07:00
Kristian Høgsberg
d70ade00fb Merge branch 'master' of git://git.freedesktop.org/git/cairo 2006-05-15 17:53:56 -04:00
Kristian Høgsberg
41d435418c Documentation fixes (cairo_font_create -> cairo_scaled_font_create). 2006-05-15 17:36:12 -04:00
Carl Worth
c7ef4cb3f3 ROADMAP: Note that PDF type 3 font support is done 2006-05-15 10:25:44 -07:00
Carl Worth
621ebc4726 pixman: Remove unused code to quiet compiler warnings 2006-05-15 10:16:06 -07:00
Carl Worth
636cbe5a19 pixman: Add default case to quiet compiler warning 2006-05-15 10:15:40 -07:00
Carl Worth
2e4c8924ad pixman: Fix build to enable warnings again 2006-05-15 10:07:57 -07:00
Carl Worth
bf2ab0de92 PDF: Add Type3 font support to PDF output.
This uses the recently added cairo-scaled-font-subsets interface in a
style very similar to what the PS surface does.
2006-05-15 10:04:53 -07:00
Carl Worth
6f417fed51 PDF: Move Resources dictionary up from Page objects to Pages object.
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).
2006-05-15 10:00:18 -07:00
Carl Worth
049100fb87 PDF: Use consistent style for typedef struct and macro naming. 2006-05-15 09:52:57 -07:00
Carl Worth
45d0540c33 PS: Remove the fallback case from _cairo_ps_surface_show_glyphs
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.
2006-05-15 09:41:36 -07:00
Carl Worth
cb32b41a4e PS: Fix arguments to setcachedevice
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.
2006-05-15 09:39:16 -07:00
Carl Worth
e2c03d51da Change scaled_font_subsets_callback to have return type of void.
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.
2006-05-15 09:34:27 -07:00
Carl Worth
f500cef19f PDF: Fold (unused) cairo_pdf_document_t into cairo_pdf_surface_t 2006-05-12 14:56:11 -07:00
Carl Worth
d84a1cac1c PDF: Use cairo_pdf_resource_t more consistently.
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.
2006-05-12 13:31:12 -07:00
Tim Mooney
b7e9506707 bug #6890: fix the signature for main() in pthread-show-text 2006-05-10 20:51:53 -07:00
Carl Worth
1ba537be18 Fix memory leak in _cairo_scaled_font_subsets_foreach 2006-05-10 19:01:40 -07:00
Carl Worth
7bd3a037da Add documentation for the _cairo_scaled_font_subsets interface. 2006-05-10 18:52:36 -07:00
Carl Worth
7c137b7e2c SVG: Discard custom font subsetting in favor of sharing cairo-scaled-font-subsets 2006-05-10 15:14:10 -07:00
Carl Worth
f459c1f0de Tweak names to match those of cairo-scaled-font-subsets
Also, remove a now obsolete field from cairo_ps_surface_t
2006-05-10 15:12:53 -07:00
Carl Worth
8a209e6ad9 Fix cairo_output_stream_destroy to do nothing on nil stream objects. 2006-05-10 14:50:31 -07:00
Carl Worth
0544515279 Generalize font subsetting code in cairo-scaled-font-subsets for use by more than just PS backend 2006-05-10 14:47:28 -07:00
Carl Worth
906a17a6b1 Rename cairo-ps-font to cairo-scaled-font-subsets (file names only) 2006-05-10 14:40:32 -07:00
Carl Worth
f7f9bdc05b PS: Put functions in more logical order. 2006-05-09 14:40:37 -07:00
Carl Worth
f3703b1806 PS: Move type 3 support out into cairo-ps-font.c
This is in preparation for generalizing this code for sharing among
several backends.
2006-05-09 14:40:36 -07:00
Carl Worth
7ebdf4825d PS: Remove stale comment (the stuff TODO is done already) 2006-05-09 14:40:36 -07:00
Carl Worth
172fd2f6a6 Fix typo in select-font-face.c and update reference images 2006-05-09 14:39:08 -07:00
Carl Worth
f0d7e3f858 Add select-font-face test for whosing multiple faces at once. 2006-05-09 14:15:27 -07:00
Carl Worth
9595de96ac ROADMAP: non-substantive changes 2006-05-08 17:41:17 -07:00
Emmanuel Pacaud
7d0bcc3f1c SVG: Emit glyphs at the beginning of defs section. 2006-05-06 15:31:53 +02:00
Emmanuel Pacaud
1da2ca0f35 SVG: Implementation of glyph cache
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.
2006-05-06 14:56:20 +02:00
Emmanuel Pacaud
09e94c6a31 SVG: Add reference images for fill-and-stroke-alpha.
It fails on a one digit color error.
2006-05-05 20:31:48 +02:00