[cairo-commit] 3 commits - doc/public src/cairo-font-options.c src/cairo-pdf-surface.c src/cairo-ps-surface.c src/win32
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Jan 28 21:45:15 UTC 2023
doc/public/cairo-sections.txt | 8 +++++++
src/cairo-font-options.c | 34 ++++++++++++++++++++-----------
src/cairo-pdf-surface.c | 8 +++----
src/cairo-ps-surface.c | 8 ++++---
src/win32/cairo-win32-printing-surface.c | 3 ++
5 files changed, 43 insertions(+), 18 deletions(-)
New commits:
commit 0a6ccabbd8fe8b612886a3ee0284cc42d8ab5aa9
Merge: 7082d96e6 5786d960e
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sat Jan 28 21:45:13 2023 +0000
Merge branch 'documentation-updates' into 'master'
Documentation updates
See merge request cairo/cairo!431
commit 5786d960e9d873942a18cc22834358b5e2cbe40a
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sat Jan 28 15:02:31 2023 +1030
Mime type updates
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index e3a27ed81..28e01ea5b 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -133,10 +133,10 @@
* The PDF surface is used to render cairo graphics to Adobe
* PDF files and is a multi-page vector surface backend.
*
- * The following mime types are supported: %CAIRO_MIME_TYPE_JPEG,
- * %CAIRO_MIME_TYPE_JP2, %CAIRO_MIME_TYPE_UNIQUE_ID,
- * %CAIRO_MIME_TYPE_JBIG2, %CAIRO_MIME_TYPE_JBIG2_GLOBAL,
- * %CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID,
+ * The following mime types are supported on source patterns:
+ * %CAIRO_MIME_TYPE_JPEG, %CAIRO_MIME_TYPE_JP2,
+ * %CAIRO_MIME_TYPE_UNIQUE_ID, %CAIRO_MIME_TYPE_JBIG2,
+ * %CAIRO_MIME_TYPE_JBIG2_GLOBAL, %CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID,
* %CAIRO_MIME_TYPE_CCITT_FAX, %CAIRO_MIME_TYPE_CCITT_FAX_PARAMS.
*
* # JBIG2 Images #
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index a5008df88..a37af4c5a 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -119,9 +119,8 @@ static char *ctime_r(const time_t *timep, char *buf)
* The PostScript surface is used to render cairo graphics to Adobe
* PostScript files and is a multi-page vector surface backend.
*
- * The following mime types are supported: %CAIRO_MIME_TYPE_JPEG,
- * %CAIRO_MIME_TYPE_UNIQUE_ID,
- * %CAIRO_MIME_TYPE_CCITT_FAX, %CAIRO_MIME_TYPE_CCITT_FAX_PARAMS,
+ * The following mime types are supported on source patterns:
+ * %CAIRO_MIME_TYPE_JPEG, %CAIRO_MIME_TYPE_UNIQUE_ID,
* %CAIRO_MIME_TYPE_CCITT_FAX, %CAIRO_MIME_TYPE_CCITT_FAX_PARAMS,
* %CAIRO_MIME_TYPE_EPS, %CAIRO_MIME_TYPE_EPS_PARAMS.
*
@@ -219,8 +218,11 @@ static const char * _cairo_ps_level_strings[CAIRO_PS_LEVEL_LAST] =
static const char *_cairo_ps_supported_mime_types[] =
{
CAIRO_MIME_TYPE_JPEG,
+ CAIRO_MIME_TYPE_UNIQUE_ID,
CAIRO_MIME_TYPE_CCITT_FAX,
CAIRO_MIME_TYPE_CCITT_FAX_PARAMS,
+ CAIRO_MIME_TYPE_EPS,
+ CAIRO_MIME_TYPE_EPS_PARAMS,
NULL
};
diff --git a/src/win32/cairo-win32-printing-surface.c b/src/win32/cairo-win32-printing-surface.c
index 01a8e37aa..a3dd907c2 100644
--- a/src/win32/cairo-win32-printing-surface.c
+++ b/src/win32/cairo-win32-printing-surface.c
@@ -2154,6 +2154,9 @@ _cairo_win32_printing_surface_supports_fine_grained_fallbacks (void *abstract_su
* provide correct complex rendering behaviour; cairo_surface_show_page() and
* associated methods must be used for correct output.
*
+ * The following mime types are supported on source patterns:
+ * %CAIRO_MIME_TYPE_JPEG, %CAIRO_MIME_TYPE_PNG.
+ *
* Return value: the newly created surface
*
* Since: 1.6
commit f3d04cfa447c2e0b767c1465aa1a61c89591e7da
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sat Jan 28 14:41:24 2023 +1030
Documentation updates
diff --git a/doc/public/cairo-sections.txt b/doc/public/cairo-sections.txt
index 4b07fa3c7..a4a89dbbf 100644
--- a/doc/public/cairo-sections.txt
+++ b/doc/public/cairo-sections.txt
@@ -515,6 +515,14 @@ cairo_font_options_set_hint_metrics
cairo_font_options_get_hint_metrics
cairo_font_options_get_variations
cairo_font_options_set_variations
+cairo_color_mode_t
+cairo_font_options_set_color_mode
+cairo_font_options_get_color_mode
+CAIRO_COLOR_PALETTE_DEFAULT
+cairo_font_options_set_color_palette
+cairo_font_options_get_color_palette
+cairo_font_options_set_custom_palette_color
+cairo_font_options_get_custom_palette_color
</SECTION>
<SECTION>
diff --git a/src/cairo-font-options.c b/src/cairo-font-options.c
index 458f2c77d..361882ae5 100644
--- a/src/cairo-font-options.c
+++ b/src/cairo-font-options.c
@@ -700,6 +700,14 @@ cairo_font_options_get_color_mode (const cairo_font_options_t *options)
return options->color_mode;
}
+/**
+ * CAIRO_COLOR_PALETTE_DEFAULT:
+ *
+ * The default color palette index.
+ *
+ * Since: 1.18
+ **/
+
/**
* cairo_font_options_set_color_palette:
* @options: a #cairo_font_options_t
@@ -709,11 +717,11 @@ cairo_font_options_get_color_mode (const cairo_font_options_t *options)
* object. OpenType color fonts with a CPAL table may contain multiple
* palettes. The default color palette index is %CAIRO_COLOR_PALETTE_DEFAULT.
*
- * #cairo_font_options_t can also contain a custom palette, which will
- * be used if @palette_index is %CAIRO_COLOR_PALETTE_CUSTOM.
- *
* If @palette_index is invalid, the default palette is used.
*
+ * Individual colors within the palette may be overriden with
+ * cairo_font_options_set_custom_palette_color().
+ *
* Since: 1.18
**/
void
@@ -730,7 +738,7 @@ cairo_font_options_set_color_palette (cairo_font_options_t *options,
* cairo_font_options_get_color_palette:
* @options: a #cairo_font_options_t
*
- * Gets the OpenType color font palette for the font options object.
+ * Gets the current OpenType color font palette for the font options object.
*
* Return value: the palette index
*
@@ -754,11 +762,14 @@ cairo_font_options_get_color_palette (const cairo_font_options_t *options)
* @blue: blue component of color
* @alpha: alpha component of color
*
- * Sets a custom palette color for the font options object.
+ * Sets a custom palette color for the font options object. This
+ * overrides the palette color at the specified color index. This override is
+ * independent of the selected palette index and will remain in place
+ * even if cairo_font_options_set_color_palette() is called to change
+ * the palette index.
*
- * The custom colors will be used in preference to the selected
- * color palette from the font (see cairo_font_options_set_color_palette()).
- * It is possible to override only selected colors from the font palette.
+ * It is only possible to override color indexes already in the font
+ * palette.
*
* Since: 1.18
*/
@@ -803,10 +814,11 @@ cairo_font_options_set_custom_palette_color (cairo_font_options_t *options,
* @blue: return location for blue component of color
* @alpha: return location for alpha component of color
*
- * Gets a custom palette color for the font options object.
+ * Gets the custom palette color for the color index for the font options object.
*
- * Returns: `CAIRO_STATUS_SUCCESS` if a custom palette color is returned,
- * `CAIRO_STATUS_INVALID_INDEX` otherwise.
+ * Returns: `CAIRO_STATUS_SUCCESS` if a custom palette color is
+ * returned, `CAIRO_STATUS_INVALID_INDEX` if no custom color exists
+ * for the color index.
*
* Since: 1.18
*/
More information about the cairo-commit
mailing list