Commit graph

1412 commits

Author SHA1 Message Date
Behdad Esfahbod
16c18aea52 [PDF] Fix leak: free glyphs 2006-08-08 15:30:56 -04:00
Behdad Esfahbod
ac4922bd07 [TrueType] Zero out padding memory in generated TrueType subset
to make the output deterministic and fix valgrind errors.
2006-08-08 15:27:21 -04:00
Behdad Esfahbod
356e646dc6 [FreeType] Unset and set to FC_RGBA_NONE the FC_RGBA attribute on pattern
if we don't want it.  This stuff is tricky, but I hope to explain:  In your
fontconfig configuration, you may match on "font", or on "pattern".  Turning
subpixel on typically looks like:

        <match target="font">
		<test qual="all" name="rgba">
			<const>unknown</const>
		</test>
		<edit name="rgba" mode="assign"><const>rgb</const></edit>
	</match>

This works good enough, and if you set to ANTIALIAS_GRAY, this will not
override that.  Now one may forget to match on "font" target, or intentionally
match on the pattern.  That happens before cairo font options are substituted
in the pattern.  So, to give a hint of subpixel in your config file, you can
write:

        <match target="pattern">
		<edit name="rgba" mode="assign"><const>rgb</const></edit>
	</match>

You don't really need to check for current values, as FcConfigSubstitute is
run before merging cairo_font_options_t in.  What this patch does, is to reset
pattern's rgba property if the font options explicitly ask for ANTIALIAS_GRAY.
This is the only place in cairo-ft-font.c that we use FcPatternDel, so I
thought some explanation is needed.
2006-08-08 14:04:51 -04:00
Behdad Esfahbod
6ff531c182 [TrueType] Add comment block describing why we only use int16_t 2006-08-08 13:13:18 -04:00
Behdad Esfahbod
23f3888618 [TrueType] More leak fixes 2006-08-08 07:39:31 -04:00
Behdad Esfahbod
519bd3d3e9 [TrueType] Fix leaks. 2006-08-08 07:30:46 -04:00
Behdad Esfahbod
501e5cc883 Restructure subpixel_order handling such that the code doesn't look suspicious!
Shouldn't make /any/ difference at all in any case.
2006-08-08 06:12:13 -04:00
Behdad Esfahbod
89fc22de87 [fontconfig] Set FC_RGBA_NONE on the pattern if we don't want subpixel.
otherwise, it looks like "I don't care" and fontconfig configuration is
allowed to decide to turn subpixel on.  This fixes the bug that subpixel
colors where showing up in fallback images in PS/PDF/SVG backends, observed
in the test fallback-resolution.
2006-08-08 06:09:23 -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
2d483e0785 test-paginated: Fix memory leak within _test_paginated_surface_create_for_data 2006-08-08 02:24:48 -07:00
Carl Worth
c3b912d7db Eliminate most compiler warnings from the test suite 2006-08-08 01:16:49 -07:00
Carl Worth
401f0ce3c4 Merge branch 'surface-font-options' into cairo 2006-08-08 00:19:51 -07:00
Behdad Esfahbod
77fd0efa9a Fix few remaining compiler warnings, revealed by -O3 2006-08-08 02:58:50 -04:00
Carl Worth
02b54ca620 Improve docs for cairo_surface_create_similar() 2006-08-07 23:47:46 -07:00
Behdad Esfahbod
caba7f6bda Document a few more functions
cairo_show_page
	cairo_copy_page
	cairo_in_stroke
	cairo_in_fill
2006-08-08 02:24:16 -04:00
Carl Worth
789785cd35 Document CAIRO_FORMAT_RGB16_565 as deprecated. 2006-08-07 23:13:09 -07:00
Behdad Esfahbod
fdc805a529 More doc syntax update 2006-08-07 22:28:59 -04:00
Behdad Esfahbod
bbc9a1290a Update doc syntax
Annoying, but a function doc should have a body, not only "Returns", or
gtk-doc will not pick it up.
2006-08-07 22:27:15 -04:00
Behdad Esfahbod
50be7951c9 Split the TrueType table definitions into a private header file
such that we can test the struct sizes in a test.
2006-08-07 21:23:08 -04:00
Behdad Esfahbod
ec895202e0 Remove the __attribute__ ((packed)) and the need for it
as it's not portable and lack of it could seriously break the truetype
subsetting code.  Now, instead of using int32_t and int64_t, we use
multiple int16_t items, to avoid any alignments.  Fortunately, we are
not using any of the fields involved, so no code changes necessary.
2006-08-07 21:13:48 -04: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
7ee94c0285 Squelch an annoying -Wswitch-enum warning by not using switch 2006-08-07 14:30:06 -07:00
Carl Worth
43b579d757 Add -Wswitch-enum compiler flag and fix all trivial warnings 2006-08-07 14:30:06 -07:00
Behdad Esfahbod
d1f9bef30e Add -Wunsafe-loop-optimizations compiler flag and fix all warnings 2006-08-07 14:24:32 -07:00
Behdad Esfahbod
0071102208 Add -Wwrite-strings compiler flag and fix all warnings 2006-08-07 13:13:33 -07:00
Carl Worth
9ae66174e7 Fix bug 7294 by adding pixman BGR formats and internal cairo BGR formats.
This approach to fixing the bug is valid since there is code in pixman
for rendering to BGR images, (which is why cairo 1.0 worked with BGR X
servers for example). But, since we don't want to advertise additional
image formats we implement this through a new cairo_internal_format_t.

This is rather fragile since we don't want to leak any internal formats
nor do we ever want an internal format to be used somewhere a real
format is expected, (and trigger a CAIRO_FORMAT_VALID assertion failure).
More comments than code are added here to help compensate for the
fragility and to give some guidance in fixing this mess in a better way
in the future.
2006-08-07 11:19:19 -07:00
Adrian Johnson
f4b12e497b Make truetype subsetting work on x86_64
This fixes the bug reported against GTK+ here:
	http://bugzilla.gnome.org/show_bug.cgi?id=349826
2006-08-07 11:07:08 -07:00
Declan Naughton
7724c575b0 Fix typos in internal documentation. 2006-08-07 10:33:15 -07:00
Carl Worth
caa9abc9ee Fix file handle leak in failure path (bug 7616) 2006-08-07 10:28:40 -07:00
Alfred Peng
04757a3aa8 Add definition of cairo_private for some Sun compilers.
In addition to helping us preserve a sharp line between which symbols are
part of the public API and which are private parts of the implementation,
this can also help mozilla avoid clashes between its modified, internal
copy of cairo and the system version of cairo. See the mozilla bug here:

https://bugzilla.mozilla.org/show_bug.cgi?id=341874
2006-08-07 08:41:13 -07:00
Chris Wilson
e2fddcccb4 Fix memory leak in _cairo_surface_show_glyphs (bug 7766) 2006-08-04 17:16:35 -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
Carl Worth
2815d9ad38 Use base pointer to avoid compiler warning. 2006-08-03 19:28:11 -07:00
Carl Worth
1feb4291cf Apply device_transform during meta-surface replay to fix bug 7533 2006-08-03 19:26:50 -07:00
Carl Worth
8c953167ba Simplify common set_clip operation in meta-surface replay. 2006-08-03 19:26:50 -07:00
Behdad Esfahbod
34a0b728fb Fail FreeType load_truetype_table on vertical fonts as we don't do it
right now.  Failing disables the subsetting for vertical fonts, like
it was being done before the recent changes to the TrueType subsetter.
2006-08-03 00:20:35 -04:00
Kristian Høgsberg
30f004d55a Rename truetype subset function to _cairo_truetype_*.
Used to be _cairo_pdf_ft_*, a left over from when this code was
specific to the PDF backend.
2006-08-02 19:30:55 -04:00
Kristian Høgsberg
f664a3b7a0 Renamed cairo-font-subset.c to cairo-truetype-subset.c 2006-08-02 19:30:55 -04: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
Michael Emmel
c05dd48ac1 Merge branch 'master' of ssh+git://git.cairographics.org/git/cairo 2006-08-02 14:32:50 -07:00
Michael Emmel
e0bec64c98 Fixed debug statement that broke compile 2006-08-02 14:32:24 -07:00
Kristian Høgsberg
0da4b9319f Drop unused src/cairo-font-subset-private.h. 2006-08-02 15:18:56 -04:00
Adrian Johnson
067d97eb17 This patch fixes the problem where the postscript output
does not print when the size of the embedded truetype font
exceeds 64k.
2006-08-02 15:17:09 -04:00
Behdad Esfahbod
9fcb3c32c1 Set fallback resolution in create_similar. Update docs to reflect that. 2006-07-31 14:50:50 -04:00
Behdad Esfahbod
a61ac1aeed Set font_options on image surfaces we create.
This may not be really necessary as we only create image surfaces as
temporary surfaces and their font options should not be sampled normally.
2006-07-31 14:47:10 -04:00
Behdad Esfahbod
b3341b4eda Let backends return NULL in create_similar to take the fallback path.
Make xlib backend use it.
2006-07-31 14:45:54 -04:00
Behdad Esfahbod
bdb4e1edad Implement per-surface font options.
New internal function _cairo_surface_set_font_options is used to set them.
cairo_surface_create_similar propagates the font options of the other
surface into the newly created surface.  Fixes bugs with font options in
fallback images and bug 4106.
2006-07-31 14:44:42 -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
Ian Osgood
72b51b6f0c XCB: implement set_clip_region 2006-07-31 09:59:09 -07:00