2013-07-28 07:22:24 +00:00
|
|
|
/*
|
|
|
|
* 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.org/license.html
|
|
|
|
*/
|
|
|
|
|
2013-07-28 07:08:45 +00:00
|
|
|
/* 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;
|
|
|
|
uint8_t x_scale;
|
|
|
|
uint8_t y_scale;
|
|
|
|
};
|
|
|
|
|
|
|
|
MF_EXTERN void mf_scale_font(struct mf_scaledfont_s *newfont,
|
|
|
|
const struct mf_font_s *basefont,
|
|
|
|
uint8_t x_scale, uint8_t y_scale);
|
|
|
|
|
2013-08-17 13:32:53 +00:00
|
|
|
#ifdef MF_SCALEDFONT_INTERNALS
|
|
|
|
/* Internal functions, don't use these directly. */
|
|
|
|
MF_EXTERN uint8_t mf_scaled_render_character(const struct mf_font_s *font,
|
|
|
|
int16_t x0, int16_t y0,
|
2015-06-08 04:14:40 +00:00
|
|
|
uint16_t character,
|
2013-08-17 13:32:53 +00:00
|
|
|
mf_pixel_callback_t callback,
|
|
|
|
void *state);
|
|
|
|
|
|
|
|
MF_EXTERN uint8_t mf_scaled_character_width(const struct mf_font_s *font,
|
2015-06-08 04:14:40 +00:00
|
|
|
uint16_t character);
|
2013-08-17 13:32:53 +00:00
|
|
|
#endif
|
|
|
|
|
2013-07-28 07:08:45 +00:00
|
|
|
#endif
|