sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
afadjust.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * afadjust.h
4 *
5 * Auto-fitter routines to adjust components based on charcode (header).
6 *
7 * Copyright (C) 2023-2025 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
9 *
10 * Written by Craig White <gerzytet@gmail.com>.
11 *
12 * This file is part of the FreeType project, and may only be used,
13 * modified, and distributed under the terms of the FreeType project
14 * license, LICENSE.TXT. By continuing to use, modify, or distribute
15 * this file you indicate that you have read the license and
16 * understand and accept it fully.
17 *
18 */
19
20
25#ifndef AFADJUST_H_
26#define AFADJUST_H_
27
28#include <freetype/fttypes.h>
29
30#include "afglobal.h"
31#include "aftypes.h"
32
33
34FT_BEGIN_HEADER
35
36 /*
37 * Adjustment type flags.
38 *
39 * They also specify topological constraints that the auto-hinter relies
40 * on. For example, using `AF_ADJUST_UP` implies that we have two
41 * enclosing contours, one for the base glyph and one for the diacritic
42 * above, and no other contour inbetween or above. With 'enclosing' it is
43 * meant that such a contour can contain more inner contours.
44 *
45 */
46
47 /* Find the topmost contour and push it up until its lowest point is */
48 /* one pixel above the highest point not enclosed by that contour. */
49#define AF_ADJUST_UP 0x01
50
51 /* Find the bottommost contour and push it down until its highest point */
52 /* is one pixel below the lowest point not enclosed by that contour. */
53#define AF_ADJUST_DOWN 0x02
54
55 /* Find the contour below the topmost contour and push it up, together */
56 /* with the topmost contour, until its lowest point is one pixel above */
57 /* the highest point not enclosed by that contour. This flag is */
58 /* mutually exclusive with `AF_ADJUST_UP`. */
59#define AF_ADJUST_UP2 0x04
60
61 /* Find the contour above the bottommost contour and push it down, */
62 /* together with the bottommost contour, until its highest point is */
63 /* one pixel below the lowest point not enclosed by that contour. */
64 /* This flag is mutually exclusive with `AF_ADJUST_DOWN`. */
65#define AF_ADJUST_DOWN2 0x08
66
67 /* The topmost contour is a tilde. Enlarge it vertically so that it */
68 /* stays legible at small sizes, not degenerating to a horizontal line. */
69#define AF_ADJUST_TILDE_TOP 0x10
70
71 /* The bottommost contour is a tilde. Enlarge it vertically so that it */
72 /* stays legible at small sizes, not degenerating to a horizontal line. */
73#define AF_ADJUST_TILDE_BOTTOM 0x20
74
75 /* The contour below the topmost contour is a tilde. Enlarge it */
76 /* vertically so that it stays legible at small sizes, not degenerating */
77 /* to a horizontal line. To be used with `AF_ADJUST_UP2` only. */
78#define AF_ADJUST_TILDE_TOP2 0x40
79
80 /* The contour above the bottommost contour is a tilde. Enlarge it */
81 /* vertically so that it stays legible at small sizes, not degenerating */
82 /* to a horizontal line. To be used with `AF_ADJUST_DOWN2` only. */
83#define AF_ADJUST_TILDE_BOTTOM2 0x80
84
85 /* Make the auto-hinter ignore any diacritic (either a separate contour */
86 /* or part of the base character outline) that is attached to the top */
87 /* of an uppercase base character. */
88#define AF_IGNORE_CAPITAL_TOP 0x100
89
90 /* Make the auto-hinter ignore any diacritic (either a separate contour */
91 /* or part of the base character outline) that is attached to the */
92 /* bottom of an uppercase base character. */
93#define AF_IGNORE_CAPITAL_BOTTOM 0x200
94
95 /* Make the auto-hinter ignore any diacritic (either a separate contour */
96 /* or part of the base character outline) that is attached to the top */
97 /* of a lowercase base character. */
98#define AF_IGNORE_SMALL_TOP 0x400
99
100 /* Make the auto-hinter ignore any diacritic (either a separate contour */
101 /* or part of the base character outline) that is attached to the */
102 /* bottom of a lowercase base character. */
103#define AF_IGNORE_SMALL_BOTTOM 0x800
104
105 /* By default, the AF_ADJUST_XXX flags are applied only if diacritics */
106 /* have a 'small' height (based on some heuristic checks). If this */
107 /* flag is set, no such check is performed. */
108#define AF_ADJUST_NO_HEIGHT_CHECK 0x1000
109
110 /* No adjustment, i.e., no flag is set. */
111#define AF_ADJUST_NONE 0x00
112
113
114 FT_LOCAL( FT_UInt32 )
115 af_adjustment_database_lookup( FT_UInt32 codepoint );
116
117 /* Allocate and populate the reverse character map, */
118 /* using the character map within the face. */
119 FT_LOCAL( FT_Error )
120 af_reverse_character_map_new( FT_Hash *map,
121 AF_StyleMetrics metrics );
122
123 /* Free the reverse character map. */
124 FT_LOCAL( FT_Error )
125 af_reverse_character_map_done( FT_Hash map,
126 FT_Memory memory );
127
128
129FT_END_HEADER
130
131#endif /* AFADJUST_H_ */
132
133
134/* END */