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