From 4932369aa6f36ccfe3193313769b976defe22b65 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 22 Jul 2022 18:50:06 +0200 Subject: Improve libfonts_rendering_settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libfonts.h | 39 +++++++++++++++++++++++++-------------- 1 file 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,10 +120,30 @@ 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 */ @@ -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 -- cgit v1.2.3-70-g09d2