diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-07-28 17:08:45 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-07-28 17:08:45 +1000 |
commit | 3977ee687ffff23e49dcac0ea9a7c3e8652248f0 (patch) | |
tree | c5be0359998987d29b6be213413c896fe4d6b07f /src/gdisp/mcufont/mf_kerning.h | |
parent | f84bc2a3f6b82b0f05319fd7c609f8b30929d788 (diff) | |
download | uGFX-3977ee687ffff23e49dcac0ea9a7c3e8652248f0.tar.gz uGFX-3977ee687ffff23e49dcac0ea9a7c3e8652248f0.tar.bz2 uGFX-3977ee687ffff23e49dcac0ea9a7c3e8652248f0.zip |
First cut - beautiful new font handling by PetteriAimonen
Diffstat (limited to 'src/gdisp/mcufont/mf_kerning.h')
-rw-r--r-- | src/gdisp/mcufont/mf_kerning.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gdisp/mcufont/mf_kerning.h b/src/gdisp/mcufont/mf_kerning.h new file mode 100644 index 00000000..ed885162 --- /dev/null +++ b/src/gdisp/mcufont/mf_kerning.h @@ -0,0 +1,29 @@ +/* Automatic kerning for font rendering. This solves the issue where some + * fonts (especially serif fonts) have too much space between specific + * character pairs, like WA or L'. + */ + +#ifndef _MF_KERNING_H_ +#define _MF_KERNING_H_ + +#include "mf_config.h" +#include "mf_rlefont.h" + +/* Compute the kerning adjustment when c1 is followed by c2. + * + * font: Pointer to the font definition. + * c1: The previous character. + * c2: The next character to render. + * + * Returns the offset to add to the x position for c2. + */ +#if MF_USE_KERNING +MF_EXTERN int8_t mf_compute_kerning(const struct mf_font_s *font, + mf_char c1, mf_char c2); +#else +static int8_t mf_compute_kerning(const struct mf_font_s *font, + mf_char c1, mf_char c2) +{ return 0; } +#endif + +#endif
\ No newline at end of file |