Pixman 0.42.3 added PIXMAN_r8g8b8_sRGB to pixman_format_code_t. CI
fails if it is missing from switch statements. Building with pixman <
0.42.3 will fail if the enum is used. So put it in a versioned #if.
Without this, building with
CFLAGS="-DDEBUG_SVG_RENDER" meson setup path/to/source
simply does not work for me:
test/svg/svg-render.c:74:(.text+0x40): undefined reference to `_cairo_debug_svg_render'
collect2: error: ld returned 1 exit status
After marking this symbol as exported, this just works.
Signed-off-by: Uli Schlachter <psychon@znc.in>
- If a link has both 'dest' and 'uri', the 'dest' will be used if it
exists, otherwise it will fallback to using the 'uri'.
- Ensure that a missing 'dest' does not result in an error. Instead a
warning is printed if CAIRO_DEBUG_TAG is set, and a link to the
current location is embedded in the PDF. ie the link does
nothing. Cairo needs to embed a link even if no destination is
available because when links are embedded at the end of the
document, the content stream already contains link tags.
- Remove cairo_pdf_interchange_write_forward_links. This code was
originally used prior to !463 when cairo wrote the links at the end
of each page. Now the links are written at the end of the document
so there are no longer any forward links with an unknown
destination, unless the destination does not exist.
- When 'internal' is not used, use the 'dest' name to reference the
link. Ensure non ASCII names are correctly encoded.
GCC 12.2 reports the following warning:
[3/16] Compiling C object util/cairo-script/libcairo-script-interpreter.so.2.11801.1.p/cairo-script-scanner.c.o
../util/cairo-script/cairo-script-scanner.c:1562:38: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion]
if (real >= INT32_MIN && real <= INT32_MAX && (int) real == real)
~~ ^~~~~~~~~
/usr/include/stdint.h:123:22: note: expanded from macro 'INT32_MAX'
^~~~~~~~~~
Solaris defines alloca in the <alloca.h> header
../src/cairo-colr-glyph-render.c: In function ‘add_sweep_gradient_patches’:
../src/cairo-colr-glyph-render.c:661:14: error: implicit declaration of
function ‘alloca’ [-Werror=implicit-function-declaration]
661 | angles = alloca (sizeof (double) * cl->n_stops);
| ^~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
../../br-test-pkg/bootlin-armv5-uclibc/build/cairo-1.17.4/meson.build:279:13:
ERROR: Can not run test applications in this cross environment.
Commit 1bec56ea8a added support to define
ipc_rmid_deferred_release in a cross-compile config, but still kept
the default to auto, which anyhow results in an error when cross-compiling.
There is only one usage of the ipc_rmid_deferred_release compile declarative
which was originally added in this commit: 5041b462d0.
If ipc_rmid_deferred_release is set to FALSE, an additional XSync is performed.
This doesn't sound very harmful, so that is why this commit defaults to FALSE
and thus avoids any cross-compile errors.
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
In particular, with bitmap fonts, a floating-point error was affecting
y_bearing, yielding a value close to an integer instead of the integer
exactly. The change consists in replacing some operations of the form
A * (1/B) by A/B. Details of the issue in #503.
This new code will not always avoid rounding errors in final values
when these values could be exact, but it makes some of these errors
disappear.
The changes in the src/cairo-ft-font.c code consists of:
* Define the SCALE() macro (with some explanations in a comment).
* Remove the declarations and definitions of x_factor and y_factor.
* Update the code to use SCALE() instead of x_factor and y_factor.
perl -pi -e 's{(DOUBLE_\w+) ?(\(.*\)) \* ([xy])_factor}
{SCALE (\1 \2, unscaled->\3_scale)}' \
src/cairo-ft-font.c
* Replace the remaining 0 * x_factor and 0 * y_factor by 0.
Commit cf351a8a attempted to convert the font generation in
'_cairo_quartz_font_create_for_toy' to use CTFontCreateWithName and that uses
only Postscript Names, meaning with the hyphens.
Commit c6dc5df6 converted back to CGFont. CGFontCreateWithFontName is supposed
to work with Postscript Names, but it seems sometimes it does not.
In case a CGFont cannot be created using Postscript Names, attempt unhyphenated
version of font family name.
Specially important for font variations, which before did not
work in PDF, etc, output.
Script surface is not updated. It seems out of date with all
recent additions to cairo_font_options_t, so it loses the
variations :(.
Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/819
Since a user-font might be calling stroke, and PDF has separate
stroke and fill colors.
Note that this bug was not exposed in Poppler. It's probably a
bug there. But multiple other viewers expoed this bug.
Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/813
GCC 14 introduces a new -Walloc-size included in -Wextra which gives:
```
src/cairo-ps-surface.c:3524:18: warning: allocation of insufficient size ‘1’ for type ‘cairo_ps_form_t’ {aka ‘struct _cairo_ps_form’} with size ‘88’ [-Walloc-size]
```
The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```
So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(cairo_ps_form_t)`. GCC then sees we're not
doing anything wrong.
Signed-off-by: Sam James <sam@gentoo.org>