From 48ef5948f820577125a7ffae83a9362f6b15cf59 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 5 Aug 2013 12:38:08 +0200 Subject: [PATCH] Synchronize with FreeType. [4/6] This corresponds to commit 456cc440, `[autofit] Move declaration of scripts into separate file.'. --- lib/Makefile.am | 1 + lib/taglobal.c | 17 +++++++---------- lib/taglobal.h | 2 +- lib/tascript.h | 35 +++++++++++++++++++++++++++++++++++ lib/tatypes.h | 16 +++++----------- lib/tawrtsys.h | 22 ++++++++++------------ 6 files changed, 59 insertions(+), 34 deletions(-) create mode 100644 lib/tascript.h diff --git a/lib/Makefile.am b/lib/Makefile.am index 88134da..157ccab 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -43,6 +43,7 @@ libttfautohint_la_SOURCES = \ taname.c \ tapost.c \ taprep.c \ + tascript.h \ tasfnt.c \ tasort.c tasort.h \ tatables.c tatables.h \ diff --git a/lib/taglobal.c b/lib/taglobal.c index 9fdbb63..ab1657b 100644 --- a/lib/taglobal.c +++ b/lib/taglobal.c @@ -40,18 +40,15 @@ TA_WritingSystemClass const ta_writing_system_classes[] = }; -/* populate this list when you add new scripts */ +#undef SCRIPT +#define SCRIPT(s, S) \ + &ta_ ## s ## _script_class, + TA_ScriptClass const ta_script_classes[] = { - &ta_dflt_script_class, /* XXX */ - &ta_latn_script_class, -#if 0 - &ta_hani_script_class, - &ta_deva_script_class, -#endif -#ifdef FT_OPTION_AUTOFIT2 - &ta_ltn2_script_class, -#endif + +#include "tascript.h" + NULL /* do not remove */ }; diff --git a/lib/taglobal.h b/lib/taglobal.h index e123cd2..6e0c72b 100644 --- a/lib/taglobal.h +++ b/lib/taglobal.h @@ -33,7 +33,7 @@ extern TA_ScriptClass const ta_script_classes[]; /* and face globals (in TA_FaceGlobalsRec). */ /* index of fallback script in `ta_script_classes' */ -#define TA_SCRIPT_FALLBACK 0 /* dflt */ +#define TA_SCRIPT_FALLBACK TA_SCRIPT_DFLT /* a bit mask indicating an uncovered glyph */ #define TA_SCRIPT_NONE 0x7F /* if this flag is set, we have an ASCII digit */ diff --git a/lib/tascript.h b/lib/tascript.h new file mode 100644 index 0000000..fc26a63 --- /dev/null +++ b/lib/tascript.h @@ -0,0 +1,35 @@ +/* tascript.h */ + +/* + * Copyright (C) 2013 by Werner Lemberg. + * + * This file is part of the ttfautohint library, and may only be used, + * modified, and distributed under the terms given in `COPYING'. By + * continuing to use, modify, or distribute this file you indicate that you + * have read `COPYING' and understand and accept it fully. + * + * The file `COPYING' mentioned in the previous paragraph is distributed + * with the ttfautohint library. + */ + + +/* originally file `afscript.h' (2013-Aug-05) from FreeType */ + + +/* The following part can be included multiple times. */ +/* Define `SCRIPT' as needed. */ + + +/* Add new scripts here. */ + +SCRIPT(dflt, DFLT) +SCRIPT(latn, LATN) +#if 0 +SCRIPT(hani, HANI) +SCRIPT(deva, DEVA) +#endif +#ifdef FT_OPTION_AUTOFIT2 +SCRIPT(ltn2, LTN2) +#endif + +/* end of tascript.h */ diff --git a/lib/tatypes.h b/lib/tatypes.h index 3a24a4d..8a1940a 100644 --- a/lib/tatypes.h +++ b/lib/tatypes.h @@ -238,21 +238,15 @@ typedef struct TA_WritingSystemClassRec_ * We use four-letter script tags from the OpenType specification. */ +#undef SCRIPT +#define SCRIPT(s, S) \ + TA_SCRIPT_ ## S, + /* The list of known scripts. */ typedef enum TA_Script_ { - TA_SCRIPT_DFLT = 0, - TA_SCRIPT_LATN = 1, -#if 0 - TA_SCRIPT_HANI = 2, - TA_SCRIPT_DEVA = 3, -#endif -#ifdef FT_OPTION_AUTOFIT2 - TA_SCRIPT_LTN2 = 4, -#endif - /* add new scripts here; */ - /* don't forget to update the list in `taglobal.c' */ +#include "tascript.h" TA_SCRIPT_MAX /* do not remove */ } TA_Script; diff --git a/lib/tawrtsys.h b/lib/tawrtsys.h index 142af3f..eac6df7 100644 --- a/lib/tawrtsys.h +++ b/lib/tawrtsys.h @@ -1,7 +1,7 @@ /* tawrtsys.h */ /* - * Copyright (C) 2011-2013 by Werner Lemberg. + * Copyright (C) 2013 by Werner Lemberg. * * This file is part of the ttfautohint library, and may only be used, * modified, and distributed under the terms given in `COPYING'. By @@ -16,7 +16,6 @@ /* originally file `afwrtsys.h' (2013-Aug-05) from FreeType */ - #ifndef __TAWRTSYS_H__ #define __TAWRTSYS_H__ @@ -36,21 +35,20 @@ #endif /* __TAWRTSYS_H__ */ - /* The following part can be included multiple times. */ - /* Define `WRITING_SYSTEM' as needed. */ +/* The following part can be included multiple times. */ +/* Define `WRITING_SYSTEM' as needed. */ - /* Add new writing systems here. */ +/* Add new writing systems here. */ - WRITING_SYSTEM(dummy, DUMMY) - WRITING_SYSTEM(latin, LATIN) +WRITING_SYSTEM(dummy, DUMMY) +WRITING_SYSTEM(latin, LATIN) #if 0 - WRITING_SYSTEM(cjk, CJK) - WRITING_SYSTEM(indic, INDIC) +WRITING_SYSTEM(cjk, CJK) +WRITING_SYSTEM(indic, INDIC) #endif #ifdef FT_OPTION_AUTOFIT2 - WRITING_SYSTEM(latin2, LATIN2) +WRITING_SYSTEM(latin2, LATIN2) #endif - -/* END */ +/* end of tawrtsys.h */ -- 2.11.4.GIT