Commit graph

12859 commits

Author SHA1 Message Date
Fujii Hironori
b1bc11f646 Win32 surface compositor should support DWrite font
_cairo_win32_gdi_compositor_glyphs was falling back to the default
implementation for DWrite font because check_glyphs() returned FALSE
for CAIRO_FONT_TYPE_DWRITE.

Fixes cairo/cairo#597
2023-02-02 09:40:46 +09:00
Adrian Johnson
365bec1f7d Merge branch 'dwrite-new-api' into 'master'
DWrite: Added new API to set measuring mode and rendering params

See merge request cairo/cairo!423
2023-02-01 21:28:54 +00:00
Fujii Hironori
44e11a96a6 DWrite: Fix incorrect glyph metrics for negative glyph height
GetGdiCompatibleMetrics may return a glyph metrics that yields a small
nagative glyph height. But, it was calculated in unsigned integer.
And, it resulted in a very large glyph metrics.

Calculate glyph width and height in signed integer and let them
non-negative.
2023-02-02 05:27:18 +09:00
Fujii Hironori
bbc6cdb4ef DWrite: Added new API to set measuring mode and rendering params
Added the following API:
* cairo_dwrite_font_face_get_measuring_mode
* cairo_dwrite_font_face_get_rendering_params
* cairo_dwrite_font_face_set_measuring_mode
* cairo_dwrite_font_face_set_rendering_params
2023-02-02 05:27:18 +09:00
Fujii Hironori
cb3410b69f DWrite: Removed old unused API
Removed the following functions:
* cairo_dwrite_get_cleartype_rendering_mode
* cairo_dwrite_set_cleartype_params
* cairo_dwrite_scaled_font_get_force_GDI_classic
* cairo_dwrite_scaled_font_set_force_GDI_classic
2023-02-02 05:27:18 +09:00
Adrian Johnson
9d85055bb2 meson: Replace existing link if it already exists
Fixes #631
2023-02-01 20:10:33 +10:30
Adrian Johnson
775017ee0d Merge branch 'dwrite-cpp-header' into 'master'
Add cairo-dwrite.h header file

See merge request cairo/cairo!425
2023-02-01 08:21:12 +00:00
Adrian Johnson
d11b058c10 Fix build with -DDEBUG_SVG_RENDER 2023-02-01 06:26:09 +10:30
Uli Schlachter
d71345b51d Merge branch 'too-many-the' into 'master'
s/the the/the/

See merge request cairo/cairo!438
2023-01-31 16:28:49 +00:00
Adrian Johnson
4614892c59 s/the the/the/ 2023-01-31 20:50:01 +10:30
Adrian Johnson
1585587668 dwrite: create C++ dwrite header 2023-01-31 06:54:32 +10:30
Adrian Johnson
d252636b8a Merge branch 'fix-dwrite-crash' into 'master'
Fix dwrite crash when printing dwrite toy font

Closes #632

See merge request cairo/cairo!435
2023-01-30 20:15:22 +00:00
Adrian Johnson
e8cac307e1 Fix dwrite crash when printing dwrite toy font
Fixes #632
2023-01-30 07:19:03 +10:30
Adrian Johnson
79501baaa1 PDF Type 3 color fonts
This implements Type 3 color fonts for PDF for any font with a
CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE. This includes user-fonts,
SVG fonts, and COLR fonts.

Glyphs with foreground colors are not yet implemented as Type 3 glyphs
and will be rendered as images by cairo-surface.
2023-01-29 18:08:42 +10:30
Emmanuele Bassi
47a932bffc Merge branch 'no-more-gl' into 'master'
Drop cairo-gl

See merge request cairo/cairo!287
2023-01-29 01:32:55 +00:00
Adrian Johnson
1e8be6bbc7 Merge branch 'more-doc-fixes' into 'master'
Add missing documentation

See merge request cairo/cairo!433
2023-01-28 23:22:52 +00:00
Adrian Johnson
4739be039f Add missing documentation 2023-01-29 08:29:13 +10:30
Adrian Johnson
0a6ccabbd8 Merge branch 'documentation-updates' into 'master'
Documentation updates

See merge request cairo/cairo!431
2023-01-28 21:45:13 +00:00
Adrian Johnson
7082d96e61 Merge branch 'doc-api-index' into 'master'
doc: Further fix API indices

See merge request cairo/cairo!432
2023-01-28 21:44:47 +00:00
Khaled Hosny
7f7719fe4e doc: Further fix API indices
Actually include only the relevant symbols.
2023-01-28 18:03:00 +02:00
Adrian Johnson
b67afda591 Merge branch 'fix-ft-foreground' into 'master'
Fix foreground colors in FT/SVG/COLRv1

See merge request cairo/cairo!430
2023-01-28 04:54:26 +00:00
Adrian Johnson
5786d960e9 Mime type updates 2023-01-28 15:02:31 +10:30
Adrian Johnson
f3d04cfa44 Documentation updates 2023-01-28 14:41:24 +10:30
Adrian Johnson
ffabca7924 Merge branch 'calloc' into 'master'
[malloc-stats] Measure calloc

See merge request cairo/cairo!429
2023-01-27 20:50:31 +00:00
Emmanuele Bassi
b5793081d0 Drop cairo-gl
The GL support in Cairo has always been a prototype, and
nothing happened in the past 10+ years to make it work as
it was meant to.

GL support is not enabled by any downstream packagers of
Cairo, so nobody should notice its absence.
2023-01-27 19:21:46 +00:00
Adrian Johnson
407bb0a478 Merge branch 'dwrite-custom-palette' into 'master'
dwrite: use custom palette when rendering COLRv0

See merge request cairo/cairo!424
2023-01-27 10:44:31 +00:00
Adrian Johnson
22d0cd1ec3 Merge branch 'doc-fixes' into 'master'
Some documentation fixes

See merge request cairo/cairo!428
2023-01-27 10:26:44 +00:00
Adrian Johnson
119ce21b2c Merge branch 'dwrite-docs' into 'master'
Simplify generating dwrite-fonts docs

See merge request cairo/cairo!426
2023-01-27 10:16:55 +00:00
Adrian Johnson
bdf97dd2a1 Rename is_userfont_foreground to is_foreground_marker
as it is used by FT as well as user fonts.
2023-01-27 20:22:19 +10:30
Adrian Johnson
9e59808ecb svg: test foreground colors
Convert the ft-svg-render-palette test to a color test that test
both palettes and foreground colors.
2023-01-27 20:22:18 +10:30
Adrian Johnson
c8695f0503 Foreground color fixes for ft, svg, colrv1 2023-01-27 20:22:18 +10:30
Behdad Esfahbod
25b6775cc6 [malloc-stats] Measure calloc 2023-01-26 14:20:12 -07:00
Khaled Hosny
f05f2b3955 Fix gtk-doc syntax 2023-01-26 18:27:56 +02:00
Adrian Johnson
055ca7fb09 Merge branch 'fix-user-fonts-foreground' into 'master'
Add new cairo_user_scaled_font_get_foreground_source() function

See merge request cairo/cairo!422
2023-01-26 11:55:40 +00:00
Khaled Hosny
3cea38c02c doc: fix generation of API indices
The index id is expected to be "api-index-*" not just "index-*", and for
some reason newer versions of gtk-doc don’t like these "role" attributes
and will not generate the index if they are present. Also add missing
indices for 1.0 and 1.18.
2023-01-26 13:39:36 +02:00
Khaled Hosny
0cc13eb894 Simplify generating dwrite-fonts docs
Tell gtk-doc to scan .cpp files instead of making a proxy .c file.
2023-01-26 13:08:45 +02:00
Adrian Johnson
f35f757e8f Update user font tests to test foreground colors 2023-01-26 19:49:06 +10:30
Adrian Johnson
e93d175aac Add new cairo_user_scaled_font_get_foreground_source() function
The previous approach using foreground colors in user fonts does not
work for gradients since the foreground color is not available at the
time of recording.

Add a new function cairo_user_scaled_font_get_foreground_source() that
can be called by the color render function to retrieve the foreground
pattern. Calling this function signals to cairo that the foreground
color is used. In this case cairo will call the render function
whenever the foreground color has changed.
2023-01-26 19:49:06 +10:30
Adrian Johnson
75d876ee29 dwrite: use custom palette when rendering COLRv0 2023-01-26 13:19:53 +10:30
Adrian Johnson
0151a67e33 Merge branch 'svg-font-palette' into 'master'
Add svg font test for custom palette colors

See merge request cairo/cairo!418
2023-01-26 01:12:20 +00:00
Adrian Johnson
9ed9cfcf36 Merge branch 'fix-clear-color-glyphs' into 'master'
surface: Don't optimize away color glyphs

See merge request cairo/cairo!419
2023-01-26 01:07:44 +00:00
Behdad Esfahbod
2490c8bc0e Merge branch 'colrv1-fix-crash' into 'master'
[colrv1] Fix crash in get_palette_color

See merge request cairo/cairo!421
2023-01-24 00:27:24 +00:00
Behdad Esfahbod
3b807c1d7e [colrv1] Fix crash in get_palette_color
is_foreground_color can be NULL.
2023-01-23 16:50:48 -07:00
Matthias Clasen
ad667d4afd surface: Don't optimize away color glyphs
The surface code was optimizing away show_text_glyphs
based on the operator when the source pattern is clear.
But if we are rendering color glyphs, that is not
correct since we are using the glyphs as source.
2023-01-21 10:47:54 -05:00
Adrian Johnson
ea51a5d66a Merge branch 'fix-svg-crash' into 'master'
Fix svg renderer crash

See merge request cairo/cairo!416
2023-01-21 08:39:29 +00:00
Adrian Johnson
b68583ee54 Add test for SVG font palettes 2023-01-21 17:46:18 +10:30
Adrian Johnson
3cc9e198fd Silence make-cairo-def.sh output
This removes the following output:

  Generating src/cairo.def
  <stdin>:6:9: warning: #pragma once in main file
  <stdin>:4377:9: warning: #pragma once in main file
2023-01-21 17:19:17 +10:30
Adrian Johnson
7072f62611 Merge branch 'custom-color-palette-2' into 'master'
Add custom palettes for COLRv1 and SVG fonts

See merge request cairo/cairo!417
2023-01-21 02:13:06 +00:00
Matthias Clasen
733e298bea Reshuffle code for clarity
Only loop over custom colors if we got
a palette selected successfully.
2023-01-20 20:39:23 -05:00
Matthias Clasen
be1d41f001 Use the custom palette for COLv1 renderer
When the font options contain a custom palette,
overwrite the palette we got from freetype with
the custom entries.
2023-01-20 15:20:22 -05:00