Commit graph

4911 commits

Author SHA1 Message Date
Benjamin Otte
9a1f7bbc35 [API] unbreak CAIRO_FONT_TYPE_ATSUI
commit 9d61f7db80 broke API by making the
CAIRO_FONT_TYPE_ATSUI symbol not work anymore. However, this symbol was part of
Cairo's public API and should continue working this way.
2008-03-23 15:31:24 +01:00
Chris Wilson
104c2825ea [cairo-png] Set bKGD gray value.
For PNG_COLOR_TYPE_GRAY images the bKGD value is read from white.gray
which was uninitialized, triggering the "PNG warning = Ignoring attempt
to write bKGD chunk out-of-range for bit_depth" reported by Emmanuel
Pacaud. This patch sets the background gray value to white, the same as
for RGB images.
2008-03-21 09:15:42 +00:00
Adrian Johnson
c459932482 Update PS reference images
Some of the text tests require new PS specific reference images as a
result of the PS glyph positioning fix.
2008-03-21 18:12:03 +10:30
Adrian Johnson
f3a5f75701 Add PS/PDF ref images for ft-show-glyphs-positioning 2008-03-21 16:34:01 +10:30
Adrian Johnson
4f56a6324f Finish the PDF text operator decimal reduction commit
Commit 158b32b60b reduced excess
decimals emitted for the TJ operator. However it only fixed the first
of the two locations in pdf-operators where the TJ position
adjustments are emitted.
2008-03-21 16:30:53 +10:30
Adrian Johnson
13e05bffd5 Fix PS glyph positioning bug in PDF operator emulation
The emulation of the PDF 'TJ' operator in the PS prolog was
incorrectly updating the glyph position between strings. The glyph
position values are a negative x offset that are in 1/1000 unit of
text space. We were incorrectly multiplying the number by -0.0001
instead of -0.001. We also need to transform this to device space
before calling rmoveto.
2008-03-21 16:15:57 +10:30
Adrian Johnson
8348668452 Add ft-show-glyphs-positioning test
This demonstrates the glyph positioning bug in the PS backend.
2008-03-21 16:14:56 +10:30
Carl Worth
37fedd108e Increment cairo version to 1.5.15 after the 1.5.14 snapshot 2008-03-20 17:02:01 -07:00
Carl Worth
f4d4d7b3d0 Cleanup up png-test.png file in 'make clean' 2008-03-20 16:13:28 -07:00
Carl Worth
4ad5937648 Enable PLT avoidance for cairo_image_surface_get_data/stride 2008-03-20 15:55:28 -07:00
Carl Worth
5d9eefccd6 Disable enum_regexp test in check-doc-syntax.h
It's returning false positives on non-gtk-doc comments with non-public
enum values. Ick.
2008-03-20 15:37:04 -07:00
Carl Worth
0c17ca52aa Mark new cairo_xlib_visual_info functions as private. 2008-03-20 15:33:37 -07:00
Carl Worth
f32f81fa1b Increment cairo version to 1.5.14 and libtool versioning to 18:1:16 2008-03-20 13:49:29 -07:00
Carl Worth
ffa50c31d3 Doc template churn 2008-03-20 13:49:19 -07:00
Carl Worth
3bb0474ea7 NEWS: Add notes for 1.5.14 snapshot 2008-03-20 13:48:29 -07:00
Carl Worth
191440101e Fix the REFERENCE_IMAGES list, (like always before a snapshot) 2008-03-20 12:38:26 -07:00
Carl Worth
46bbead898 RELEASING: Clarify steps for verifying no unpushed modifications 2008-03-20 12:18:39 -07:00
Carl Worth
c91a2a2e80 Track minor change in pixman filtering sample location
This change in reference image was triggered by the following commit
in the pixman library:

	commit f2d8a5caa63596739b4dc47c00daaaafd9f522e2
	Author: Søren Sandmann <sandmann@redhat.com>
	Date:   Mon Mar 10 23:41:52 2008 -0400

	Add rounding epsilon for NEAREST filter after transformation, not before.

This hasn't appeared in a pixman release yet. So for now, getting
correct results is a matter of "use latest pixman". Soon we'll
have a new pixman release and we'll make cairo depend on that.
2008-03-20 11:51:57 -07:00
Carl Worth
e96f382549 Add support for 8-bit PseudoColor visuals
This support involves allocating a 16-bit grayscale ramp as well
as a 5x5x5 RGB color cube. Afterwards, the 256 colors are queried
and an array is generated mapping from r3g3b3 colors to the closest
available color. Both the queried colors and the reverse mapping
are stored in a new visual-specific cairo_xlib_visual_info_t
structure which hangs off of the cairo_xlib_screen_info_t.

Both the color-cube allocation and the distance metric could be
improved by someone sufficiently motivated, (for example, allocating
and matching in a perceptually linear color space rather than just
in RGB space). Also, making this work well in the face of a changing
color map, or in the case of GrayScale, StaticGray, or DirectColor
visuals are left entirely as exercises for the reader. StaticColor
support should be fine as is, but is entirely untested.
2008-03-20 11:51:57 -07:00
Carl Worth
d413c5ab21 xlib: Add support for arbitrary TrueColor visuals
This fixes the following bugs:

	cairo doesn't support 8-bit truecolor visuals
	https://bugs.freedesktop.org/show_bug.cgi?id=7735

	cairo doesn't support 655 xlib format
	https://bugs.freedesktop.org/show_bug.cgi?id=9719
2008-03-20 11:51:57 -07:00
Emmanuel Pacaud
aeaec94fd0 [SVG] Replace the color property by stroke.
Color property doesn't support URL as value. This pacth fixes
http://bugs.freedesktop.org/show_bug.cgi?id=14556 .
2008-03-20 16:05:34 +01:00
Adrian Johnson
158b32b60b PDF: Reduce excess decimals in text position offsets
The numbers output in the TJ array for adjusting the horizontal
position of the next glyph are in 1/1000 of the text space
units. Rounding these numbers to an integer should still provide
sufficient precision.

We use the rounded numbers to update the text position in
pdf-operators so subsequent numbers in the TJ array will compensate
for the rounding error.
2008-03-20 18:15:10 +10:30
Adrian Johnson
222041530c Use %g for printing path coordinates in pdf-operators
to eliminate unnecessary decimal places in the output.
2008-03-20 18:15:10 +10:30
Adrian Johnson
d78013470b Add %g conversion specifer to output-stream for limited precision
The %g conversion specifier is for printing numbers that were at some
time stored in a cairo_fixed_t type and as a result have their
precision limited by the size of CAIRO_FIXED_FRAC_BITS.

Using %g will limit the number of digits after the decimal point to
the minimum required to preserve the available precision.
2008-03-20 18:15:10 +10:30
Adrian Johnson
f3734085a1 Make _cairo_dtostr() static
It is only used in cairo-output-stream.c
2008-03-20 18:15:09 +10:30
Adrian Johnson
4d9e5b51aa Rescale CTM used for PS/PDF stroking to reduce rounding error
The PS/PDF CTM is transformed to the user space CTM when emitting
paths to be stroked to ensure the correct pen shape used. However this
can result in rounding errors.

For example the device space point (1.234, 3.142) when transformed to
a user space CTM of [100 0 0 100 0 0] will be emitted as
(0.012, 0.031).

Fix this by rescaling the user space CTM so that the path coordinates
emitted to the PDF file stay within the range the maximizes the
precision. The line width and dashing is also rescaled to be the same
size in the rescaled CTM.
2008-03-20 18:15:09 +10:30
Carl Worth
7f4b967c02 Make CAIRO_FORMAT_STRIDE_FOR_WIDTH_BPP available to the cairo internals. 2008-03-18 17:20:08 -07:00
Carl Worth
eb31c52feb Make _pixman_format_to_masks accept a cairo_format_masks_t structure
This makes it work similarly to _pixman_format_from_masks
2008-03-18 17:20:08 -07:00
Carl Worth
cdb1ae97f2 Move assertion failure for unsupported masks up one level
We're moving the assertion up from inside _pixman_format_to_mask
to its callers. This will allow us to selectively eliminate the
assertion from the supported xlib backend, while leaving it in
the unsupported glitz and xcb backends for now.
2008-03-18 17:20:08 -07:00
Adrian Johnson
b83b8c26f5 Optimize generated PostScript when EXTEND_PAD is used
Allow image patterns with EXTEND_PAD to use the currentfile
optimization.
2008-03-18 21:08:55 +10:30
Vladimir Vukicevic
1ab804891b [quartz] Additional test reference images for quartz 2008-03-17 17:37:24 -07:00
Vladimir Vukicevic
df5087992b [quartz] Fix bogus CGContextGetType warning that's printed on the console
This is caused by 0x0 surfaces being special, and not having an
associated cgContext.
2008-03-17 17:37:22 -07:00
Vladimir Vukicevic
9d61f7db80 [quartz] Rename ATSUI font to Quartz font 2008-03-17 17:37:19 -07:00
Adrian Johnson
e4f087b8b9 Factor out common stroke code in pdf-operators 2008-03-17 22:04:05 +10:30
Adrian Johnson
8238a9fd4f Add stroke-ctm-caps to .gitignore 2008-03-15 22:08:52 +10:30
Adrian Johnson
344af99d35 Improve the PDF operators word wrapping
to correctly count the columns and avoid breaking hex strings
immediately after the '<' and before any hex digits have been written.
2008-03-15 22:07:01 +10:30
Vladimir Vukicevic
0a8478ca1a [quartz] don't say we forced subpixel AA when we didn't
Whoops.  Net result was that this was disabling subpixel AA on
contexts if CAIRO_ANTIALIAS_DEFAULT was being used.
2008-03-14 23:23:16 -07:00
Vladimir Vukicevic
028d352286 [quartz] compare gradient stops as doubles, not as fixed point
We use the floating-point value later, and we can end up with weirdness
such as negative colors due to the precision mismatch of our fixed
point vs. floating point type.  So just do everything in floating
point.
2008-03-14 23:22:14 -07:00
Adrian Johnson
112bbacea3 Don't use fill-stroke during analysis
Instead ensure the fill and stroke are each analyzed separately.

This fixes a bug in the PS output where if a fill-stroke with a
translucent fill resulted in a fallback image with the stroke clipped
to the fill path.
2008-03-15 00:28:21 +10:30
Adrian Johnson
112b43452d Fix bug in _cairo_path_fixed_is_equal
Ensure the entire path is compared.
2008-03-15 00:18:59 +10:30
Adrian Johnson
7e83d6e6fb Do not use PDF fill-stroke operator with transparent fill
because the PDF rendering does not match cairo. See
PDF Reference 7.6.3.

Bug report at
https://bugs.launchpad.net/inkscape/+bug/202096
2008-03-14 21:37:14 +10:30
Adrian Johnson
0aef7c1a34 PDF/PS: Optimize away the stroke ctm when not required
The PDF/PS backends change the ctm to user space when emitting and
stroking a path. When the user space ctm does not alter the pen shape
we can avoid changing the ctm.

This patch optimizes the most common case where the user ctm is
[1 0 0 -1 0 y] due to conversion from cairo to PDF coordinates.
2008-03-14 19:46:51 +10:30
Adrian Johnson
2bd15d080c Add PS reference image for stroke-ctm-caps 2008-03-14 19:46:15 +10:30
Jeremy Huddleston
761b4ce8dd [mac] Correctly handle endianness in multi-architecture compiles on MacOS X 2008-03-13 17:45:25 -07:00
Vladimir Vukicevic
4cc93881d9 [test] Add testcase for previous stroker regression fix
Add Adrian's original testcase for reproducing the stroker device
vector issue.  (b4f518f917)
2008-03-13 17:30:59 -07:00
Vladimir Vukicevic
a33351f9c6 [quartz] remove some compiler warnings 2008-03-13 15:37:57 -07:00
Vladimir Vukicevic
b4f518f917 Correctly pass the device-space vector through to stroker
Part of the earlier optimization caused the wrong slope to be used for
some computations; this passes the correct slope vector down to
_compute_face.
2008-03-13 15:37:57 -07:00
Adrian Johnson
5050c55f93 Use the correct glyph metrics in Type1 fallback
Now that the PS backend is using PDF operators, it uses the glyph
metrics in the font to position each glyph in a string. This exposed a
bug in Type 1 fallback where the glyph width and height was used in
the charstrings instead of x_advance/y_advance. This was causing
strings to print diagonally due to the no zero y_advance.
2008-03-13 21:37:32 +10:30
Vladimir Vukicevic
ed452713cf [win32] Use a DIB when cloning a surface for a WIN32_PRINTING dest
In some cases we were creating a 1bpp temporary surface, losing all
color/grayscale data while printing.

Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=399388
2008-03-12 18:33:21 -07:00
Vladimir Vukicevic
6ac3eb487c [quartz] correctly force subpixel AA on a context, even if defaults say otherwise
In some cases (in my case, having an external monitor attached to my
MBP), Quartz seems to default to grayscale AA even when it should be
using subpixel AA.  CGContextGetAllowsFontSmoothing returns FALSE in
this case (pretty sure this is a Quartz bug).  We can force subpixel
AA in this case by setting CGContextSetAllowsFontSmoothing.
2008-03-12 18:33:21 -07:00