GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_text_style.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos
4 * <jiri.bluebear.dluhos@gmail.com>
5 *
6 * Copyright (C) 2009-2024 Cyril Hrubis <metan@ucw.cz>
7 */
8
14#ifndef TEXT_GP_TEXTSTYLE_H
15#define TEXT_GP_TEXTSTYLE_H
16
17#include <text/gp_font.h>
18
19extern const gp_font_face gp_default_font;
20
70
74#define GP_DEFAULT_TEXT_STYLE { \
75 .font = &gp_default_font, \
76 .pixel_xspace = 0, \
77 .pixel_yspace = 0, \
78 .pixel_xmul = 1, \
79 .pixel_ymul = 1, \
80 .char_xspace = 0 \
81}
82
90static inline void gp_text_style_normal(gp_text_style *style, const gp_font_face *font, int mul)
91{
92 style->pixel_xspace = 0;
93 style->pixel_yspace = 0;
94 style->pixel_xmul = mul;
95 style->pixel_ymul = mul;
96 style->font = font;
97}
98
108static inline void gp_text_style_embold(gp_text_style *style, const gp_font_face *font, int mul)
109{
110 style->pixel_xspace = -1;
111 style->pixel_yspace = -1;
112 style->pixel_xmul = mul + 1;
113 style->pixel_ymul = mul + 1;
114 style->font = font;
115}
116
117#endif /* TEXT_GP_TEXTSTYLE_H */
An in-memory font description.
static void gp_text_style_embold(gp_text_style *style, const gp_font_face *font, int mul)
Sets style flags to embold a font.
static void gp_text_style_normal(gp_text_style *style, const gp_font_face *font, int mul)
Sets normal text style flags.
A font face.
Definition gp_font.h:176
A text style.
int pixel_ymul
An y multiplier of glyps pixels height (1 is default).
const gp_font_face * font
A font face.
int pixel_yspace
Spacing between glyph pixels.
int pixel_xmul
An x multiplier of glyps pixels i.e. width (1 is default).
int char_xspace
Extra spacing (in pixels) between characters.
int pixel_xspace
Spacing between glyph pixels.