version 2.8
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.org/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  uint8_t x_scale;
23  uint8_t y_scale;
24 };
25 
26 MF_EXTERN void mf_scale_font(struct mf_scaledfont_s *newfont,
27  const struct mf_font_s *basefont,
28  uint8_t x_scale, uint8_t y_scale);
29 
30 #ifdef MF_SCALEDFONT_INTERNALS
31 /* Internal functions, don't use these directly. */
32 MF_EXTERN uint8_t mf_scaled_render_character(const struct mf_font_s *font,
33  int16_t x0, int16_t y0,
34  uint16_t character,
35  mf_pixel_callback_t callback,
36  void *state);
37 
38 MF_EXTERN uint8_t mf_scaled_character_width(const struct mf_font_s *font,
39  uint16_t character);
40 #endif
41 
42 #endif