Commit graph

12738 commits

Author SHA1 Message Date
Dan Rosser
1dbc8a999a Edit cairo-wideint-type-private.h 2025-07-18 00:17:17 +10:00
Dan Rosser
cef78ffa01 Fix for VS Build type cast errors #785 2023-07-05 02:57:46 +10:00
Adrian Johnson
2919f392d3 Merge branch 'check-def-arches' into 'master'
meson-check-def: Exclude sections from symbol list seen on ARM & MIPS

See merge request cairo/cairo!488
2023-07-03 21:34:58 +00:00
Adrian Johnson
718e577adf Merge branch 'fix-no-png-build' into 'master'
Disable svg glyph renderer when PNG is disabled

Closes #784

See merge request cairo/cairo!489
2023-07-03 21:27:48 +00:00
Uli Schlachter
5ef0375a7d Disable svg glyph renderer when PNG is disabled
When trying to build with -Dpng=disabled with a new enough FreeType
version, the build would fail in cairo-svg-glyph-renderer.c:

    src/cairo-svg-glyph-render.c:1841:15: error: implicit declaration of
    function ‘cairo_image_surface_create_from_png_stream’; did you mean
    ‘cairo_image_surface_create_for_data’?
    [-Werror=implicit-function-declaration]

Fix this by disabling HAVE_FT_SVG_DOCUMENT when png is not enabled.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/784
Signed-off-by: Uli Schlachter <psychon@znc.in>
2023-07-03 18:06:17 +02:00
Uli Schlachter
e7aa3a4c09 Merge branch 'hurd' into 'master'
Hurd has no MAP_NORESERVE so don't use it there

See merge request cairo/cairo!486
2023-07-03 15:06:14 +00:00
Jeremy Bícha
5118007b06 meson-check-def: Exclude sections from symbol list seen on mips 2023-07-03 09:30:51 -04:00
Jeremy Bícha
67c0202674 meson-check-def: Exclude sections from symbol list seen on ARM 2023-07-03 09:30:48 -04:00
Sebastian Dröge
baf2593852 Hurd has no MAP_NORESERVE so don't use it there 2023-07-02 10:19:06 -04:00
Uli Schlachter
0317aafd3f Merge branch 'fix-signed-left-shift' into 'master'
Avoid undefined signed left shift

See merge request cairo/cairo!484
2023-07-01 07:49:34 +00:00
Adrian Johnson
afac8b0e7d Avoid undefined signed left shift
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1841190
2023-06-30 18:43:00 +09:30
Uli Schlachter
42555cb0a7 Merge branch 'tag_stack' into 'master'
Fix use-after-free in _cairo_tag_stack_pop

See merge request cairo/cairo!483
2023-06-29 15:11:17 +00:00
Jonathan Kew
4e0f76473f Fix use-after-free in _cairo_tag_stack_pop 2023-06-29 12:52:33 +00:00
Adrian Johnson
d68eb3c8df Merge branch 'fix-colrv0-handling' into 'master'
Fix rendering of COLRv0 fonts

See merge request cairo/cairo!482
2023-06-06 22:01:01 +00:00
Matthias Clasen
05c6bb4ce1 Fix rendering of COLRv0 fonts
This was found while debugging why The Twemoji Mozilla
font renders a white-on-while in pango.

We need to call _render_glyph_bitmap, since we want
FT_Render_Glyph to handle the COLRv0 layers for us.
2023-06-06 14:44:52 -04:00
Adrian Johnson
111095d9dd Merge branch 'update-to-fedora-38' into 'master'
Update CI to Fedora 38

See merge request cairo/cairo!474
2023-06-05 22:18:33 +00:00
Adrian Johnson
90fda58934 Fix PS crash with color font and CAIRO_COLOR_MODE_NO_COLOR 2023-06-05 22:04:46 +09:30
Adrian Johnson
c381a773de Update CI to Fedora 38 2023-06-05 22:04:33 +09:30
Uli Schlachter
38873d2568 Merge branch 'fix-leftover' into 'master'
Remove stray #error in dw-extra.h

See merge request cairo/cairo!481
2023-05-31 15:06:51 +00:00
Luca Bacci
50225f55ba Remove stray #error in dw-extra.h 2023-05-31 12:28:56 +02:00
Adrian Johnson
a2def1bd06 Merge branch 'ci-bump-windows-image' into 'master'
ci: bump windows image to latest

See merge request cairo/cairo!480
2023-05-30 22:00:03 +00:00
Tim-Philipp Müller
bb5577616c ci: bump windows image to latest 2023-05-29 11:06:06 +01:00
Adrian Johnson
0d7e0dcb17 Merge branch 'issue-782' into 'master'
Use a spinlock to prevent race condition when initializing mutexes

Closes #782

See merge request cairo/cairo!478
2023-05-27 10:20:57 +00:00
Adrian Johnson
46e538ddbb Use a spinlock to prevent race condition when initializing mutexes
Fixes #782
2023-05-27 19:01:47 +09:30
Adrian Johnson
9831eba0ec Merge branch 'issue-778' into 'master'
ft: don't use scaled_glyph->dev_private to store data

Closes #778

See merge request cairo/cairo!476
2023-05-13 22:07:36 +00:00
Adrian Johnson
10cc34f521 ft: don't use scaled_glyph->dev_private to store data
It is also used by the xlib surface.

Fixes #778
2023-05-13 18:53:16 +09:30
Adrian Johnson
8d6586f49f Merge branch 'issue-777' into 'master'
Don't assume HAVE_FT_PALETTE_SELECT is defined when HAVE_FT_SVG_DOCUMENT is defined

Closes #777

See merge request cairo/cairo!475
2023-04-30 08:35:19 +00:00
Adrian Johnson
b86f24634c Don't assume HAVE_FT_PALETTE_SELECT is defined when HAVE_FT_SVG_DOCUMENT is defined
Fixes #777
2023-04-30 17:26:36 +09:30
Adrian Johnson
17ed347819 Merge branch 'issue-508' into 'master'
Fix cairo_tag_begin/end in groups

Closes #508

See merge request cairo/cairo!463
2023-04-18 11:06:46 +00:00
Adrian Johnson
de9452438e pdf: Don't use snprintf() to print floats
It is not locale independent.
2023-04-18 18:27:12 +09:30
Adrian Johnson
b53b48116e Make cairo_tag_begin/end work correctly in groups
Fixes #508
2023-04-18 18:27:12 +09:30
Adrian Johnson
e7ed40a71d cairo-list-inline.h: fixes and documentation
- Fix a bug in cairo_list_is_singular
- Rename cairo_list_swap() to cairo_list_move_list()
  to better describe what it is doing.
2023-04-16 20:17:09 +09:30
Adrian Johnson
5e74744dff Merge branch 'issue-776' into 'master'
win32: InterlockedCompareExchange uses LONG

Closes #776

See merge request cairo/cairo!472
2023-04-16 10:10:03 +00:00
Adrian Johnson
10747fe813 Merge branch 'ci-windows-image-update' into 'master'
ci: bump windows image to latest and add workflow rules

See merge request cairo/cairo!473
2023-04-16 10:06:43 +00:00
Tim-Philipp Müller
47ec81544f ci: add some more workflow rules
cargo-culted from the ci-templates template.
2023-04-16 10:19:22 +01:00
Tim-Philipp Müller
8322ef3733 ci: bump windows image to latest 2023-04-16 10:10:56 +01:00
Adrian Johnson
16074af6a1 win32: InterlockedCompareExchange uses LONG
Fixes #776
2023-04-13 06:03:22 +09:30
Adrian Johnson
ec14ec47f7 Merge branch 'riastradh-20220406-ctype-misuse' into 'master'
Avoid misuse of ctype(3) functions

See merge request cairo/cairo!309
2023-03-29 10:28:10 +00:00
Taylor R Campbell
b1ccd52183 Avoid misuse of ctype(3) functions
The ctype(3) character classification and mapping functions have a
peculiarly limited definition (C11, Sec. 7.4 `Character handling
<ctype.h>', p. 200):

	`The header <ctype.h> declares several functions useful for
	 classifying and mapping characters.  In all cases the
	 argument is an int, the value of which shall be
	 representable as an unsigned char or shall equal the value
	 of the macro EOF.  If the argument has any other value, the
	 behavior is undefined.'

In other words, in the most common case of 8-bit char and EOF = -1,
the domain of the 257 allowed arguments is:

	-1, 0, 1, 2, ..., 254, 255

The ctype(3) functions are designed for use with stdio functions like
getchar and fgetc which return int values in the same domain.

In an ABI where char is signed (e.g., x86 SysV ABI used by most
Unixish operating systems), passing an argument of type char as is
can go wrong in two ways:

1. The value of a non-EOF input octet interpreted as `char' may
   coincide, as an integer, with the value of EOF, leading to wrong
   answers for some non-EOF inputs.

   E.g., if EOF = 1, and an input octet has all bits set, i.e., 255
   as an unsigned char, then as a char the value is -1, which will be
   confused with EOF.  In the ISO-8859-1 locale, the code point 255
   is (in Unicode terminology) LATIN SMALL LETTER Y WITH DIAERESIS,
   for which isprint, isalpha, &c., are true.  But isprint, isalpha,
   &c., are false for EOF.  So if char *s points to a string with
   that character, isprint(*s) will return false when it should
   return true.

2. Passing a negative char whose value does not coincide with EOF is
   undefined behaviour.

   This isn't purely theoretical: often the functions are implemented
   by an array lookup, #define isprint(c) (ctypetab[c] & ISPRINT).
   If c is out of range (e.g., 192, ISO-8859-1 for LATIN CAPITAL
   LETTER A WITH GRAVE, which convers to (signed) char as -64), then
   you can get garbage answers by reading uninitialized memory or
   application crashes with SIGSEGV if the page preceding the table
   is unmapped.

If what you have is an arbitrary char (e.g., from a char * string
pointing at user input), then the only correct way to use the
ctype(3) functions is by converting to unsigned char first -- e.g.,
isprint((unsigned char)*s).  (If the functions were defined as macros
that convert to unsigned char first, they would then spuriously
interpret EOF as a non-EOF, so they can't do that themselves.)

It is possible, in some cases, to prove that the input always
actually lies in {0, 1, 2, ..., 127}, so the conversion to unsigned
char is not necessary.  I didn't check whether this was the case --
it's safer to just adopt the habit of always casting char to unsigned
char first before using the ctype(3) macros, which satisfies a
compiler warning on some systems designed to detect this class of
application errors at compile-time.
2023-03-29 09:04:46 +00:00
Uli Schlachter
d2b44eccb7 Merge branch 'patch-1' into 'master'
Delete cairo/perf/make-html.py

See merge request cairo/cairo!448
2023-03-26 09:54:13 +00:00
Emmanuele Bassi
ae60e48ac6 Merge branch 'gi-text-glyphs' into 'master'
[gobject] Bind cairo_glyph_t and cairo_text_cluster_t

See merge request cairo/cairo!468
2023-03-10 13:28:37 +00:00
Behdad Esfahbod
d08e348dd6 [gobject] Bind cairo_glyph_t and cairo_text_cluster_t 2023-03-09 13:04:50 -07:00
Adrian Johnson
d4d027d353 Merge branch 'issue-643' into 'master'
Fix missing glyphs in ft-font

Closes #643

See merge request cairo/cairo!467
2023-03-07 19:22:04 +00:00
Adrian Johnson
2766d9feec ft: Use normal font size when detecting the format
The format may depend on the font size.

Fixes #643
2023-03-07 19:41:39 +10:30
Uli Schlachter
af5a25a7f1 Merge branch 'unused-function' into 'master'
Fix -Wunused-function warnings

See merge request cairo/cairo!449
2023-03-03 15:50:32 +00:00
Uli Schlachter
3b178e8586 Merge branch 'ofz46165' into 'master'
ofz#46165 avoid a divide by zero seen fuzzing libreoffice rendering

See merge request cairo/cairo!351
2023-03-03 15:46:03 +00:00
Adrian Johnson
1f9004b3d0 Merge branch 'issue-3-win32-font-scale' into 'master'
win32 font is very small if the lfHeight of HFONT is exactly -size

Closes #3

See merge request cairo/cairo!466
2023-03-02 21:31:33 +00:00
Emmanuele Bassi
79c6beee90 Merge branch 'drop-xml-surface' into 'master'
Remove XML surface

See merge request cairo/cairo!446
2023-03-02 19:22:44 +00:00
Fujii Hironori
aa0aca3c65 win32 font is very small if the lfHeight of HFONT is exactly -size
cairo_win32_font_face_create_for_hfont is reusing the HFONT object
passed by an argument if possible to create a scaled font. However,
the condition was wrong. It checked the font matrix scale factor is
`-lfHeight`. But it should be `-lfHeight * WIN32_FONT_LOGICAL_SCALE`.

Fixes cairo/cairo#3
2023-03-03 04:15:10 +09:00
Adrian Johnson
beb28b7679 Merge branch 'dont-free-nonheap-object' into 'master'
Open-code bbtree_del to avoid free()ing a non-allocated object

Closes #645

See merge request cairo/cairo!465
2023-03-01 21:22:28 +00:00