aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-22 18:50:06 +0200
committerMattias Andrée <maandree@kth.se>2022-07-22 18:50:06 +0200
commit4932369aa6f36ccfe3193313769b976defe22b65 (patch)
treeab3ec4505812a026570d903f327a8c78d6ac3a98
parentAdd documentation (diff)
downloadlibfonts-4932369aa6f36ccfe3193313769b976defe22b65.tar.gz
libfonts-4932369aa6f36ccfe3193313769b976defe22b65.tar.bz2
libfonts-4932369aa6f36ccfe3193313769b976defe22b65.tar.xz
Improve libfonts_rendering_settings
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--libfonts.h39
1 files changed, 25 insertions, 14 deletions
diff --git a/libfonts.h b/libfonts.h
index c8f4b0c..90fc7a4 100644
--- a/libfonts.h
+++ b/libfonts.h
@@ -112,7 +112,7 @@ struct libfonts_rendering_settings {
* The output device's horizontal pixel density,
* in pixels (not dots) per inch, for the reference
* width, without output transformations applied,
- * zero if not applicable or unknown
+ * 0 if not specified
*/
double dpi_x;
@@ -120,11 +120,31 @@ struct libfonts_rendering_settings {
* The output device's vertical pixel density,
* in pixels (not dots) per inch, for the reference
* height, without output transformations applied,
- * zero if not applicable or unknown
+ * 0 if not specified
*/
double dpi_y;
/**
+ * The width, in pixels, that `.dpi_x` is calculated
+ * for; if 0, `dpi_x` shall apply regardless of
+ * current resolution and transformations
+ */
+ uint32_t reference_width;
+
+ /**
+ * The height, in pixels, that `.dpi_y` is calculated
+ * for; if 0, `.dpi_y` shall apply regardless of
+ * current resolution and transformations
+ */
+ uint32_t reference_height;
+
+ /**
+ * The output device's physical subpixel order,
+ * when it is not rotated
+ */
+ enum libfonts_subpixel_order subpixel_order;
+
+ /**
* Antialiasing mode for horizontal (on unrotated output), grey text
*/
enum libfonts_antialiasing horizontal_grey_text_antialiasing;
@@ -157,17 +177,6 @@ struct libfonts_rendering_settings {
* unrotated output), non-grey text
*/
enum libfonts_antialiasing diagonal_colour_text_antialiasing;
-
- /**
- * The output device's physical subpixel order, when it is
- * not rotated
- */
- enum libfonts_subpixel_order unrotated_subpixel_order;
-
- /**
- * TODO
- */
- struct libfonts_transformation default_transformation;
};
@@ -495,7 +504,9 @@ int libfonts_do_decoded_font_descriptions_match(const struct libfonts_font_descr
* Get the rendering settings to use for output devices
* without any specific rendering settings configured
*
- * @param settings Output parameter for the rendering settings
+ * @param settings Output parameter for the rendering settings;
+ * `settings->dpi_x` and `settings->dpi_y` will
+ * have a fallback value assigned if configured to 0
* @return 1 if rendering settings where found,
* 0 otherwise (`*settings` will be filled with fallback values),
* -1 on failure