From a58d97a41a6192038573da6862571dc72a560458 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 23 May 2018 11:48:35 +0100 Subject: Plotters: Add plot_style_fixed type, and use for font size. --- include/netsurf/plot_style.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include/netsurf') diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h index 30db3663e..db5a5ee26 100644 --- a/include/netsurf/plot_style.h +++ b/include/netsurf/plot_style.h @@ -36,8 +36,14 @@ /** Transparent colour value. */ #define NS_TRANSPARENT 0x01000000 -/** Scaling factor for font sizes */ -#define FONT_SIZE_SCALE 1024 +/** 22:10 fixed point */ +#define PLOT_STYLE_RADIX (10) + +/** Scaling factor for plot styles */ +#define PLOT_STYLE_SCALE (1 << PLOT_STYLE_RADIX) + +/* type for fixed point numbers */ +typedef int32_t plot_style_fixed; /** * Type of plot operation @@ -90,7 +96,7 @@ typedef enum { */ typedef struct plot_font_style { plot_font_generic_family_t family; /**< Generic family to plot with */ - int size; /**< Font size, in points * FONT_SIZE_SCALE */ + plot_style_fixed size; /**< Font size, in pt */ int weight; /**< Font weight: value in range [100,900] as per CSS */ plot_font_flags_t flags; /**< Font flags */ colour background; /**< Background colour to blend to, if appropriate */ -- cgit v1.2.3