µGFX  2.9
version 2.9
mf_kerning.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 /* Automatic kerning for font rendering. This solves the issue where some
9  * fonts (especially serif fonts) have too much space between specific
10  * character pairs, like WA or L'.
11  */
12 
13 #ifndef _MF_KERNING_H_
14 #define _MF_KERNING_H_
15 
16 #include "mf_config.h"
17 #include "mf_rlefont.h"
18 
19 /* Compute the kerning adjustment when c1 is followed by c2.
20  *
21  * font: Pointer to the font definition.
22  * c1: The previous character.
23  * c2: The next character to render.
24  *
25  * Returns the offset to add to the x position for c2.
26  */
27 #if MF_USE_KERNING
28 MF_EXTERN gI8 mf_compute_kerning(const struct mf_font_s *font,
29  mf_char c1, mf_char c2);
30 #else
31 #define mf_compute_kerning(font, c1, c2) 0
32 #endif
33 
34 #endif