aboutsummaryrefslogtreecommitdiffstats
path: root/src/gdisp/mcufont/mf_scaledfont.h
blob: da9f47aa42c318879a741b7ad4f0adf988093602 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * This file is subject to the terms of the GFX License. If a copy of
 * the license was not distributed with this file, you can obtain one at:
 *
 *              http://ugfx.io/license.html
 */

/* Generate scaled (nearest-neighbor) fonts. This can be used for displaying
 * larger text without spending the memory required for including larger fonts.
 */

#ifndef _MF_SCALEDFONT_H_
#define _MF_SCALEDFONT_H_

#include "mf_font.h"

struct mf_scaledfont_s
{
    struct mf_font_s font;
    
    const struct mf_font_s *basefont;
    gU8 x_scale;
    gU8 y_scale;
};

MF_EXTERN void mf_scale_font(struct mf_scaledfont_s *newfont,
                             const struct mf_font_s *basefont,
                             gU8 x_scale, gU8 y_scale);

#ifdef MF_SCALEDFONT_INTERNALS
/* Internal functions, don't use these directly. */
MF_EXTERN gU8 mf_scaled_render_character(const struct mf_font_s *font,
                                              gI16 x0, gI16 y0,
                                              gU16 character,
                                              mf_pixel_callback_t callback,
                                              void *state);

MF_EXTERN gU8 mf_scaled_character_width(const struct mf_font_s *font,
                                             gU16 character);
#endif

#endif