aboutsummaryrefslogtreecommitdiffstats
path: root/src/gdisp/mcufont/mf_kerning.h
blob: c6c2dcc7ad3d8164ff057ee9ea0d07382b933b60 (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
/*
 * 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
 */

/* 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 gI8 mf_compute_kerning(const struct mf_font_s *font,
                                    mf_char c1, mf_char c2);
#else
#define mf_compute_kerning(font, c1, c2)		0
#endif

#endif