[autofit] Add files necessary for adjustment database
* src/autofit/afadjust.h header file for adjustment database functions * src/autofit/afadjust.c will contain implementations of the adjustment database functions
This commit is contained in:
parent
55d0287cfc
commit
573649c1ae
|
@ -0,0 +1,138 @@
|
|||
#include "afadjust.h"
|
||||
#include <freetype/freetype.h>
|
||||
#include <freetype/internal/ftobjs.h>
|
||||
#include <freetype/internal/ftmemory.h>
|
||||
#include <freetype/internal/ftdebug.h>
|
||||
|
||||
#define AF_ADJUSTMENT_DATABASE_LENGTH ( sizeof(adjustment_database)/sizeof(adjustment_database[0]) )
|
||||
#undef FT_COMPONENT
|
||||
#define FT_COMPONENT afadjust
|
||||
|
||||
/*
|
||||
All entries in this list must be sorted by unicode codepoint ascending
|
||||
The table entries are 3 numbers consisting of:
|
||||
- unicode codepoint. THESE MUST BE LISTED IN ASCENDING ORDER
|
||||
- the vertical adjustment type. This should be one of the enum constants in AF_VerticalSeparationAdjustmentType
|
||||
- 1 if the topmost contour is a tilde and should be prevented from flattening.
|
||||
*/
|
||||
FT_LOCAL_ARRAY_DEF( AF_AdjustmentDatabaseEntry )
|
||||
adjustment_database[] =
|
||||
{
|
||||
{0x21, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /* ! */
|
||||
{0x69, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /* i */
|
||||
{0x6A, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /* j */
|
||||
{0xA1, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*Inverted Exclamation Mark*/
|
||||
{0xBF, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /* j */
|
||||
{0xA1, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*Inverted Exclamation Mark*/
|
||||
{0xBF, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*Inverted Question Mark*/
|
||||
{0xC0, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*A with grave*/
|
||||
{0xC1, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*A with acute*/
|
||||
{0xC2, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*A with circumflex*/
|
||||
{0xC3, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*A with tilde*/
|
||||
{0xC8, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*E with grave*/
|
||||
{0xCC, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*I with grave*/
|
||||
{0xCD, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xCE, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xD1, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xD2, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xD3, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xD4, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xD5, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xD9, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xD1, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xDB, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xDD, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xE0, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xE1, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xE2, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xE3, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 1}, /*a with tilde*/
|
||||
{0xE8, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xE9, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xEA, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xEC, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xED, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xEE, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xF1, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}, /*n with tilde*/
|
||||
{0xF2, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xF3, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xF4, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xF5, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 1}, /*o with tilde*/
|
||||
{0xF9, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xFA, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xFB, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0xFD, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x100, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x101, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x102, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x103, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x106, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x108, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x109, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x10A, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x10B, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x10C, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x10D, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x10E, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x112, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x113, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x114, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x115, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x116, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x117, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x11B, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x11C, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x11D, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x11E, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x11F, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x120, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x121, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x123, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x124, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x125, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x128, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x129, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 1}, /*i with tilde*/
|
||||
{0x12A, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x12B, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x12C, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x12D, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x12F, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x130, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x134, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x135, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x139, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x13A, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x143, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x144, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x147, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x14C, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x14D, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x14E, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x14F, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x154, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x155, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x158, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x159, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x15A, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x15B, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x15C, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x15D, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x160, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x161, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x164, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x168, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x169, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 1}, /*u with tilde*/
|
||||
{0x16A, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x16B, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x16C, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x16D, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x174, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x175, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x176, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x177, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x179, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x17A, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x17B, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x17C, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x17D, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0},
|
||||
{0x17E, AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 0}
|
||||
};
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef AFADJUST_H_
|
||||
#define AFADJUST_H_
|
||||
|
||||
#include <freetype/fttypes.h>
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*The type of adjustment that should be done to prevent cases where 2 parts of a character*/
|
||||
/*stacked vertically merge, even though they should be separate*/
|
||||
typedef enum AF_VerticalSeparationAdjustmentType_
|
||||
{
|
||||
/*This means that the hinter should find the topmost contour and push it up until its lowest point is 1 pixel*/
|
||||
/*above the highest point not part of that contour.*/
|
||||
AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP,
|
||||
|
||||
/*This is the opposite direction. The hinter should find the bottommost contour*/
|
||||
/*And push it down until there is a 1 pixel gap*/
|
||||
AF_VERTICAL_ADJUSTMENT_BOTTOM_CONTOUR_DOWN,
|
||||
|
||||
AF_VERTICAL_ADJUSTMENT_NONE
|
||||
} AF_VerticalSeparationAdjustmentType;
|
||||
|
||||
typedef struct AF_AdjustmentDatabaseEntry_ {
|
||||
FT_UInt32 codepoint;
|
||||
AF_VerticalSeparationAdjustmentType vertical_separation_adjustment_type;
|
||||
} AF_AdjustmentDatabaseEntry;
|
||||
|
||||
struct AF_ReverseCharacterMap_;
|
||||
|
||||
typedef struct AF_ReverseCharacterMap_ *AF_ReverseCharacterMap;
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue