Commit graph

12345 commits

Author SHA1 Message Date
Adrian Johnson
e7da8451f8 Update long-lines test 2022-05-28 16:14:31 +09:30
Adrian Johnson
47a21c6e30 Clamp path coordinates
Fixes https://gitlab.freedesktop.org/poppler/poppler/-/issues/1250
2022-05-28 16:03:50 +09:30
Uli Schlachter
5dafd74116 Merge branch 'srcdir' into 'master'
Make it easier for cairo-test-suite to find the source dir

See merge request cairo/cairo!328
2022-05-20 13:07:41 +00:00
Behdad Esfahbod
b41cfe3fe0 [unicode] Non-characters are allowed in Unicode strings
https://www.unicode.org/faq/private_use.html#nonchar_codes

Fixes https://github.com/harfbuzz/harfbuzz/issues/3590
2022-05-18 17:35:38 -06:00
Adrian Johnson
29acc55849 Make it easier for cairo-test-suite to find the source dir 2022-05-19 06:44:58 +09:30
Adrian Johnson
e562ff757b Merge branch 'view-test-results' into 'master'
Python script to view test results

See merge request cairo/cairo!327
2022-05-17 21:17:36 +00:00
Adrian Johnson
6fec25a51f python script to view tests results
testtables.js no longer works in modern browsers as local file access
has been disabled. This script runs a python http server that serves
the contents of the current directory then opens the test results in
the webbrowser
2022-05-17 16:49:02 +09:30
Uli Schlachter
a0dfb2c073 Merge branch 'master' into 'master'
Add exec_prefix to cairo-script-interpreter.pc.in

See merge request cairo/cairo!324
2022-05-15 06:22:27 +00:00
Pierre Labastie
c087722141 Update util/cairo-script/cairo-script-interpreter.pc.in 2022-05-14 16:56:17 +00:00
Adrian Johnson
e32b2c34f1 Merge branch 'mingw-ci' into 'master'
Add mingw-32 and mingw-64 CI builds

See merge request cairo/cairo!321
2022-05-09 21:31:16 +00:00
Adrian Johnson
4823aa606b Merge branch 'warnings' into 'master'
Add -Werror for meson CI build

See merge request cairo/cairo!320
2022-05-09 21:30:35 +00:00
Emmanuele Bassi
6e3cacc90f Merge branch 'ft-default-lcd-filter' into 'master'
Set default LCD filter to FreeType's default

See merge request cairo/cairo!1
2022-05-09 21:18:04 +00:00
Nikolaus Waxweiler
b50b168a2e Set default LCD filter to FreeType's default 2022-05-09 21:16:28 +01:00
Uli Schlachter
a0e7e472c8 Merge branch 'dwrite-svg-fix' into 'master'
dwrite: Fix incorrect rendering of some SVG fonts

See merge request cairo/cairo!322
2022-05-08 18:03:25 +00:00
Adrian Johnson
7c037e5254 dwrite: Fix incorrect rendering of some SVG fonts
SVG fonts are returning DWRITE_GLYPH_IMAGE_FORMATS_NONE as well
as DWRITE_GLYPH_IMAGE_FORMATS_SVG in GetCurrentRun() resulting in the
outline glyph and color glyph both rendered to the same glyph image.
2022-05-08 20:28:41 +09:30
Adrian Johnson
e485bb1e26 Add mingw-32 and mingw-64 CI builds 2022-05-07 20:16:39 +09:30
Adrian Johnson
0f770dbce2 Add -Werror for meson CI build 2022-05-07 17:45:02 +09:30
Adrian Johnson
0ea231fae5 Fix GL warnings 2022-05-07 17:45:02 +09:30
Adrian Johnson
455a4cca54 Merge branch 'quartz-core-text' into 'master'
quartz: support rendering colored bitmap fonts

See merge request cairo/cairo!289
2022-04-27 00:04:43 +00:00
John Ralls
cfb3835f57 [quartz] Add wiggle test for quartz emoji. 2022-04-26 15:52:04 -07:00
Adrian Johnson
f07d539c07 Merge branch 'issue-514' into 'master'
pdf: reset current operator when resetting clip

Closes #514

See merge request cairo/cairo!256
2022-04-26 12:58:41 +00:00
John Ralls
2784159d0e [quartz] Adjust x_extents metric.
CoreText uses different advances depending on the font size, with very
small point sizes sometimes getting advances that are smaller than the
glyph's width. This is manifested in the Apple Color Emoji font with the
Emoji glyphs having a width of 1.25 and an advance width of 1.0. That
results in overlapping emoji when they're in a string.

The small spacing difference also affects 3 tests so updated reference
images are included in this commit.

 # Please enter the commit message for your changes. Lines starting
2022-04-25 11:30:10 -07:00
John Ralls
c755e48c2e [quartz] Implement color font support. 2022-04-25 11:29:52 -07:00
Uli Schlachter
fafbfcda91 Merge branch 'issue562' into 'master'
[quartz] Destroy local copy of snapshot after attaching it.

Closes #562

See merge request cairo/cairo!316
2022-04-25 14:34:38 +00:00
Adrian Johnson
eee2b9ab9a Merge branch 'fix-color-glyph' into 'master'
Fix the scaled_glyph_init color glyph logic

See merge request cairo/cairo!314
2022-04-25 12:46:13 +00:00
Adrian Johnson
4815949d2f Fix the scaled_glyph_init color glyph logic
and split _cairo_user_scaled_glyph_init() into multiple functions.

Update user-font test to test changing foreground text color.
2022-04-25 17:08:07 +09:30
Adrian Johnson
cdcb67ef87 Merge branch 'fix-color-glyph-clear-surface' into 'master'
Fix rendering of color glyphs on a clear surface

Closes #539

See merge request cairo/cairo!283
2022-04-25 05:15:52 +00:00
John Ralls
c6dc5df612 [quartz] Convert font handling from CGFont to CTFont. 2022-04-24 13:08:48 -07:00
John Ralls
cf351a8a0a Reimplement cairo-quartz-font with Core Text. 2022-04-24 13:08:48 -07:00
John Ralls
77a8d0f9e4 [quartz] Require at least Mac OS X 10.7 Lion
Allows removal of most conditional compilation and dlsym lookups.
2022-04-24 13:08:48 -07:00
John Ralls
0048f0f803 [quartz] Fix some compiler warnings. 2022-04-24 13:08:48 -07:00
Adrian Johnson
083ff4b511 Merge branch 'color-font-vector-surface' into 'master'
Paint color glyphs in fallback resolution on vector surfaces

See merge request cairo/cairo!293
2022-04-24 12:26:20 +00:00
John Ralls
243938c61a [quartz] Destroy local copy of snapshot after attaching it.
Because cairo_surface_snapshot_attach refs the snapshot.

Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/562
2022-04-23 16:38:01 -07:00
Uli Schlachter
d9a5aa9d97 Merge branch 'issue558' into 'master'
fixed double free in _cairo_ps_surface_emit_base85_string

Closes #558

See merge request cairo/cairo!312
2022-04-23 05:26:22 +00:00
Uli Schlachter
5b662c925c Merge branch 'fix-uaf-stream_internal' into 'master'
Fix a use after free in _cairo_svg_surface_create_for_stream_internal

Closes #561

See merge request cairo/cairo!315
2022-04-22 16:34:39 +00:00
Uli Schlachter
0614305093 Merge branch 'fix-double-free-mono-scan' into 'master'
Fix a double free in _cairo_mono_scan_converter_create

Closes #557

See merge request cairo/cairo!313
2022-04-22 15:49:56 +00:00
Feysh INC
d7cb417e0e Fix a use after free in _cairo_svg_surface_create_for_stream_internal
When `_cairo_svg_surface_create_for_document()` failed, it will free the
`document` by `_cairo_svg_document_destroy()`. But after `_cairo_svg_surface_create_for_document` return a error status, the `document` is still used and destoryed by `_cairo_svg_document_destroy()`.

We remove the redundant `_cairo_svg_document_destroy()` in `_cairo_svg_surface_create_for_stream_internal` to avoid this bug.

This fixes #561.

Signed-off-by: Feysh INC <opensource@feysh.com>
2022-04-22 21:24:09 +08:00
Adrian Johnson
04232d9871 Merge branch 'font-status' into 'master'
Check font status in show_text_glyphs

See merge request cairo/cairo!307
2022-04-22 12:32:21 +00:00
Feysh INC
fa8f456c2b Fix a use after free in cairo_scaled_font_create
When `font_face` is freed by `cairo_font_face_destroy()` at line 1,150,
the following call `_cairo_font_face_set_error (font_face, status)`
causes a use after free.

We moved up the `_cairo_font_face_set_error (font_face, status)` before
`cairo_font_face_destroy()` to avoid the use after free.

Signed-off-by: Feysh INC <opensource@feysh.com>
2022-04-22 17:09:47 +08:00
Feysh INC
99cd4bb3bd Fix a double free in _cairo_mono_scan_converter_create
When `_mono_scan_converter_init` failed,
`self->converter->polygon` will be freed by `polygon_fini()`. However,
the `bail` branch still called `polygon_fini()` to free
`self->converter->polygon`.

We remvoe the redundant `polygon_fini()` in `_mono_scan_converter_init`
to avoid the double free.

This fixes #557.

Signed-off-by: Feysh INC <opensource@feysh.com>
2022-04-22 16:43:59 +08:00
Ayman El Didi
a154424db3 fixed double free in _cairo_ps_surface_emit_base85_string
When taking the CAIRO_PS_COMPRESS_DEFLATE branch of the switch
statement in _cairo_ps_surface_emit_base85_string, memory is freed
a second time when closing the deflate_stream fails after performing a
write.

The status is now simply returned instead of attempting to free it
again.
2022-04-20 15:11:14 -06:00
Uli Schlachter
a934fa66db Merge branch 'dwrite-fixes' into 'master'
DWrite fixes

See merge request cairo/cairo!311
2022-04-19 16:17:26 +00:00
Adrian Johnson
e15a1e9a06 Fix mingw warning
it doesn't like '%lld' in snprintf
2022-04-19 19:58:44 +09:30
Adrian Johnson
90e6f2a9f7 DWrite: Replace manual or missing ref counting with RefPtr 2022-04-19 19:58:44 +09:30
Adrian Johnson
3998a79cc2 DWrite: check 'head' table as well as 'name' when comparing fonts
There may be different versions of fonts with the same name. As an
additional check, compare the 'head' table wich contains the checksum
for the font.

Also, load the DWrite tables directly to avoid the memcpy in
load_truetype_table.
2022-04-19 19:58:44 +09:30
Adrian Johnson
2b355954a8 DWrite: ensure all private functions are static 2022-04-19 19:58:44 +09:30
Adrian Johnson
655a8a40a7 Dwrite glyph_path fails when the font matrix is not a positive uniform scale 2022-04-19 19:58:44 +09:30
Adrian Johnson
75f0ecb34e Fix Win64 compile warning 2022-04-19 19:58:44 +09:30
Adrian Johnson
1cc23206bd Fix scaled_glyph hash lookup on Win64
This was failing due to sizeof(uintptr_t) != sizeof(long) on Win64
2022-04-19 19:58:44 +09:30
Adrian Johnson
6454f65ec5 Allow the C++ code in dwrite-font to use the debug functions 2022-04-19 19:58:44 +09:30