43 case CSS_FONT_FAMILY_SERIF:
46 case CSS_FONT_FAMILY_MONOSPACE:
49 case CSS_FONT_FAMILY_CURSIVE:
52 case CSS_FONT_FAMILY_FANTASY:
55 case CSS_FONT_FAMILY_SANS_SERIF:
75 case CSS_FONT_WEIGHT_100:
78 case CSS_FONT_WEIGHT_200:
81 case CSS_FONT_WEIGHT_300:
84 case CSS_FONT_WEIGHT_400:
85 case CSS_FONT_WEIGHT_NORMAL:
89 case CSS_FONT_WEIGHT_500:
92 case CSS_FONT_WEIGHT_600:
95 case CSS_FONT_WEIGHT_700:
96 case CSS_FONT_WEIGHT_BOLD:
99 case CSS_FONT_WEIGHT_800:
102 case CSS_FONT_WEIGHT_900:
118 enum css_font_variant_e variant)
122 if (style == CSS_FONT_STYLE_ITALIC)
124 else if (style == CSS_FONT_STYLE_OBLIQUE)
127 if (variant == CSS_FONT_VARIANT_SMALL_CAPS)
136 const css_unit_ctx *unit_len_ctx,
137 const css_computed_style *css,
140 lwc_string **families;
141 css_fixed length = 0;
142 css_unit unit = CSS_UNIT_PX;
146 css_computed_font_family(css, &families));
149 css_computed_font_size(css, &length, &unit);
150 fstyle->
size = FIXTOINT(FMUL(css_unit_font_size_len2pt(css,
151 unit_len_ctx, length, unit),
160 css_computed_font_variant(css));
162 css_computed_color(css, &col);
static int plot_font_weight(enum css_font_weight_e css)
Map a CSS font weight to a plot weight value.
void font_plot_style_from_css(const css_unit_ctx *unit_len_ctx, const css_computed_style *css, plot_font_style_t *fstyle)
Populate a font style using data from a computed CSS style.
static plot_font_flags_t plot_font_flags(enum css_font_style_e style, enum css_font_variant_e variant)
Map a CSS font style and font variant to plot font flags.
static plot_font_generic_family_t plot_font_generic_family(enum css_font_family_e css)
Map a generic CSS font family to a generic plot font family.
Internal font handling interfaces.
#define nscss_color_to_ns(c)
Convert a CSS color to a NetSurf colour primitive.
plotter style interfaces, generic styles and style colour helpers.
plot_font_flags_t
Font plot flags.
plot_font_generic_family_t
Generic font family type.
@ PLOT_FONT_FAMILY_CURSIVE
@ PLOT_FONT_FAMILY_SANS_SERIF
@ PLOT_FONT_FAMILY_FANTASY
@ PLOT_FONT_FAMILY_MONOSPACE
#define PLOT_STYLE_SCALE
Scaling factor for plot styles.
plot_font_generic_family_t family
Generic family to plot with.
colour foreground
Colour of text.
lwc_string *const * families
Array of pointers to font families.
plot_font_flags_t flags
Font flags.
plot_style_fixed size
Font size, in pt.
colour background
Background colour to blend to, if appropriate.
int weight
Font weight: value in range [100,900] as per CSS.
Option reading and saving interface.
#define nsoption_int(OPTION)
Get the value of an integer option.