µGFX  2.9
version 2.9
src/gdisp/mcufont/mf_scaledfont.h
1 /*
2  * This file is subject to the terms of the GFX License. If a copy of
3  * the license was not distributed with this file, you can obtain one at:
4  *
5  * http://ugfx.io/license.html
6  */
7 
8 /* Generate scaled (nearest-neighbor) fonts. This can be used for displaying
9  * larger text without spending the memory required for including larger fonts.
10  */
11 
12 #ifndef _MF_SCALEDFONT_H_
13 #define _MF_SCALEDFONT_H_
14 
15 #include "mf_font.h"
16 
17 struct mf_scaledfont_s
18 {
19  struct mf_font_s font;
20 
21  const struct mf_font_s *basefont;
22  gU8 x_scale;
23  gU8 y_scale;
24 };
25 
26 MF_EXTERN void mf_scale_font(struct mf_scaledfont_s *newfont,
27  const struct mf_font_s *basefont,
28  gU8 x_scale, gU8 y_scale);
29 
30 #ifdef MF_SCALEDFONT_INTERNALS
31 /* Internal functions, don't use these directly. */
32 MF_EXTERN gU8 mf_scaled_render_character(const struct mf_font_s *font,
33  gI16 x0, gI16 y0,
34  gU16 character,
35  mf_pixel_callback_t callback,
36  void *state);
37 
38 MF_EXTERN gU8 mf_scaled_character_width(const struct mf_font_s *font,
39  gU16 character);
40 #endif
41 
42 #endif