summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-02-03 13:01:31 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-02-03 13:01:31 +0000
commit4dc568b1e2c01476f34b6c014da3bc487b71aacf (patch)
treea6a389e1a3915bdc1b618eb2aeae27fd7f21b68a /Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge
parent4a985ab4153e6ba130b801d4cec60709b0a44e47 (diff)
Import LuaTeX snapshot 0.78.3
git-svn-id: svn://tug.org/texlive/trunk@32854 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge')
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/autohint.c3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/dumppfa.c3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c563
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macbinary.c9
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c832
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/memory.c101
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.c61
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/namelist.c8
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/noprefs.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsepfa.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c318
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfatt.c1926
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfvar.c771
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pfaedit.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psread.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.h7
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinechar.c20
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefill.c3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.h135
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineoverlap.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesave.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinestroke.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c79
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil2.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottf.c19
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfaat.c136
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttf.h126
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/views.h1087
30 files changed, 203 insertions, 6020 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/autohint.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/autohint.c
index 38e3b1b3b48..6619bd1f762 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/autohint.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/autohint.c
@@ -28,7 +28,6 @@
#include <stdio.h>
#include <math.h>
#include "splinefont.h"
-#include "views.h"
#include "stemdb.h"
#include <utype.h>
#include <chardata.h>
@@ -1805,8 +1804,6 @@ void SCFigureHintMasks(SplineChar *sc,int layer) {
instance_count = 1;
SCClearHintMasks(sc,layer,false);
} else {
- if ( mm->apple )
-return;
instance_count = mm->instance_count;
for ( i=0; i<instance_count; ++i )
if ( sc->orig_pos < mm->instances[i]->glyphcnt ) {
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/dumppfa.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/dumppfa.c
index 9a0e32a7240..6f7b03430b9 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/dumppfa.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/dumppfa.c
@@ -40,9 +40,6 @@
#include <time.h>
#include "psfont.h"
#include "splinefont.h"
-#ifdef FONTFORGE_CONFIG_TYPE3
- #include <gdraw.h> /* For image defn */
-#endif
#ifdef __CygWin
#include <sys/types.h>
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c
index 7f2a34f1f05..52b290e0010 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c
@@ -27,12 +27,9 @@
#include "pfaedit.h"
#include "baseviews.h"
#include "psfont.h"
-#include <gfile.h>
-#include <gio.h>
#include <ustring.h>
#include <utype.h>
#include <chardata.h>
-#include <gresource.h>
#include <math.h>
#include <unistd.h>
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c
index 6a565526a7b..85bcd91b94f 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c
@@ -54,7 +54,7 @@ struct opentype_feature_friendlynames friendlies[] = {
{ CHR('b','l','w','s'), "blws", N_("Below Base Substitutions"), gsub_ligature_mask },
{ CHR('c','2','p','c'), "c2pc", N_("Capitals to Petite Capitals"), gsub_single_mask },
{ CHR('c','2','s','c'), "c2sc", N_("Capitals to Small Capitals"), gsub_single_mask },
- { CHR('c','a','l','t'), "calt", N_("Contextual Alternates"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('c','a','l','t'), "calt", N_("Contextual Alternates"), gsub_context_mask|gsub_contextchain_mask },
{ CHR('c','a','s','e'), "case", N_("Case-Sensitive Forms"), gsub_single_mask|gpos_single_mask },
{ CHR('c','c','m','p'), "ccmp", N_("Glyph Composition/Decomposition"), gsub_multiple_mask|gsub_ligature_mask },
{ CHR('c','l','i','g'), "clig", N_("Contextual Ligatures"), gsub_reversecchain_mask },
@@ -81,8 +81,8 @@ struct opentype_feature_friendlynames friendlies[] = {
{ CHR('d','p','n','g'), "dpng", N_("Dipthongs (Obsolete)"), gsub_ligature_mask },
{ CHR('e','x','p','t'), "expt", N_("Expert Forms"), gsub_single_mask },
{ CHR('f','a','l','t'), "falt", N_("Final Glyph On Line"), gsub_alternate_mask },
- { CHR('f','i','n','2'), "fin2", N_("Terminal Forms #2"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
- { CHR('f','i','n','3'), "fin3", N_("Terminal Forms #3"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('f','i','n','2'), "fin2", N_("Terminal Forms #2"), gsub_context_mask|gsub_contextchain_mask },
+ { CHR('f','i','n','3'), "fin3", N_("Terminal Forms #3"), gsub_context_mask|gsub_contextchain_mask },
{ CHR('f','i','n','a'), "fina", N_("Terminal Forms"), gsub_single_mask },
{ CHR('f','l','a','c'), "flac", N_("Flattened Accents over Capitals"), gsub_single_mask|gsub_ligature_mask },
{ CHR('f','r','a','c'), "frac", N_("Diagonal Fractions"), gsub_single_mask|gsub_ligature_mask },
@@ -104,31 +104,31 @@ struct opentype_feature_friendlynames friendlies[] = {
{ CHR('j','p','7','8'), "jp78", N_("JIS78 Forms"), gsub_single_mask|gsub_alternate_mask },
{ CHR('j','p','8','3'), "jp83", N_("JIS83 Forms"), gsub_single_mask },
{ CHR('j','p','9','0'), "jp90", N_("JIS90 Forms"), gsub_single_mask },
- { CHR('k','e','r','n'), "kern", N_("Horizontal Kerning"), gpos_pair_mask|gpos_context_mask|gpos_contextchain_mask|kern_statemachine_mask },
+ { CHR('k','e','r','n'), "kern", N_("Horizontal Kerning"), gpos_pair_mask|gpos_context_mask|gpos_contextchain_mask },
{ CHR('l','f','b','d'), "lfbd", N_("Left Bounds"), gpos_single_mask },
{ CHR('l','i','g','a'), "liga", N_("Standard Ligatures"), gsub_ligature_mask },
{ CHR('l','j','m','o'), "ljmo", N_("Leading Jamo Forms"), gsub_ligature_mask },
{ CHR('l','n','u','m'), "lnum", N_("Lining Figures"), gsub_single_mask },
{ CHR('l','o','c','l'), "locl", N_("Localized Forms"), gsub_single_mask },
{ CHR('m','a','r','k'), "mark", N_("Mark Positioning"), gpos_mark2base_mask|gpos_mark2ligature_mask },
- { CHR('m','e','d','2'), "med2", N_("Medial Forms 2"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('m','e','d','2'), "med2", N_("Medial Forms 2"), gsub_context_mask|gsub_contextchain_mask },
{ CHR('m','e','d','i'), "medi", N_("Medial Forms"), gsub_single_mask },
{ CHR('m','g','r','k'), "mgrk", N_("Mathematical Greek"), gsub_single_mask },
{ CHR('m','k','m','k'), "mkmk", N_("Mark to Mark"), gpos_mark2mark_mask },
- { CHR('m','s','e','t'), "mset", N_("Mark Positioning via Substitution"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('m','s','e','t'), "mset", N_("Mark Positioning via Substitution"), gsub_context_mask|gsub_contextchain_mask },
{ CHR('n','a','l','t'), "nalt", N_("Alternate Annotation Forms"), gsub_single_mask|gsub_alternate_mask },
{ CHR('n','u','k','t'), "nukt", N_("Nukta Forms"), gsub_ligature_mask },
{ CHR('n','u','m','r'), "numr", N_("Numerators"), gsub_single_mask },
{ CHR('o','n','u','m'), "onum", N_("Oldstyle Figures"), gsub_single_mask },
{ CHR('o','p','b','d'), "opbd", N_("Optical Bounds"), gpos_single_mask },
- { CHR('o','r','d','n'), "ordn", N_("Ordinals"), gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('o','r','d','n'), "ordn", N_("Ordinals"), gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask },
{ CHR('o','r','n','m'), "ornm", N_("Ornaments"), gsub_single_mask|gsub_alternate_mask },
{ CHR('p','a','l','t'), "palt", N_("Proportional Alternate Metrics"), gpos_single_mask },
{ CHR('p','c','a','p'), "pcap", N_("Lowercase to Petite Capitals"), gsub_single_mask },
{ CHR('p','k','n','a'), "pkna", N_("Proportional Kana"), gpos_single_mask },
{ CHR('p','n','u','m'), "pnum", N_("Proportional Numbers"), gsub_single_mask },
{ CHR('p','r','e','f'), "pref", N_("Pre Base Forms"), gsub_ligature_mask },
- { CHR('p','r','e','s'), "pres", N_("Pre Base Substitutions"), gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('p','r','e','s'), "pres", N_("Pre Base Substitutions"), gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask },
{ CHR('p','s','t','f'), "pstf", N_("Post Base Forms"), gsub_ligature_mask },
{ CHR('p','s','t','s'), "psts", N_("Post Base Substitutions"), gsub_ligature_mask },
{ CHR('p','w','i','d'), "pwid", N_("Proportional Width"), gsub_single_mask },
@@ -181,12 +181,12 @@ struct opentype_feature_friendlynames friendlies[] = {
{ CHR('v','h','a','l'), "vhal", N_("Alternate Vertical Half Metrics"), gpos_single_mask },
{ CHR('v','j','m','o'), "vjmo", N_("Vowel Jamo Forms"), gsub_ligature_mask },
{ CHR('v','k','n','a'), "vkna", N_("Vertical Kana Alternates"), gsub_single_mask },
- { CHR('v','k','r','n'), "vkrn", N_("Vertical Kerning"), gpos_pair_mask|gpos_context_mask|gpos_contextchain_mask|kern_statemachine_mask },
+ { CHR('v','k','r','n'), "vkrn", N_("Vertical Kerning"), gpos_pair_mask|gpos_context_mask|gpos_contextchain_mask },
{ CHR('v','p','a','l'), "vpal", N_("Proportional Alternate Vertical Metrics"), gpos_single_mask },
{ CHR('v','r','t','2'), "vrt2", N_("Vertical Rotation & Alternates"), gsub_single_mask },
{ CHR('z','e','r','o'), "zero", N_("Slashed Zero"), gsub_single_mask },
/* This is my hack for setting the "Required feature" field of a script */
- { CHR(' ','R','Q','D'), " RQD", N_("Required feature"), gsub_single_mask|gsub_multiple_mask|gsub_alternate_mask|gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|gsub_reversecchain_mask|morx_context_mask|gpos_single_mask|gpos_pair_mask|gpos_cursive_mask|gpos_mark2base_mask|gpos_mark2ligature_mask|gpos_mark2mark_mask|gpos_context_mask|gpos_contextchain_mask },
+ { CHR(' ','R','Q','D'), " RQD", N_("Required feature"), gsub_single_mask|gsub_multiple_mask|gsub_alternate_mask|gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|gsub_reversecchain_mask|gpos_single_mask|gpos_pair_mask|gpos_cursive_mask|gpos_mark2base_mask|gpos_mark2ligature_mask|gpos_mark2mark_mask|gpos_context_mask|gpos_contextchain_mask },
{ 0, NULL, 0, 0 }
};
@@ -337,8 +337,6 @@ a GPOS, but he says the GPOS won't work without a GSUB.)
if ( test->unused )
continue;
for ( fl=test->features; fl!=NULL; fl=fl->next ) {
- if ( fl->ismac )
- continue;
for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
for ( i=0; i<cnt; ++i ) {
if ( sl->script==scripts[i] )
@@ -435,7 +433,7 @@ uint32 *SFFeaturesInScriptLang(SplineFont *sf,int gpos,uint32 script,uint32 lang
OTLookup *test;
FeatureScriptLangList *fl;
struct scriptlanglist *sl;
- /* gpos==0 => GSUB, gpos==1 => GPOS, gpos==-1 => both, gpos==-2 => Both & morx & kern */
+ /* gpos==0 => GSUB, gpos==1 => GPOS, gpos==-1 => both, gpos==-2 => Both & kern */
if ( sf->cidmaster ) sf=sf->cidmaster;
for ( isg = 0; isg<2; ++isg ) {
@@ -445,8 +443,6 @@ uint32 *SFFeaturesInScriptLang(SplineFont *sf,int gpos,uint32 script,uint32 lang
if ( test->unused )
continue;
for ( fl=test->features; fl!=NULL; fl=fl->next ) {
- if ( fl->ismac && gpos!=-2 )
- continue;
if ( script==0xffffffff ) {
for ( i=0; i<cnt; ++i ) {
if ( fl->featuretag==features[i] )
@@ -460,9 +456,7 @@ uint32 *SFFeaturesInScriptLang(SplineFont *sf,int gpos,uint32 script,uint32 lang
} else for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
if ( sl->script==script ) {
int matched = false;
- if ( fl->ismac && gpos==-2 )
- matched = true;
- else for ( l=0; l<sl->lang_cnt; ++l ) {
+ for ( l=0; l<sl->lang_cnt; ++l ) {
unsigned testlang;
if ( l<MAX_LANG )
testlang = sl->langs[l];
@@ -663,15 +657,28 @@ SplineChar **SFGlyphsWithLigatureinLookup(SplineFont *sf,struct lookup_subtable
int i, cnt;
PST *pst;
sc=NULL;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sc = sf->glyphs[i]) ) {
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable == subtable ) {
- used[i] = true;
- goto continue_;
- }
- }
- continue_: ;
- }
+ /* for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sc = sf->glyphs[i]) ) { */
+ /* for ( pst=sc->possub; pst!=NULL; pst=pst->next ) { */
+ /* if ( pst->subtable == subtable ) { */
+ /* used[i] = true; */
+ /* goto continue_; */
+ /* } */
+ /* } */
+ /* continue_: ; */
+ /* } */
+ /* Issue 866 : currently #define SCWorthOutputting(a) 1 so we drop it */
+ for ( i=0; i<sf->glyphcnt; ++i ) {
+ sc = sf->glyphs[i];
+ if ( sc ) {
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->subtable == subtable ) {
+ used[i] = true;
+ goto continue_;
+ }
+ }
+ continue_: ;
+ }/* end if ( sc ) */
+ }/*end for */
for ( i=cnt=0 ; i<sf->glyphcnt; ++i )
if ( used[i] )
@@ -713,7 +720,7 @@ void SFFindUnusedLookups(SplineFont *sf) {
for ( gpos=0; gpos<2; ++gpos ) {
for ( test = gpos ? _sf->gpos_lookups : _sf->gsub_lookups; test!=NULL; test = test->next ) {
for ( sub = test->subtables; sub!=NULL; sub=sub->next ) {
- if ( sub->kc!=NULL || sub->fpst!=NULL || sub->sm!=NULL ) {
+ if ( sub->kc!=NULL || sub->fpst!=NULL ) {
sub->unused = false;
continue;
}
@@ -835,24 +842,11 @@ static void RemoveNestedReferences(SplineFont *sf,int isgpos,OTLookup *dying) {
int i,j,k;
(void)dying;
for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl = otl->next ) {
- if ( otl->lookup_type==morx_context ) {
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- ASM *sm = sub->sm;
- if ( sm->type==asm_context ) {
- for ( i=0; i<sm->state_cnt*sm->class_cnt; ++i ) {
- struct asm_state *state = &sm->state[i];
- if ( state->u.context.mark_lookup == otl )
- state->u.context.mark_lookup = NULL;
- if ( state->u.context.cur_lookup == otl )
- state->u.context.cur_lookup = NULL;
- }
- }
- }
/* Reverse chaining tables do not reference lookups. The match pattern*/
/* is a (exactly one) coverage table, and each glyph in that table */
/* as an inline replacement. There is no lookup to do the replacement*/
/* (so we ignore it here) */
- } else if ( otl->lookup_type==gsub_context || otl->lookup_type==gsub_contextchain ||
+ if ( otl->lookup_type==gsub_context || otl->lookup_type==gsub_contextchain ||
otl->lookup_type==gpos_context || otl->lookup_type==gpos_contextchain ) {
for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
FPST *fpst = sub->fpst;
@@ -937,17 +931,7 @@ void SFRemoveLookupSubTable(SplineFont *sf,struct lookup_subtable *sub) {
if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
- if ( sub->sm!=NULL ) {
- ASM *prev = NULL, *test;
- for ( test=sf->sm; test!=NULL && test!=sub->sm; prev=test, test=test->next );
- if ( prev==NULL )
- sf->sm = sub->sm->next;
- else
- prev->next = sub->sm->next;
- sub->sm->next = NULL;
- ASMFree(sub->sm);
- sub->sm = NULL;
- } else if ( sub->fpst!=NULL ) {
+ if ( sub->fpst!=NULL ) {
FPST *prev = NULL, *test;
for ( test=sf->possub; test!=NULL && test!=sub->fpst; prev=test, test=test->next );
if ( prev==NULL )
@@ -1338,21 +1322,10 @@ return;
friendlies[i].friendlyname = _(friendlies[i].friendlyname);
}
-char *TagFullName(SplineFont *sf,uint32 tag, int ismac, int onlyifknown) {
- char ubuf[200], *end = ubuf+sizeof(ubuf), *setname;
+char *TagFullName(SplineFont *sf,uint32 tag, int onlyifknown) {
+ char ubuf[200], *end = ubuf+sizeof(ubuf);
int k;
- if ( ismac==-1 )
- /* Guess */
- ismac = (tag>>24)<' ' || (tag>>24)>0x7e;
-
- if ( ismac ) {
- sprintf( ubuf, "<%d,%d> ", (int) (tag>>16),(int) (tag&0xffff) );
- if ( (setname = PickNameFromMacName(FindMacSettingName(sf,tag>>16,tag&0xffff)))!=NULL ) {
- strcat( ubuf, setname );
- free( setname );
- }
- } else {
unsigned stag = tag;
if ( tag==CHR('n','u','t','f') ) /* early name that was standardize later as... */
stag = CHR('a','f','r','c'); /* Stood for nut fractions. "nut" meaning "fits in an en" in old typography-speak => vertical fractions rather than diagonal ones */
@@ -1378,7 +1351,6 @@ return( NULL );
else
ubuf[7]='\0';
}
- }
return( copy( ubuf ));
}
@@ -1400,7 +1372,7 @@ void NameOTLookup(OTLookup *otl,SplineFont *sf) {
for ( fl=otl->features; fl!=NULL ; fl=fl->next ) {
/* look first for a feature attached to a default language */
if ( k==1 || DefaultLangTagInScriptList(fl->scripts,false)!=NULL ) {
- userfriendly = TagFullName(sf,fl->featuretag, fl->ismac, true);
+ userfriendly = TagFullName(sf,fl->featuretag, true);
if ( userfriendly!=NULL )
break;
}
@@ -1410,13 +1382,7 @@ void NameOTLookup(OTLookup *otl,SplineFont *sf) {
#endif
}
if ( userfriendly==NULL ) {
- if ( (otl->lookup_type&0xff)>= 0xf0 )
-#ifdef LUA_FF_LIB
- lookuptype = "ma";
-#else
- lookuptype = _("State Machine");
-#endif
- else if ( (otl->lookup_type>>8)<2 && (otl->lookup_type&0xff)<10 )
+ if ( (otl->lookup_type>>8)<2 && (otl->lookup_type&0xff)<10 )
lookuptype = _(lookup_type_names[otl->lookup_type>>8][otl->lookup_type&0xff]);
else
#ifdef LUA_FF_LIB
@@ -1424,7 +1390,7 @@ void NameOTLookup(OTLookup *otl,SplineFont *sf) {
#else
lookuptype = _("Unknown");
#endif
- for ( fl=otl->features; fl!=NULL && !fl->ismac; fl=fl->next );
+ for ( fl=otl->features; fl!=NULL; fl=fl->next );
if ( fl==NULL )
userfriendly = copy(lookuptype);
else {
@@ -2026,42 +1992,6 @@ static FPST *SF_AddFPST(struct sfmergecontext *mc,FPST *fpst,
return( newfpst );
}
-static ASM *SF_AddASM(struct sfmergecontext *mc,ASM *sm, struct lookup_subtable *sub ) {
- ASM *newsm;
- int i;
-
- newsm = chunkalloc(sizeof(ASM));
- *newsm = *sm;
- newsm->subtable = sub;
- newsm->next = mc->sf_to->sm;
- mc->sf_to->sm = newsm;
- mc->sf_to->changed = true;
- newsm->classes = ClassCopy(newsm->class_cnt, newsm->classes);
- newsm->state = galloc(newsm->class_cnt*newsm->state_cnt*sizeof(struct asm_state));
- memcpy(newsm->state,sm->state,
- newsm->class_cnt*newsm->state_cnt*sizeof(struct asm_state));
- if ( newsm->type == asm_kern ) {
- for ( i=newsm->class_cnt*newsm->state_cnt-1; i>=0; --i ) {
- newsm->state[i].u.kern.kerns = galloc(newsm->state[i].u.kern.kcnt*sizeof(int16));
- memcpy(newsm->state[i].u.kern.kerns,sm->state[i].u.kern.kerns,newsm->state[i].u.kern.kcnt*sizeof(int16));
- }
- } else if ( newsm->type == asm_insert ) {
- for ( i=0; i<newsm->class_cnt*newsm->state_cnt; ++i ) {
- struct asm_state *this = &newsm->state[i];
- this->u.insert.mark_ins = copy(this->u.insert.mark_ins);
- this->u.insert.cur_ins = copy(this->u.insert.cur_ins);
- }
- } else if ( newsm->type == asm_context ) {
- for ( i=0; i<newsm->class_cnt*newsm->state_cnt; ++i ) {
- newsm->state[i].u.context.mark_lookup = OTLookupCopyNested(mc,
- newsm->state[i].u.context.mark_lookup);
- newsm->state[i].u.context.cur_lookup = OTLookupCopyNested(mc,
- newsm->state[i].u.context.cur_lookup);
- }
- }
-return( newsm );
-}
-
static SplineChar *SCFindOrMake(SplineFont *into,SplineChar *fromsc) {
int to_index;
@@ -2433,8 +2363,6 @@ return( otl );
sub->kc = SF_AddKernClass(mc, from_sub->kc, sub);
else if ( from_sub->fpst!=NULL )
sub->fpst = SF_AddFPST(mc, from_sub->fpst, sub);
- else if ( from_sub->sm!=NULL )
- sub->sm = SF_AddASM(mc, from_sub->sm, sub);
else if ( from_sub->anchor_classes )
SF_AddAnchorClasses(mc, from_sub, sub);
else
@@ -2468,15 +2396,6 @@ return( true );
return( true );
}
}
- } else if ( from_sub->sm!=NULL && from_sub->sm->type==asm_context ) {
- for ( i=0; i<from_sub->sm->class_cnt*from_sub->sm->state_cnt; ++i ) {
- sublist[0] = from_sub->sm->state[i].u.context.mark_lookup;
- if ( NeedsPrefix(into_sf,from_sf,sublist))
-return( true );
- sublist[0] = from_sub->sm->state[i].u.context.cur_lookup;
- if ( NeedsPrefix(into_sf,from_sf,sublist))
-return( true );
- }
}
}
}
@@ -2563,279 +2482,6 @@ return( false );
}
/* ************************************************************************** */
-/* ************************ Apply Apple State Machines ********************** */
-/* ************************************************************************** */
-
-static void ApplyMacIndicRearrangement(struct lookup_data *data,int verb,
- int first_pos,int last_pos) {
- struct opentype_str temp, temp2, temp3, temp4;
- int i;
-
- if ( first_pos==-1 || last_pos==-1 || last_pos <= first_pos )
-return;
- switch ( verb ) {
- case 1: /* Ax => xA */
- temp = data->str[first_pos];
- for ( i= first_pos; i<last_pos; ++i )
- data->str[i] = data->str[i+1];
- data->str[last_pos] = temp;
- break;
- case 2: /* xD => Dx */
- temp = data->str[last_pos];
- for ( i= last_pos; i>first_pos; --i )
- data->str[i] = data->str[i-1];
- data->str[first_pos] = temp;
- break;
- case 3: /* AxD => DxA */
- temp = data->str[last_pos];
- data->str[last_pos] = data->str[first_pos];
- data->str[first_pos] = temp;
- break;
- case 4: /* ABx => xAB */
- temp = data->str[first_pos];
- temp2 = data->str[first_pos+1];
- for ( i= first_pos; i<last_pos-1; ++i )
- data->str[i] = data->str[i+21];
- data->str[last_pos-1] = temp;
- data->str[last_pos] = temp2;
- break;
- case 5: /* ABx => xBA */
- temp = data->str[first_pos];
- temp2 = data->str[first_pos+1];
- for ( i= first_pos; i<last_pos-1; ++i )
- data->str[i] = data->str[i+21];
- data->str[last_pos-1] = temp2;
- data->str[last_pos] = temp;
- break;
- case 6: /* xCD => CDx */
- temp = data->str[last_pos];
- temp2 = data->str[last_pos-1];
- for ( i= last_pos; i>first_pos+1; --i )
- data->str[i] = data->str[i-2];
- data->str[first_pos+1] = temp;
- data->str[first_pos] = temp2;
- break;
- case 7: /* xCD => DCx */
- temp = data->str[last_pos];
- temp2 = data->str[last_pos-1];
- for ( i= last_pos; i>first_pos+1; --i )
- data->str[i] = data->str[i-2];
- data->str[first_pos+1] = temp2;
- data->str[first_pos] = temp;
- break;
- case 8: /* AxCD => CDxA */
- temp = data->str[first_pos];
- temp2 = data->str[last_pos-1];
- temp3 = data->str[last_pos];
- for ( i= last_pos-1; i>first_pos; --i )
- data->str[i] = data->str[i-1];
- data->str[first_pos+1] = temp2;
- data->str[first_pos] = temp3;
- data->str[last_pos] = temp;
- break;
- case 9: /* AxCD => DCxA */
- temp = data->str[first_pos];
- temp2 = data->str[last_pos-1];
- temp3 = data->str[last_pos];
- for ( i= last_pos-1; i>first_pos; --i )
- data->str[i] = data->str[i-1];
- data->str[first_pos+1] = temp3;
- data->str[first_pos] = temp2;
- data->str[last_pos] = temp;
- break;
- case 10: /* ABxD => DxAB */
- temp = data->str[first_pos];
- temp2 = data->str[first_pos+1];
- temp3 = data->str[last_pos];
- for ( i= first_pos+1; i<last_pos; ++i )
- data->str[i] = data->str[i+1];
- data->str[first_pos] = temp3;
- data->str[last_pos-1] = temp;
- data->str[last_pos] = temp2;
- break;
- case 11: /* ABxD => DxBA */
- temp = data->str[first_pos];
- temp2 = data->str[first_pos+1];
- temp3 = data->str[last_pos];
- for ( i= first_pos+1; i<last_pos; ++i )
- data->str[i] = data->str[i+1];
- data->str[first_pos] = temp3;
- data->str[last_pos-1] = temp2;
- data->str[last_pos] = temp;
- break;
- case 12: /* ABxCD => CDxAB */
- temp = data->str[first_pos];
- temp2 = data->str[first_pos+1];
- temp3 = data->str[last_pos-1];
- temp4 = data->str[last_pos];
- data->str[last_pos] = temp2;
- data->str[last_pos-1] = temp;
- data->str[first_pos+1] = temp4;
- data->str[first_pos] = temp3;
- break;
- case 13: /* ABxCD => CDxBA */
- temp = data->str[first_pos];
- temp2 = data->str[first_pos+1];
- temp3 = data->str[last_pos-1];
- temp4 = data->str[last_pos];
- data->str[last_pos] = temp;
- data->str[last_pos-1] = temp2;
- data->str[first_pos+1] = temp4;
- data->str[first_pos] = temp3;
- break;
- case 14: /* ABxCD => DCxAB */
- temp = data->str[first_pos];
- temp2 = data->str[first_pos+1];
- temp3 = data->str[last_pos-1];
- temp4 = data->str[last_pos];
- data->str[last_pos] = temp2;
- data->str[last_pos-1] = temp;
- data->str[first_pos+1] = temp3;
- data->str[first_pos] = temp4;
- break;
- case 15: /* ABxCD => DCxBA */
- temp = data->str[first_pos];
- temp2 = data->str[first_pos+1];
- temp3 = data->str[last_pos-1];
- temp4 = data->str[last_pos];
- data->str[last_pos] = temp;
- data->str[last_pos-1] = temp2;
- data->str[first_pos+1] = temp3;
- data->str[first_pos] = temp4;
- break;
- }
-}
-
-static int ApplyMacInsert(struct lookup_data *data,int ipos,int cnt,
- char *glyphnames, int orig_index) {
- SplineChar *inserts[32];
- char *start, *pt;
- int i, ch;
-
- if ( cnt==0 || glyphnames==NULL || ipos == -1 )
-return( 0 );
-
- for ( i=0, start = glyphnames; i<cnt; ) {
- while ( *start==' ' ) ++start;
- if ( *start=='\0' )
- break;
- for ( pt = start; *pt!=' ' && *pt!='\0'; ++pt );
- ch = *pt; *pt = '\0';
- inserts[i] = SFGetChar(data->sf,-1,start);
- *pt = ch;
- if ( inserts[i]!=NULL )
- ++i;
- }
- cnt = i;
- if ( i==0 )
-return( 0 );
- for ( i= data->cnt; i>=ipos; --i )
- data->str[i+cnt] = data->str[i];
- memset(data->str+ipos,0,cnt*sizeof(struct opentype_str));
- for ( i=0; i<cnt; ++i ) {
- data->str[ipos+i].sc = inserts[i];
- data->str[ipos+i].orig_index = orig_index;
- }
-return( cnt );
-}
-
-static void ApplyAppleStateMachine(uint32 tag, OTLookup *otl,struct lookup_data *data) {
- struct lookup_subtable *sub;
- int state, class, pos, mark_pos, markend_pos, i;
- ASM *sm;
- int cnt_cur, cnt_mark;
- struct asm_state *entry;
- int kern_stack[8], kcnt; /* Kerning state machines handle at most 8 glyphs */
- (void)tag;
- /* Flaws: Line processing has not been done yet, so we are never in the */
- /* start of line state and we never get an end of line token. We never */
- /* get deleted tokens either, those glyphs are just gone */
- /* Class 0: End of text */
- /* Class 1: Glyph not in any classes */
- /* Class 2: Deleted (we never see) */
- /* Class 3: End of line (we never see) */
- /* Mac doesn't have the concept of subtables, but a user could create one */
- /* it will get flattened out into its own "lookup" when written to a file*/
- /* So if there are multiple subtables, just process them all */
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- sm = sub->sm;
-
- state = 0;
- mark_pos = markend_pos = -1;
- for ( pos = 0; pos<=data->cnt; ) {
- if ( pos==data->cnt )
- class = 0;
- else {
- for ( class = sm->class_cnt-1; class>3; --class )
- if ( GlyphNameInClass(data->str[i].sc->name,sm->classes[class]) )
- break;
- if ( class==3 )
- class = 1; /* Glyph not in any class */;
- }
- entry = &sm->state[state*sm->class_cnt+class];
- switch ( otl->lookup_type ) {
- case morx_context:
- if ( entry->u.context.cur_lookup!=NULL )
- ApplyLookupAtPos(0,entry->u.context.cur_lookup,data,pos);
- if ( entry->u.context.mark_lookup!=NULL && mark_pos!=-1 ) {
- ApplyLookupAtPos(0,entry->u.context.mark_lookup,data,mark_pos);
- mark_pos = -1;
- }
- break;
- case morx_indic:
- if ( entry->flags & 0x2000 )
- markend_pos = pos;
- if ( (entry->flags&0xf)!=0 ) {
- ApplyMacIndicRearrangement(data,entry->flags&0xf,mark_pos,markend_pos);
- mark_pos = markend_pos = -1;
- }
- break;
- case morx_insert:
- /* I live in total ignorance of what I should do if the glyph */
- /* "is Kashida like"... so I ignore those flags. */
- cnt_cur = (entry->flags>>5)&0x1f;
- cnt_mark = (entry->flags&0x1f);
- if ( data->cnt + cnt_cur + cnt_mark >= data->max )
- data->str = grealloc(data->str,(data->max = data->cnt + cnt_cur + cnt_mark +20)*sizeof(struct opentype_str));
- if ( cnt_cur!=0 )
- cnt_cur = ApplyMacInsert(data,(entry->flags& 0x0800)? pos : pos+1,
- cnt_cur,entry->u.insert.cur_ins,data->str[pos].orig_index);
- if ( cnt_mark!=0 && mark_pos!=-1 ) {
- cnt_mark = ApplyMacInsert(data,(entry->flags& 0x0800)? mark_pos : mark_pos+1,
- cnt_mark,entry->u.insert.mark_ins,data->str[mark_pos].orig_index);
- mark_pos = -1;
- } else
- cnt_mark = 0;
- pos += cnt_cur+cnt_mark;
- break;
- case kern_statemachine:
- if ( entry->u.kern.kcnt!=0 ) {
- for ( i=0; i<kcnt && i<entry->u.kern.kcnt; ++i )
- data->str[kern_stack[i]].vr.h_adv_off +=
- entry->u.kern.kerns[i];
- kcnt = 0;
- }
- if ( entry->flags & 0x8000 ) {
- for ( i=6; i>=0; --i )
- kern_stack[i+1] = kern_stack[i];
- kern_stack[0] = pos;
- if ( ++kcnt>8 ) kcnt = 8;
- }
- break;
- default: /* for -W */
- break;
- }
- if ( entry->flags & 0x8000 )
- mark_pos = pos; /* The docs do not state whether this happens before or after substitutions are applied at the mark */
- /* after is more useful. So assume that */
- if ( !(entry->flags & 0x4000) )
- ++pos;
- state = entry->next_state;
- }
- }
-}
-
-/* ************************************************************************** */
/* ************************* Apply OpenType Lookups ************************* */
/* ************************************************************************** */
@@ -3544,7 +3190,6 @@ return( 0 );
newpos = ApplyContextual(sub,data,pos);
break;
default:
- /* apple state machines */
newpos = 0;
break;
}
@@ -3557,12 +3202,6 @@ return( 0 );
static void ApplyLookup(uint32 tag, OTLookup *otl,struct lookup_data *data) {
int pos, npos;
- int lt = otl->lookup_type;
-
- if ( lt == morx_indic || lt == morx_context || lt == morx_insert ||
- lt == kern_statemachine )
- ApplyAppleStateMachine(tag,otl,data);
- else {
/* OpenType */
for ( pos = 0; pos<data->cnt; ) {
npos = ApplyLookupAtPos(tag,otl,data,pos);
@@ -3570,7 +3209,6 @@ static void ApplyLookup(uint32 tag, OTLookup *otl,struct lookup_data *data) {
npos = pos+1;
pos = npos;
}
- }
}
static uint32 FSLLMatches(FeatureScriptLangList *fl,uint32 *flist,uint32 script,uint32 lang) {
@@ -3588,8 +3226,6 @@ return( 0 );
if ( flist[i]!=0 ) {
for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
if ( sl->script == script ) {
- if ( fl->ismac ) /* Language irrelevant on macs (scripts too, but we pretend they matter) */
-return( fl->featuretag );
for ( l=0; l<sl->lang_cnt; ++l )
if ( (l<MAX_LANG && sl->langs[l]==lang) ||
(l>=MAX_LANG && sl->morelangs[l-MAX_LANG]==lang))
@@ -3789,113 +3425,6 @@ return( false );
return( ret );
}
-void SFGlyphRenameFixup(SplineFont *sf, char *old, char *new) {
- int k, gid, isv;
- int i,r;
- SplineFont *master = sf;
- SplineChar *sc;
- PST *pst;
- FPST *fpst;
- KernClass *kc;
- ASM *sm;
-
- CVGlyphRenameFixup(sf,old,new);
- if ( sf->cidmaster!=NULL )
- master = sf->cidmaster;
-
- /* Look through all substitutions (and pairwise psts) stored on the glyphs*/
- /* and change any occurances of the name */
- /* (KernPairs have a reference to the SC rather than the name, and need no fixup) */
- /* Also if the name is "f" then look for glyph names like "f.sc" or "f_f_l"*/
- /* and be ready to change them too */
- k = 0;
- do {
- sf = k<master->subfontcnt ? master->subfonts[k] : master;
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
- if ( glyphnameIsComponent(sc->name,old)) {
- char *newer = copy(sc->name);
- rplglyphname(&newer,old,new);
- SFGlyphRenameFixup(master,sc->name,newer);
- free(sc->name);
- sc->name = newer;
- sc->namechanged = sc->changed = true;
- }
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type==pst_substitution || pst->type==pst_alternate ||
- pst->type==pst_multiple || pst->type==pst_pair ||
- pst->type==pst_ligature ) {
- if ( rplstr(&pst->u.mult.components,old,new,pst->type==pst_ligature))
- sc->changed = true;
- }
- }
- /* For once I don't want a short circuit eval of "or", so I use */
- /* bitwise rather than boolean intentionally */
- if ( gvfixup(sc->vert_variants,old,new) |
- gvfixup(sc->horiz_variants,old,new))
- sc->changed = true;
- }
- ++k;
- } while ( k<master->subfontcnt );
-
- /* Now look for contextual fpsts which might use the name */
- for ( fpst=master->possub; fpst!=NULL; fpst=fpst->next ) {
- if ( fpst->format==pst_class ) {
- for ( i=0; i<fpst->nccnt; ++i ) if ( fpst->nclass[i]!=NULL ) {
- if ( rplstr(&fpst->nclass[i],old,new,false))
- break;
- }
- for ( i=0; i<fpst->bccnt; ++i ) if ( fpst->bclass[i]!=NULL ) {
- if ( rplstr(&fpst->bclass[i],old,new,false))
- break;
- }
- for ( i=0; i<fpst->fccnt; ++i ) if ( fpst->fclass[i]!=NULL ) {
- if ( rplstr(&fpst->fclass[i],old,new,false))
- break;
- }
- }
- for ( r=0; r<fpst->rule_cnt; ++r ) {
- struct fpst_rule *rule = &fpst->rules[r];
- if ( fpst->type==pst_glyphs ) {
- rplstr(&rule->u.glyph.names,old,new,true);
- rplstr(&rule->u.glyph.back,old,new,true);
- rplstr(&rule->u.glyph.fore,old,new,true);
- } else if ( fpst->type==pst_coverage ||
- fpst->type==pst_reversecoverage ) {
- for ( i=0; i<rule->u.coverage.ncnt ; ++i )
- rplstr(&rule->u.coverage.ncovers[i],old,new,false);
- for ( i=0; i<rule->u.coverage.bcnt ; ++i )
- rplstr(&rule->u.coverage.bcovers[i],old,new,false);
- for ( i=0; i<rule->u.coverage.fcnt ; ++i )
- rplstr(&rule->u.coverage.fcovers[i],old,new,false);
- if ( fpst->type==pst_reversecoverage )
- rplstr(&rule->u.rcoverage.replacements,old,new,true);
- }
- }
- }
-
- /* Now look for contextual apple state machines which might use the name */
- for ( sm = master->sm; sm!=NULL; sm=sm->next ) {
- for ( i=0; i<sm->class_cnt; ++i ) if ( sm->classes[i]!=NULL ) {
- if ( rplstr(&sm->classes[i],old,new,false))
- break;
- }
- }
-
- /* Now look for contextual kerning classes which might use the name */
- for ( isv=0; isv<2; ++isv ) {
- for ( kc=isv ? master->vkerns : master->kerns; kc!=NULL; kc=kc->next ) {
- for ( i=0; i<kc->first_cnt; ++i ) if ( kc->firsts[i]!=NULL ) {
- if ( rplstr(&kc->firsts[i],old,new,false))
- break;
- }
- for ( i=0; i<kc->second_cnt; ++i ) if ( kc->seconds[i]!=NULL ) {
- if ( rplstr(&kc->seconds[i],old,new,false))
- break;
- }
- }
- }
-}
-
struct lookup_subtable *SFSubTableFindOrMake(SplineFont *sf,uint32 tag,uint32 script,
int lookup_type ) {
OTLookup **base;
@@ -4000,14 +3529,6 @@ int LookupUsedNested(SplineFont *sf,OTLookup *checkme) {
return( true );
}
}
- } else if ( otl->lookup_type==morx_context ) {
- for ( c = 0; c<sub->sm->class_cnt*sub->sm->state_cnt; ++c ) {
- struct asm_state *state = &sub->sm->state[c];
- if ( state->u.context.mark_lookup==checkme )
-return( true );
- if ( state->u.context.cur_lookup==checkme )
-return( true );
- }
}
}
}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macbinary.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macbinary.c
index 03d49e22936..0b9be587a59 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macbinary.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macbinary.c
@@ -696,7 +696,7 @@ static FOND *BuildFondList(FILE * f, long rlistpos, int subcnt, long rdata_pos,
static char *BuildName(char *family, int style)
{
- char buffer[350];
+ char buffer[350] = "";
strncpy(buffer, family, 200);
if (style != 0)
@@ -881,8 +881,8 @@ static SplineFont *FindFamilyStyleKerns(SplineFont * into, EncMap * map,
static SplineFont *MightBeTrueType(FILE * binary, int32 pos, int32 dlen,
int flags, enum openflags openflags)
{
- FILE *temp = tmpfile();
- char *buffer = galloc(8192);
+ FILE *temp ;
+ char *buffer ;
int len;
SplineFont *sf;
@@ -896,6 +896,9 @@ static SplineFont *MightBeTrueType(FILE * binary, int32 pos, int32 dlen,
ret[1] = NULL;
return ((SplineFont *) ret);
}
+ temp = tmpfile();
+ buffer = galloc(8192);
+
fseek(binary, pos, SEEK_SET);
while (dlen > 0) {
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c
index 4bab70632cb..66128685dcc 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c
@@ -25,7 +25,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "fontforgevw.h"
-#include <gkeysym.h>
#include <ustring.h>
#include "ttf.h"
@@ -1276,837 +1275,6 @@ return( found );
return( found );
}
-char *PickNameFromMacName(struct macname *mn) {
- int lang = MacLangFromLocale();
- struct macname *first=mn, *english=NULL;
-
- while ( mn!=NULL ) {
- if ( mn->lang==lang )
- break;
- else if ( mn->lang==0 )
- english = mn;
- mn = mn->next;
- }
- if ( mn==NULL )
- mn = english;
- if ( mn==NULL )
- mn = first;
- if ( mn==NULL )
-return( NULL );
-
-return( MacStrToUtf8(mn->name,mn->enc,mn->lang));
-}
-
-char *FindEnglishNameInMacName(struct macname *mn) {
-
- while ( mn!=NULL ) {
- if ( mn->lang==0 )
- break;
- mn = mn->next;
- }
- if ( mn==NULL )
-return( NULL );
-
-return( MacStrToUtf8(mn->name,mn->enc,mn->lang));
-}
-
-struct macname *FindMacSettingName(SplineFont *sf, int feat, int set) {
- MacFeat *from_f, *from_p;
- struct macsetting *s;
-
- if ( sf != NULL )
- for ( from_f = sf->features; from_f!=NULL && from_f->feature!=feat; from_f=from_f->next );
- else
- from_f = NULL;
- for ( from_p = default_mac_feature_map; from_p!=NULL && from_p->feature!=feat; from_p=from_p->next );
- if ( set==-1 ) {
- if ( from_f!=NULL && from_f->featname!=NULL )
-return( from_f->featname );
- else if ( from_p!=NULL )
-return( from_p->featname );
-return( NULL );
- }
- s = NULL;
- if ( from_f!=NULL )
- for ( s = from_f->settings; s!=NULL && s->setting!=set; s=s->next );
- if ( (s==NULL || s->setname==NULL) && from_p!=NULL )
- for ( s = from_p->settings; s!=NULL && s->setting!=set; s=s->next );
- if ( s!=NULL )
-return( s->setname );
-
-return( NULL );
-}
-
-struct macsettingname macfeat_otftag[] = {
- { 1, 0, CHR('r','l','i','g') }, /* Required ligatures */
- { 1, 2, CHR('l','i','g','a') }, /* Common ligatures */
- { 1, 4, CHR('d','l','i','g') }, /* rare ligatures => discretionary */
-#if 0
- { 1, 4, CHR('h','l','i','g') }, /* rare ligatures => historic */
- { 1, 4, CHR('a','l','i','g') }, /* rare ligatures => ?ancient? */
-#endif
- /* 2, 1, partially connected cursive */
- { 2, 2, CHR('i','s','o','l') }, /* Arabic forms */
- { 2, 2, CHR('c','a','l','t') }, /* ??? */
- /* 3, 1, all caps */
- /* 3, 2, all lower */
- { 3, 3, CHR('s','m','c','p') }, /* small caps */
- /* 3, 4, initial caps */
- /* 3, 5, initial caps, small caps */
- { 4, 0, CHR('v','r','t','2') }, /* vertical forms => vertical rotation */
-#if 0
- { 4, 0, CHR('v','k','n','a') }, /* vertical forms => vertical kana */
-#endif
- { 6, 0, CHR('t','n','u','m') }, /* monospace numbers => Tabular numbers */
- { 10, 1, CHR('s','u','p','s') }, /* superior vertical position => superscript */
- { 10, 2, CHR('s','u','b','s') }, /* inferior vertical position => subscript */
-#if 0
- { 10, 3, CHR('s','u','p','s') }, /* ordinal vertical position => superscript */
-#endif
- { 11, 1, CHR('a','f','r','c') }, /* vertical fraction => fraction ligature */
- { 11, 2, CHR('f','r','a','c') }, /* diagonal fraction => fraction ligature */
- { 16, 1, CHR('o','r','n','m') }, /* vertical fraction => fraction ligature */
- { 20, 0, CHR('t','r','a','d') }, /* traditional characters => traditional forms */
-#if 0
- { 20, 0, CHR('t','n','a','m') }, /* traditional characters => traditional names */
-#endif
- { 20, 1, CHR('s','m','p','l') }, /* simplified characters */
- { 20, 2, CHR('j','p','7','8') }, /* jis 1978 */
- { 20, 3, CHR('j','p','8','3') }, /* jis 1983 */
- { 20, 4, CHR('j','p','9','0') }, /* jis 1990 */
- { 21, 0, CHR('o','n','u','m') }, /* lower case number => old style numbers */
- { 22, 0, CHR('p','w','i','d') }, /* proportional text => proportional widths */
- { 22, 2, CHR('h','w','i','d') }, /* half width text => half widths */
- { 22, 3, CHR('f','w','i','d') }, /* full width text => full widths */
- { 25, 0, CHR('f','w','i','d') }, /* full width kana => full widths */
- { 25, 1, CHR('p','w','i','d') }, /* proportional kana => proportional widths */
- { 26, 0, CHR('f','w','i','d') }, /* full width ideograph => full widths */
- { 26, 1, CHR('p','w','i','d') }, /* proportional ideograph => proportional widths */
- { 103, 0, CHR('h','w','i','d') }, /* half width cjk roman => half widths */
- { 103, 1, CHR('p','w','i','d') }, /* proportional cjk roman => proportional widths */
- { 103, 3, CHR('f','w','i','d') }, /* full width cjk roman => full widths */
- { 0, 0, 0 }
-}, *user_macfeat_otftag;
-
-static struct macname fs_names[] = {
- { &fs_names[146], 0, 0, "All Typographic Features" },
- { &fs_names[147], 0, 0, "All Type Features" },
- { &fs_names[148], 0, 0, "Ligatures" },
- { &fs_names[149], 0, 0, "Required Ligatures" },
- { &fs_names[150], 0, 0, "Common Ligatures" },
- { &fs_names[151], 0, 0, "Rare Ligatures" },
- { &fs_names[152], 0, 0, "Logo Ligatures" },
- { &fs_names[153], 0, 0, "Rebus Ligatures" },
- { &fs_names[154], 0, 0, "Diphthong Ligatures" },
- { &fs_names[155], 0, 0, "Squared Ligatures" },
- { &fs_names[156], 0, 0, "Abbreviated Squared Ligatures" },
- { &fs_names[157], 0, 0, "Cursive connection" },
- { &fs_names[158], 0, 0, "Unconnected" },
- { &fs_names[159], 0, 0, "Partially connected" },
- { &fs_names[160], 0, 0, "Cursive" },
- { &fs_names[161], 0, 0, "Letter Case" },
- { &fs_names[162], 0, 0, "Upper & Lower Case" },
- { &fs_names[163], 0, 0, "All Capitals" },
- { &fs_names[164], 0, 0, "All Lower Case" },
- { &fs_names[165], 0, 0, "Small Caps" },
- { &fs_names[166], 0, 0, "Initial Caps" },
- { &fs_names[167], 0, 0, "Initial and Small Caps" },
- { &fs_names[168], 0, 0, "Vertical Substitution" },
- { &fs_names[169], 0, 0, "Vertical Substitution" },
- { &fs_names[170], 0, 0, "No Vertical Substitution" },
- { &fs_names[171], 0, 0, "Linguistic Rearrangement" },
- { &fs_names[172], 0, 0, "Linguistic Rearrangement" },
- { &fs_names[173], 0, 0, "No Linguistic Rearrangement" },
- { &fs_names[174], 0, 0, "Number Spacing" },
- { &fs_names[175], 0, 0, "Monospaced Numbers" },
- { &fs_names[176], 0, 0, "Proportional Numbers" },
- { &fs_names[177], 0, 0, "Smart Swashes" },
- { &fs_names[178], 0, 0, "Word Initial Swashes" },
- { &fs_names[179], 0, 0, "Word Final Swashes" },
- { &fs_names[180], 0, 0, "Line Initial Swashes" },
- { &fs_names[181], 0, 0, "Line Final Swashes" },
- { &fs_names[182], 0, 0, "Non-Final Swashes" },
- { &fs_names[183], 0, 0, "Diacritics" },
- { &fs_names[184], 0, 0, "Show Diacritics" },
- { &fs_names[185], 0, 0, "Hide Diacritics" },
- { &fs_names[186], 0, 0, "Decompose Diacritics" },
- { &fs_names[187], 0, 0, "Vertical Position" },
- { &fs_names[188], 0, 0, "Normal Vertical Position" },
- { &fs_names[189], 0, 0, "Superiors" },
- { &fs_names[190], 0, 0, "Inferiors" },
- { &fs_names[191], 0, 0, "Ordinals" },
- { &fs_names[192], 0, 0, "Fractions" },
- { &fs_names[193], 0, 0, "No Fractions" },
- { &fs_names[194], 0, 0, "Vertical Fractions" },
- { &fs_names[195], 0, 0, "Diagonal Fractions" },
- { &fs_names[196], 0, 0, "Overlapping Characters" },
- { &fs_names[197], 0, 0, "Prevent Overlap" },
- { &fs_names[198], 0, 0, "Allow Overlap" },
- { &fs_names[199], 0, 0, "Typographic Extras" },
- { &fs_names[200], 0, 0, "Hyphens to Em-dash" },
- { &fs_names[201], 0, 0, "Hyphen to En-dash" },
- { &fs_names[202], 0, 0, "Unslashed Zero" },
- { &fs_names[203], 0, 0, "Form Interrobang" },
- { &fs_names[204], 0, 0, "Smart Quotes" },
- { &fs_names[205], 0, 0, "Periods to Ellipsis" },
- { &fs_names[206], 0, 0, "Mathematical Extras" },
- { &fs_names[207], 0, 0, "Hyphen to Minus" },
- { &fs_names[208], 0, 0, "Asterisk to Multiply" },
- { &fs_names[209], 0, 0, "Slash to Divide" },
- { &fs_names[210], 0, 0, "Inequality Ligatures" },
- { &fs_names[211], 0, 0, "Exponents" },
- { &fs_names[212], 0, 0, "Ornament Sets" },
- { &fs_names[213], 0, 0, "No Ornaments" },
- { &fs_names[214], 0, 0, "Dingbats" },
- { &fs_names[215], 0, 0, "Pi Characters" },
- { &fs_names[216], 0, 0, "Fleurons" },
- { &fs_names[217], 0, 0, "Decorative Borders" },
- { &fs_names[218], 0, 0, "International Symbols" },
- { &fs_names[219], 0, 0, "Math Symbols" },
- { &fs_names[220], 0, 0, "Character Alternates" },
- { &fs_names[221], 0, 0, "No Alternates" },
- { &fs_names[222], 0, 0, "Alternate Characters" },
- { &fs_names[223], 0, 0, "Other Alternates" },
- { &fs_names[224], 0, 0, "Design Complexity" },
- { &fs_names[225], 0, 0, "Design Level 1" },
- { &fs_names[226], 0, 0, "Design Level 2" },
- { &fs_names[227], 0, 0, "Design Level 3" },
- { &fs_names[228], 0, 0, "Design Level 4" },
- { &fs_names[229], 0, 0, "Design Level 5" },
- { &fs_names[230], 0, 0, "Style Options" },
- { &fs_names[231], 0, 0, "No Style Options" },
- { &fs_names[232], 0, 0, "Display Text" },
- { &fs_names[233], 0, 0, "Engraved Text" },
- { &fs_names[234], 0, 0, "Illuminated Caps" },
- { &fs_names[235], 0, 0, "Titling Caps" },
- { &fs_names[236], 0, 0, "Tall Caps" },
- { &fs_names[237], 0, 0, "Character Shape" },
- { &fs_names[238], 0, 0, "Traditional" },
- { &fs_names[239], 0, 0, "Simplified" },
- { &fs_names[240], 0, 0, "jis 1978" },
- { &fs_names[241], 0, 0, "jis 1983" },
- { &fs_names[242], 0, 0, "jis 1990" },
- { &fs_names[243], 0, 0, "Traditional Alt 1" },
- { &fs_names[244], 0, 0, "Traditional Alt 2" },
- { &fs_names[245], 0, 0, "Traditional Alt 3" },
- { &fs_names[246], 0, 0, "Traditional Alt 4" },
- { &fs_names[247], 0, 0, "Traditional Alt 5" },
- { &fs_names[248], 0, 0, "Expert" },
- { &fs_names[249], 0, 0, "Number Case" },
- { &fs_names[250], 0, 0, "Lower Case Numbers" },
- { &fs_names[251], 0, 0, "Upper Case Numbers" },
- { &fs_names[252], 0, 0, "Text Spacing" },
- { &fs_names[253], 0, 0, "Proportional" },
- { &fs_names[254], 0, 0, "Monospace" },
- { &fs_names[255], 0, 0, "Transliteration" },
- { &fs_names[256], 0, 0, "No Transliteration" },
- { &fs_names[257], 0, 0, "Hanja To Hangul" },
- { &fs_names[258], 0, 0, "Hiragana to Katakana" },
- { &fs_names[259], 0, 0, "Katakana to Hiragana" },
- { &fs_names[260], 0, 0, "Katakana to Roman" },
- { &fs_names[261], 0, 0, "Roman to Hiragana" },
- { &fs_names[262], 0, 0, "Roman to Katakana" },
- { &fs_names[263], 0, 0, "Hanja To Hangul Alt 1" },
- { &fs_names[264], 0, 0, "Hanja To Hangul Alt 2" },
- { &fs_names[265], 0, 0, "Hanja To Hangul Alt 3" },
- { &fs_names[266], 0, 0, "Annotation" },
- { &fs_names[267], 0, 0, "No Annotation" },
- { &fs_names[268], 0, 0, "Box Annotation" },
- { &fs_names[269], 0, 0, "Rounded Box Annotation" },
- { &fs_names[270], 0, 0, "Circle Annotation" },
- { &fs_names[271], 0, 0, "Inverted Circle Annotation" },
- { &fs_names[272], 0, 0, "Parenthesized Annotation" },
- { &fs_names[273], 0, 0, "Period Annotation" },
- { &fs_names[274], 0, 0, "Roman Numeral Annotation" },
- { &fs_names[275], 0, 0, "Diamond Annotation" },
- { &fs_names[276], 0, 0, "Kana Spacing" },
- { &fs_names[277], 0, 0, "Full-Width" },
- { &fs_names[278], 0, 0, "Proportional" },
- { &fs_names[136], 0, 0, "Ideographic Spacing" },
- { &fs_names[137], 0, 0, "Full-Width" },
- { &fs_names[138], 0, 0, "Proportional" },
- { &fs_names[279], 0, 0, "Ideographic Spacing" },
- { &fs_names[280], 0, 0, "Full-Width" },
- { &fs_names[281], 0, 0, "Proportional" },
- { &fs_names[282], 0, 0, "CJK Roman Spacing" },
- { &fs_names[283], 0, 0, "Half-Width" },
- { &fs_names[284], 0, 0, "Proportional" },
- { &fs_names[285], 0, 0, "Default" },
- { &fs_names[286], 0, 0, "Full-Width" },
- { &fs_names[287], 0, 0, "Unicode Decomposition" },
- { &fs_names[288], 0, 0, "Canonical Decomposition" },
- { &fs_names[289], 0, 1, "Fonctions typographiques" },
- { &fs_names[290], 0, 1, "Toutes fonctions typographiques" },
- { &fs_names[291], 0, 1, "Ligatures" },
- { &fs_names[397], 0, 1, "Ligatures Requises" },
- { &fs_names[292], 0, 1, "Ligatures Usuelles" },
- { &fs_names[293], 0, 1, "Ligatures Rares" },
- { &fs_names[400], 0, 1, "Ligatures Logos" },
- { &fs_names[401], 0, 1, "Ligatures R\216bus" },
- { &fs_names[334], 0, 1, "Ligatures Diphtongues" },
- { &fs_names[403], 0, 1, "Ligatures Carr\216es" },
- { &fs_names[404], 0, 1, "Ligatures Carr\216es Abr\217g\216es" },
- { &fs_names[405], 0, 1, "Connection des Cursives" },
- { &fs_names[406], 0, 1, "Non connect\216es" },
- { &fs_names[407], 0, 1, "Partiellement connect\216es" },
- { &fs_names[408], 0, 1, "Pleinement connect\216es" },
- { &fs_names[409], 0, 1, "Casse" },
- { &fs_names[295], 0, 1, "Majuscules & Minuscules" },
- { &fs_names[296], 0, 1, "Tout Majuscule" },
- { &fs_names[412], 0, 1, "Tout Minuscule" },
- { &fs_names[297], 0, 1, "Petites Majuscules" },
- { &fs_names[414], 0, 1, "Initiales Majuscules" },
- { &fs_names[415], 0, 1, "Initiales + Petites Majuscules" },
- { &fs_names[416], 0, 1, "Substitution Verticale" },
- { &fs_names[417], 0, 1, "Substitution vertical" },
- { &fs_names[418], 0, 1, "Aucun Substitution vertical" },
- { &fs_names[419], 0, 1, "R\216arrangement Linguistique" },
- { &fs_names[420], 0, 1, "Avec R\216arrangement Linguistique" },
- { &fs_names[421], 0, 1, "Pas de R\216arrangement Linguistique" },
- { &fs_names[422], 0, 1, "Espacement des chiffres" },
- { &fs_names[299], 0, 1, "Chiffres de largeur fixe" },
- { &fs_names[300], 0, 1, "Chiffres Proportionnels" },
- { &fs_names[301], 0, 1, "Parafes" },
- { &fs_names[304], 0, 1, "Parafes en d\216but de mot" },
- { &fs_names[305], 0, 1, "Parafes en fin de mot" },
- { &fs_names[303], 0, 1, "Parafes en d\216but de ligne" },
- { &fs_names[302], 0, 1, "Parafes en fin de ligne" },
- { &fs_names[306], 0, 1, "Autres Parafes" },
- { &fs_names[431], 0, 1, "Signes Diacritiques" },
- { &fs_names[339], 0, 1, "Montrer les Signes Diacritiques" },
- { &fs_names[433], 0, 1, "Cacher les Signes Diacritiques" },
- { &fs_names[337], 0, 1, "D\216composer les Signes Diacritiques" },
- { &fs_names[435], 0, 1, "Position Verticale" },
- { &fs_names[309], 0, 1, "Position Verticale Normale" },
- { &fs_names[308], 0, 1, "Position Sup\216rieure" },
- { &fs_names[310], 0, 1, "Position Inf\216rieure" },
- { &fs_names[311], 0, 1, "Position Sup\216rieure Contextuelle (Num\216rique)" },
- { &fs_names[440], 0, 1, "Fractions" },
- { &fs_names[313], 0, 1, "Pas de Fractions" },
- { &fs_names[442], 0, 1, "Fractions Verticales" },
- { &fs_names[314], 0, 1, "Fractions en Diagonale" },
- { &fs_names[444], 0, 1, "Chevauchement des caract\217res" },
- { &fs_names[316], 0, 1, "\203viter le chevauchement" },
- { &fs_names[446], 0, 1, "Laisser le Chevauchement" },
- { &fs_names[317], 0, 1, "Extras Typographiques" },
- { &fs_names[448], 0, 1, "Tirets vers Tiret Large" },
- { &fs_names[449], 0, 1, "Tiret vers Tiret Moyen" },
- { &fs_names[450], 0, 1, "Z\216ro non Barr\216" },
- { &fs_names[451], 0, 1, "?! vers InterroExclam" },
- { &fs_names[336], 0, 1, "Apostrophes Intelligentes" },
- { &fs_names[453], 0, 1, "... vers Ellipse" },
- { &fs_names[318], 0, 1, "Extras Math\216matiques" },
- { &fs_names[319], 0, 1, "Tiret vers Moins" },
- { &fs_names[320], 0, 1, "\203toile vers Multipli\216" },
- { &fs_names[457], 0, 1, "Barre pench\216e vers Divis\216" },
- { &fs_names[458], 0, 1, "Ligatures pour In\216galit\216s" },
- { &fs_names[459], 0, 1, "Passage en Exposant" },
- { &fs_names[460], 0, 1, "Ensembles Ornementaux" },
- { &fs_names[322], 0, 1, "Pas d'Ornements" },
- { &fs_names[462], 0, 1, "Dingbats" },
- { &fs_names[463], 0, 1, "Symboles Sp\216cifiques \210 un Domaine" },
- { &fs_names[323], 0, 1, "Fleurons" },
- { &fs_names[465], 0, 1, "Bordures D\216coratives" },
- { &fs_names[466], 0, 1, "Symboles Internationaux" },
- { &fs_names[467], 0, 1, "Symboles Math\216matiques" },
- { &fs_names[468], 0, 1, "Caract\217res Alternatifs" },
- { &fs_names[325], 0, 1, "Sans Caract\217res Alternatifs" },
- { &fs_names[470], 0, 1, "Avec Caract\217res Alternatifs" },
- { &fs_names[471], 0, 1, "Autres Caract\217res Alternatifs" },
- { &fs_names[472], 0, 1, "Complexit\216 du Dessin" },
- { &fs_names[327], 0, 1, "Dessin Niveau 1" },
- { &fs_names[328], 0, 1, "Dessin Niveau 2" },
- { &fs_names[329], 0, 1, "Dessin Niveau 3" },
- { &fs_names[330], 0, 1, "Dessin Niveau 4" },
- { &fs_names[477], 0, 1, "Dessin Niveau 5" },
- { &fs_names[478], 0, 1, "Options de Style" },
- { &fs_names[479], 0, 1, "Texte Ordinaire" },
- { &fs_names[480], 0, 1, "Texte Majeur" },
- { &fs_names[481], 0, 1, "Texte en Relief" },
- { &fs_names[482], 0, 1, "Majuscules Enlumin\216es" },
- { &fs_names[483], 0, 1, "Majuscules de Titrage" },
- { &fs_names[484], 0, 1, "Majuscules avec Descendantes" },
- { &fs_names[485], 0, 1, "Forme des Caract\217res" },
- { &fs_names[486], 0, 1, "Traditionelle" },
- { &fs_names[487], 0, 1, "Simplifi\216e" },
- { &fs_names[488], 0, 1, "jis 1978" },
- { &fs_names[489], 0, 1, "jis 1983" },
- { &fs_names[490], 0, 1, "jis 1990" },
- { &fs_names[491], 0, 1, "Traditionelle Alt 1" },
- { &fs_names[492], 0, 1, "Traditionelle Alt 2" },
- { &fs_names[493], 0, 1, "Traditionelle Alt 3" },
- { &fs_names[494], 0, 1, "Traditionelle Alt 4" },
- { &fs_names[495], 0, 1, "Traditionelle Alt 5" },
- { &fs_names[496], 0, 1, "Expert" },
- { &fs_names[497], 0, 1, "Style des Chiffres" },
- { &fs_names[332], 0, 1, "Chiffres Anciens (bas de casse)" },
- { &fs_names[333], 0, 1, "Chiffres Conventionnels (alignants)" },
- { &fs_names[500], 0, 1, "Espacement du Texte" },
- { &fs_names[501], 0, 1, "Proportionel" },
- { &fs_names[502], 0, 1, "Fixe" },
- { &fs_names[503], 0, 1, "Translitt\216ration" },
- { &fs_names[504], 0, 1, "Sans Translitt\216ration" },
- { &fs_names[505], 0, 1, "Hanja vers Hangul" },
- { &fs_names[506], 0, 1, "Hiragana vers Katakana" },
- { &fs_names[507], 0, 1, "Katakana vers Hiragana" },
- { &fs_names[508], 0, 1, "Katakana vers Roman" },
- { &fs_names[509], 0, 1, "Roman vers Hiragana" },
- { &fs_names[510], 0, 1, "Roman vers Katakana" },
- { &fs_names[511], 0, 1, "Hanja vers Hangul Alt 1" },
- { &fs_names[512], 0, 1, "Hanja vers Hangul Alt 2" },
- { &fs_names[513], 0, 1, "Hanja vers Hangul Alt 3" },
- { &fs_names[514], 0, 1, "Annotations" },
- { &fs_names[515], 0, 1, "Sans Annotations" },
- { &fs_names[516], 0, 1, "Annotations Encadr\216es" },
- { &fs_names[517], 0, 1, "Annotations en Cadres arrondis" },
- { &fs_names[518], 0, 1, "Annotations dans des Cercles" },
- { &fs_names[519], 0, 1, "Annotations dans des Cercles inverses" },
- { &fs_names[520], 0, 1, "Annotations Parenth\217s\216es" },
- { &fs_names[521], 0, 1, "Annotations avec des ." },
- { &fs_names[522], 0, 1, "Annotations en Chiffres Romains" },
- { &fs_names[523], 0, 1, "Annotations Diamant" },
- { &fs_names[524], 0, 1, "Espacement Kana" },
- { &fs_names[525], 0, 1, "Pleine Taille" },
- { &fs_names[526], 0, 1, "Proportionnel" },
- { &fs_names[527], 0, 1, "Espacement des Id\216ogrammes" },
- { &fs_names[528], 0, 1, "Pleine Taille" },
- { &fs_names[529], 0, 1, "Proportionnel" },
- { &fs_names[533], 0, 1, "Espacement des CJK romains" },
- { &fs_names[534], 0, 1, "Pleine Taille" },
- { &fs_names[535], 0, 1, "Proportionnel" },
- { &fs_names[536], 0, 1, "Romains par D\216faut" },
- { &fs_names[537], 0, 1, "Romains Pleine Taille" },
- { &fs_names[340], 0, 1, "D\216composition Unicode" },
- { &fs_names[341], 0, 1, "D\216composition Canonique" },
- { &fs_names[342], 0, 2, "Alle typografischen M\232glichkeiten" },
- { &fs_names[343], 0, 2, "Alle Auszeichnungsarten" },
- { &fs_names[344], 0, 2, "Ligaturen" },
- { &fs_names[346], 0, 2, "Normale Ligaturen" },
- { &fs_names[345], 0, 2, "Seltene Ligaturen" },
- { &fs_names[347], 0, 2, "Schreibweise" },
- { &fs_names[348], 0, 2, "Gro\247/Klein" },
- { &fs_names[349], 0, 2, "Gro\247" },
- { &fs_names[350], 0, 2, "Kapit\212lchen" },
- { &fs_names[351], 0, 2, "Ziffernabst\212nde" },
- { &fs_names[352], 0, 2, "Tabellenziffern" },
- { &fs_names[353], 0, 2, "Proportionalziffern" },
- { &fs_names[354], 0, 2, "Zierbuchstabe" },
- { &fs_names[355], 0, 2, "Zierbuchstabe Zeilenende" },
- { &fs_names[356], 0, 2, "Zierbuchstabe Zeilenanfang" },
- { &fs_names[357], 0, 2, "Zierbuchstabe Wortanfang" },
- { &fs_names[358], 0, 2, "Zierbuchstabe Wortende" },
- { &fs_names[359], 0, 2, "Zierbuchstabe Beliebig" },
- { &fs_names[360], 0, 2, "Hoch-/Tiefstellen" },
- { &fs_names[361], 0, 2, "Hochgestellt" },
- { &fs_names[362], 0, 2, "Normal" },
- { &fs_names[363], 0, 2, "Tiefgestellt" },
- { &fs_names[364], 0, 2, "Ordnungszahlen" },
- { &fs_names[365], 0, 2, "Br\237che" },
- { &fs_names[367], 0, 2, "Kein Bruche" },
- { &fs_names[366], 0, 2, "Diagonaler Bruch" },
- { &fs_names[368], 0, 2, "\206berlappen" },
- { &fs_names[369], 0, 2, "\206berlappen vermeiden" },
- { &fs_names[335], 0, 2, "Typographische Extras" },
- { &fs_names[370], 0, 2, "Mathematische Sonderzeichen" },
- { &fs_names[371], 0, 2, "Minuszeichen" },
- { &fs_names[372], 0, 2, "Malzeichen" },
- { &fs_names[373], 0, 2, "Sonderzeichen" },
- { &fs_names[374], 0, 2, "Keine Sonderzeichen" },
- { &fs_names[375], 0, 2, "Pflanzenornamente" },
- { &fs_names[376], 0, 2, "Alternative Zeichen" },
- { &fs_names[377], 0, 2, "Keine Alternativ-Figuren" },
- { &fs_names[378], 0, 2, "Modifikationsgrad" },
- { &fs_names[379], 0, 2, "Design Stufe 1" },
- { &fs_names[380], 0, 2, "Design Stufe 2" },
- { &fs_names[381], 0, 2, "Design Stufe 3" },
- { &fs_names[382], 0, 2, "Design Stufe 4" },
- { &fs_names[383], 0, 2, "Zahlendarstellung" },
- { &fs_names[384], 0, 2, "Medi\276val-Ziffern" },
- { &fs_names[385], 0, 2, "Normale Ziffern" },
- { &fs_names[386], 0, 2, "Diphtong Ligaturen" },
- { &fs_names[387], 0, 2, "Typografische Extras" },
- { &fs_names[388], 0, 2, "Ersetzen mit geschwungenen Anf\237hrungszeichen" },
- { &fs_names[389], 0, 2, "Keine Ver\212nderung" },
- { &fs_names[390], 0, 2, "Diakritische Zeichen" },
- { &fs_names[391], 0, 2, "Diakritische Zeichen zeigen" },
- { &fs_names[392], 0, 2, "In Unicode zerlegen" },
- { &fs_names[393], 0, 2, "anerkannte Komposition" },
- { &fs_names[394], 0, 3, "Funzioni Tipografiche" },
- { &fs_names[395], 0, 3, "Tutte le Funzioni" },
- { &fs_names[396], 0, 3, "Legature" },
- { &fs_names[399], 0, 3, "Legature Rare" },
- { &fs_names[398], 0, 3, "Legature pi\235 Comuni" },
- { NULL, 0, 3, "Maiuscolo o Minuscolo" },
- { &fs_names[410], 0, 3, "Maiuscolo & minuscolo" },
- { &fs_names[411], 0, 3, "Tutto in Maiuscolo" },
- { &fs_names[413], 0, 3, "Maiuscoletto" },
- { NULL, 0, 3, "Spaziatura numeri" },
- { &fs_names[423], 0, 3, "Monospaziata" },
- { &fs_names[424], 0, 3, "Proporzionale" },
- { &fs_names[425], 0, 3, "Lettere Ornate" },
- { &fs_names[429], 0, 3, "Fine Riga" },
- { &fs_names[428], 0, 3, "Inizio Riga" },
- { &fs_names[426], 0, 3, "All'inizio" },
- { &fs_names[427], 0, 3, "Alla Fine" },
- { &fs_names[430], 0, 3, "All'interno" },
- { NULL, 0, 3, "Posizione Verticale" },
- { &fs_names[437], 0, 3, "Apice" },
- { &fs_names[436], 0, 3, "Posizione Normale" },
- { &fs_names[438], 0, 3, "Pedice" },
- { &fs_names[439], 0, 3, "Ordinali" },
- { NULL, 0, 3, "Frazioni" },
- { &fs_names[443], 0, 3, "Frazioni Diagonali" },
- { &fs_names[441], 0, 3, "Nessuna Frazione" },
- { NULL, 0, 3, "Caratteri Sovrapposti" },
- { &fs_names[445], 0, 3, "Nessuna Sovrapposizione" },
- { &fs_names[454], 0, 3, "Conversioni Matematiche" },
- { &fs_names[455], 0, 3, "Trattino per Sottrazione" },
- { &fs_names[456], 0, 3, "Asterisco per Moltiplicazione" },
- { NULL, 0, 3, "Impostazione Ornamenti" },
- { &fs_names[461], 0, 3, "Nessun Ornamento" },
- { &fs_names[464], 0, 3, "Fleurons" },
- { NULL, 0, 3, "Caratteri Alternativi" },
- { &fs_names[469], 0, 3, "Nessuna alternativa" },
- { NULL, 0, 3, "Design Complexity" },
- { &fs_names[473], 0, 3, "Livello 1" },
- { &fs_names[474], 0, 3, "Livello 2" },
- { &fs_names[475], 0, 3, "Livello 3" },
- { &fs_names[476], 0, 3, "Livello 4" },
- { NULL, 0, 3, "Posizione Numeri" },
- { &fs_names[498], 0, 3, "Sopra la Linea Base" },
- { &fs_names[499], 0, 3, "Tradizionale" },
- { &fs_names[402], 0, 3, "Legature dittonghi" },
- { &fs_names[447], 0, 3, "Extra tipografici" },
- { &fs_names[452], 0, 3, "Virgolette eleganti" },
- { &fs_names[434], 0, 3, "Nessuna modifica" },
- { NULL, 0, 3, "Diacritici" },
- { &fs_names[432], 0, 3, "Mostra diacritici" },
- { &fs_names[538], 0, 3, "Scomposizione unicode" },
- { &fs_names[539], 0, 3, "Composizione canonica" },
- { NULL, 0, 4, "Alle typografische kenmerken" },
- { NULL, 0, 4, "Alle typekenmerken" },
- { NULL, 0, 4, "Ligaturen" },
- { NULL, 0, 4, "Vereiste ligaturen" },
- { NULL, 0, 4, "Gemeenschappelijke Ligaturen" },
- { NULL, 0, 4, "Zeldzame ligaturen" },
- { NULL, 0, 4, "Logoligaturen" },
- { NULL, 0, 4, "Rebusligaturen" },
- { NULL, 0, 4, "Tweeklankligaturen" },
- { NULL, 0, 4, "Vierkante ligaturen" },
- { NULL, 0, 4, "Afgekorte vierkante ligatures" },
- { NULL, 0, 4, "Cursieve verbinding" },
- { NULL, 0, 4, "Niet verbonden" },
- { NULL, 0, 4, "Gedeeltelijk verbonden" },
- { NULL, 0, 4, "Cursief" },
- { NULL, 0, 4, "Hoofd/kleine letters" },
- { NULL, 0, 4, "Hoofd- en kleine letters" },
- { NULL, 0, 4, "Alles in hoofdletters" },
- { NULL, 0, 4, "Alles in kleine letters" },
- { NULL, 0, 4, "Kleine hoofdletters" },
- { NULL, 0, 4, "Eerste hoofdletters" },
- { NULL, 0, 4, "Eerste en kleine hoofdletters" },
- { NULL, 0, 4, "Verticale vervanging" },
- { NULL, 0, 4, "Verticale vervanging" },
- { NULL, 0, 4, "Geen verticale vervanging" },
- { NULL, 0, 4, "Taalkundige herschikking" },
- { NULL, 0, 4, "Taalkundige herschikking" },
- { NULL, 0, 4, "Geen taalkundige herschikking" },
- { NULL, 0, 4, "Nummerafstanden" },
- { NULL, 0, 4, "Vaste nummerafstanden" },
- { NULL, 0, 4, "Proportionele nummers" },
- { NULL, 0, 4, "Slimme versieringingen" },
- { NULL, 0, 4, "Woordbegin-versieringingen" },
- { NULL, 0, 4, "Woordeinde-versieringingen" },
- { NULL, 0, 4, "Regelbegin-versieringingen" },
- { NULL, 0, 4, "Regeleinde-versieringingen" },
- { NULL, 0, 4, "Niet-einde-versieringingen" },
- { NULL, 0, 4, "Accenten" },
- { NULL, 0, 4, "Accenten tonen" },
- { NULL, 0, 4, "Accenten verbergen" },
- { NULL, 0, 4, "Accenten ontleden" },
- { NULL, 0, 4, "Verticale positie" },
- { NULL, 0, 4, "Normale verticale positie" },
- { NULL, 0, 4, "Superieuren" },
- { NULL, 0, 4, "Inferieuren" },
- { NULL, 0, 4, "Ordinalen" },
- { NULL, 0, 4, "Breuken" },
- { NULL, 0, 4, "Geen breuken" },
- { NULL, 0, 4, "Verticale breuken" },
- { NULL, 0, 4, "Diagonale breuken" },
- { NULL, 0, 4, "Overlappende tekens" },
- { NULL, 0, 4, "Overlap voorkomen" },
- { NULL, 0, 4, "Overlap toestaan" },
- { NULL, 0, 4, "Typografische extras" },
- { NULL, 0, 4, "Koppelteken naar em-streep" },
- { NULL, 0, 4, "Koppelteken naar en-streepje" },
- { NULL, 0, 4, "Nul zonder schuine streep" },
- { NULL, 0, 4, "Vorm interrobang" },
- { NULL, 0, 4, "Slimme aanhalingstekens" },
- { NULL, 0, 4, "Punten naar ellipsen" },
- { NULL, 0, 4, "Wiskundige extras" },
- { NULL, 0, 4, "Koppelteken naar minteken" },
- { NULL, 0, 4, "Sterretje naar multiplicatieteken" },
- { NULL, 0, 4, "Schuine streep naar deelteken" },
- { NULL, 0, 4, "Ongelijkheidsligaturen" },
- { NULL, 0, 4, "Exponenten aan" },
- { NULL, 0, 4, "Ornamentenverzamelingen" },
- { NULL, 0, 4, "Geen ornamenten" },
- { NULL, 0, 4, "Dingbats" },
- { NULL, 0, 4, "Pi-tekens" },
- { NULL, 0, 4, "Fleurons" },
- { NULL, 0, 4, "Decoratieve randen" },
- { NULL, 0, 4, "Internationale symbolen" },
- { NULL, 0, 4, "Wiskundige Symbolen" },
- { NULL, 0, 4, "Tekenalternatieven" },
- { NULL, 0, 4, "Geen alternatieven" },
- { NULL, 0, 4, "Alternatieve tekens" },
- { NULL, 0, 4, "Andere alternatieven" },
- { NULL, 0, 4, "Ontwepcomplexiteit" },
- { NULL, 0, 4, "Ontwerpniveau 1" },
- { NULL, 0, 4, "Ontwerpniveau 2" },
- { NULL, 0, 4, "Ontwerpniveau 3" },
- { NULL, 0, 4, "Ontwerpniveau 4" },
- { NULL, 0, 4, "Ontwerpniveau 5" },
- { NULL, 0, 4, "Stijlopties" },
- { NULL, 0, 4, "Geen stijl ptions" },
- { NULL, 0, 4, "Tekst tonen" },
- { NULL, 0, 4, "Gegraveerde tekst" },
- { NULL, 0, 4, "Uitgelichte koppen" },
- { NULL, 0, 4, "Titelkoppen" },
- { NULL, 0, 4, "Eindkoppen" },
- { NULL, 0, 4, "Tekenvorm" },
- { NULL, 0, 4, "Traditioneel" },
- { NULL, 0, 4, "Vereenvoudigd" },
- { NULL, 0, 4, "jis 1978" },
- { NULL, 0, 4, "jis 1983" },
- { NULL, 0, 4, "jis 1990" },
- { NULL, 0, 4, "Traditioneel Alt 1" },
- { NULL, 0, 4, "Traditioneel Alt 2" },
- { NULL, 0, 4, "Traditioneel Alt 3" },
- { NULL, 0, 4, "Traditioneel Alt 4" },
- { NULL, 0, 4, "Traditioneel Alt 5" },
- { NULL, 0, 4, "Expert" },
- { NULL, 0, 4, "Nummerhoogte" },
- { NULL, 0, 4, "Kleine nummers" },
- { NULL, 0, 4, "Grote nummers" },
- { NULL, 0, 4, "TekstspatiQring" },
- { NULL, 0, 4, "Proportioneel" },
- { NULL, 0, 4, "Gelijk gespatieerd" },
- { NULL, 0, 4, "Transliteratie" },
- { NULL, 0, 4, "Geen transliteratie" },
- { NULL, 0, 4, "Hanja naar Hangul" },
- { NULL, 0, 4, "Hiragana naar Katakana" },
- { NULL, 0, 4, "Katakana naar Hiragana" },
- { NULL, 0, 4, "Katakana naar Romeins" },
- { NULL, 0, 4, "Romeins naar Hiragana" },
- { NULL, 0, 4, "Romeins naar Katakana" },
- { NULL, 0, 4, "Hanja naar Hangul Alt 1" },
- { NULL, 0, 4, "Hanja naar Hangul Alt 2" },
- { NULL, 0, 4, "Hanja naar Hangul Alt 3" },
- { NULL, 0, 4, "Annotatie" },
- { NULL, 0, 4, "Geen annotatie" },
- { NULL, 0, 4, "Vierkantannotatie" },
- { NULL, 0, 4, "Ronde-vierkantannotatie" },
- { NULL, 0, 4, "Cirkelannotatie" },
- { NULL, 0, 4, "Omgekeerde cirkelannotatie" },
- { NULL, 0, 4, "Aanhalingstekenannotatie" },
- { NULL, 0, 4, "Puntannotatie" },
- { NULL, 0, 4, "Romeinse-cijferannotatie" },
- { NULL, 0, 4, "Diamantannotatie" },
- { NULL, 0, 4, "Kana spatiQring" },
- { NULL, 0, 4, "Volledige breedte" },
- { NULL, 0, 4, "Proportioneel" },
- { &fs_names[530], 0, 4, "Ideographische spatiQring" },
- { &fs_names[531], 0, 4, "Volledige breedte" },
- { &fs_names[532], 0, 4, "Proportioneel" },
- { NULL, 0, 4, "IdeograafspatiQring" },
- { NULL, 0, 4, "Volledige breedte" },
- { NULL, 0, 4, "Proportioneel" },
- { NULL, 0, 4, "CJK Romeinse spatiQring" },
- { NULL, 0, 4, "Halve breedte" },
- { NULL, 0, 4, "Proportioneel" },
- { NULL, 0, 4, "Default" },
- { NULL, 0, 4, "Volledige breedte" },
- { NULL, 0, 4, "Unicodeontleding" },
- { NULL, 0, 4, "Canonieke ontleding" },
- { NULL, 0, 0, NULL }
-};
-
-static struct macsetting fs_settings[] = {
- { NULL, 0, 0, &fs_names[1], 0 },
- { NULL, 14, 0, &fs_names[10], 0 },
- { &fs_settings[1], 12, 0, &fs_names[9], 0 },
- { &fs_settings[2], 10, 0, &fs_names[8], 0 },
- { &fs_settings[3], 8, 0, &fs_names[7], 0 },
- { &fs_settings[4], 6, 0, &fs_names[6], 0 },
- { &fs_settings[5], 4, 0, &fs_names[5], 0 },
- { &fs_settings[6], 2, 0, &fs_names[4], 1 },
- { &fs_settings[7], 0, 0, &fs_names[3], 1 },
- { NULL, 2, 0, &fs_names[14], 0 },
- { &fs_settings[9], 1, 0, &fs_names[13], 0 },
- { &fs_settings[10], 0, 0, &fs_names[12], 1 },
- { NULL, 5, 0, &fs_names[21], 0 },
- { &fs_settings[12], 4, 0, &fs_names[20], 0 },
- { &fs_settings[13], 3, 0, &fs_names[19], 0 },
- { &fs_settings[14], 2, 0, &fs_names[18], 0 },
- { &fs_settings[15], 1, 0, &fs_names[17], 0 },
- { &fs_settings[16], 0, 0, &fs_names[16], 1 },
- { NULL, 1, 0, &fs_names[24], 0 },
- { &fs_settings[18], 0, 0, &fs_names[23], 1 },
- { NULL, 1, 0, &fs_names[27], 0 },
- { &fs_settings[20], 0, 0, &fs_names[26], 1 },
- { NULL, 1, 0, &fs_names[30], 0 },
- { &fs_settings[22], 0, 0, &fs_names[29], 1 },
- { NULL, 8, 0, &fs_names[36], 0 },
- { &fs_settings[24], 6, 0, &fs_names[35], 0 },
- { &fs_settings[25], 4, 0, &fs_names[34], 0 },
- { &fs_settings[26], 2, 0, &fs_names[33], 0 },
- { &fs_settings[27], 0, 0, &fs_names[32], 0 },
- { NULL, 2, 0, &fs_names[40], 0 },
- { &fs_settings[29], 1, 0, &fs_names[39], 0 },
- { &fs_settings[30], 0, 0, &fs_names[38], 1 },
- { NULL, 3, 0, &fs_names[45], 0 },
- { &fs_settings[32], 2, 0, &fs_names[44], 0 },
- { &fs_settings[33], 1, 0, &fs_names[43], 0 },
- { &fs_settings[34], 0, 0, &fs_names[42], 1 },
- { NULL, 2, 0, &fs_names[49], 0 },
- { &fs_settings[36], 1, 0, &fs_names[48], 0 },
- { &fs_settings[37], 0, 0, &fs_names[47], 1 },
- { NULL, 1, 0, &fs_names[52], 0 },
- { &fs_settings[39], 0, 0, &fs_names[51], 1 },
- { NULL, 10, 0, &fs_names[59], 0 },
- { &fs_settings[41], 8, 0, &fs_names[58], 0 },
- { &fs_settings[42], 6, 0, &fs_names[57], 0 },
- { &fs_settings[43], 4, 0, &fs_names[56], 0 },
- { &fs_settings[44], 2, 0, &fs_names[55], 0 },
- { &fs_settings[45], 0, 0, &fs_names[54], 0 },
- { NULL, 8, 0, &fs_names[65], 0 },
- { &fs_settings[47], 6, 0, &fs_names[64], 0 },
- { &fs_settings[48], 4, 0, &fs_names[63], 0 },
- { &fs_settings[49], 2, 0, &fs_names[62], 0 },
- { &fs_settings[50], 0, 0, &fs_names[61], 0 },
- { NULL, 6, 0, &fs_names[73], 0 },
- { &fs_settings[52], 5, 0, &fs_names[72], 0 },
- { &fs_settings[53], 4, 0, &fs_names[71], 0 },
- { &fs_settings[54], 3, 0, &fs_names[70], 0 },
- { &fs_settings[55], 2, 0, &fs_names[69], 0 },
- { &fs_settings[56], 1, 0, &fs_names[68], 0 },
- { &fs_settings[57], 0, 0, &fs_names[67], 1 },
- { NULL, 2, 0, &fs_names[77], 0 },
- { &fs_settings[59], 1, 0, &fs_names[76], 0 },
- { &fs_settings[60], 0, 0, &fs_names[75], 1 },
- { NULL, 4, 0, &fs_names[83], 0 },
- { &fs_settings[62], 3, 0, &fs_names[82], 0 },
- { &fs_settings[63], 2, 0, &fs_names[81], 0 },
- { &fs_settings[64], 1, 0, &fs_names[80], 0 },
- { &fs_settings[65], 0, 0, &fs_names[79], 1 },
- { NULL, 5, 0, &fs_names[90], 0 },
- { &fs_settings[67], 4, 0, &fs_names[89], 0 },
- { &fs_settings[68], 3, 0, &fs_names[88], 0 },
- { &fs_settings[69], 2, 0, &fs_names[87], 0 },
- { &fs_settings[70], 1, 0, &fs_names[86], 0 },
- { &fs_settings[71], 0, 0, &fs_names[85], 1 },
- { NULL, 10, 0, &fs_names[102], 0 },
- { &fs_settings[73], 9, 0, &fs_names[101], 0 },
- { &fs_settings[74], 8, 0, &fs_names[100], 0 },
- { &fs_settings[75], 7, 0, &fs_names[99], 0 },
- { &fs_settings[76], 6, 0, &fs_names[98], 0 },
- { &fs_settings[77], 5, 0, &fs_names[97], 0 },
- { &fs_settings[78], 4, 0, &fs_names[96], 0 },
- { &fs_settings[79], 3, 0, &fs_names[95], 0 },
- { &fs_settings[80], 2, 0, &fs_names[94], 0 },
- { &fs_settings[81], 1, 0, &fs_names[93], 0 },
- { &fs_settings[82], 0, 0, &fs_names[92], 1 },
- { NULL, 1, 0, &fs_names[105], 1 },
- { &fs_settings[84], 0, 0, &fs_names[104], 0 },
- { NULL, 1, 0, &fs_names[108], 0 },
- { &fs_settings[86], 0, 0, &fs_names[107], 1 },
- { NULL, 9, 0, &fs_names[119], 0 },
- { &fs_settings[88], 8, 0, &fs_names[118], 0 },
- { &fs_settings[89], 7, 0, &fs_names[117], 0 },
- { &fs_settings[90], 6, 0, &fs_names[116], 0 },
- { &fs_settings[91], 5, 0, &fs_names[115], 0 },
- { &fs_settings[92], 4, 0, &fs_names[114], 0 },
- { &fs_settings[93], 3, 0, &fs_names[113], 0 },
- { &fs_settings[94], 2, 0, &fs_names[112], 0 },
- { &fs_settings[95], 1, 0, &fs_names[111], 0 },
- { &fs_settings[96], 0, 0, &fs_names[110], 1 },
- { NULL, 8, 0, &fs_names[129], 0 },
- { &fs_settings[98], 7, 0, &fs_names[128], 0 },
- { &fs_settings[99], 6, 0, &fs_names[127], 0 },
- { &fs_settings[100], 5, 0, &fs_names[126], 0 },
- { &fs_settings[101], 4, 0, &fs_names[125], 0 },
- { &fs_settings[102], 3, 0, &fs_names[124], 0 },
- { &fs_settings[103], 2, 0, &fs_names[123], 0 },
- { &fs_settings[104], 1, 0, &fs_names[122], 0 },
- { &fs_settings[105], 0, 0, &fs_names[121], 1 },
- { NULL, 1, 0, &fs_names[132], 0 },
- { &fs_settings[107], 0, 0, &fs_names[131], 1 },
- { NULL, 1, 0, &fs_names[135], 0 },
- { &fs_settings[109], 0, 0, &fs_names[134], 1 },
- { NULL, 0, 0, &fs_names[145], 0 },
- { NULL, 3, 0, &fs_names[143], 0 },
- { &fs_settings[112], 2, 0, &fs_names[142], 0 },
- { &fs_settings[113], 1, 0, &fs_names[141], 0 },
- { &fs_settings[114], 0, 0, &fs_names[140], 1 },
- { NULL, 0, 0, NULL, 0 }
-};
-
-static MacFeat fs_features[] = {
- { NULL, 103, 1, 0, 0, &fs_names[139], &fs_settings[115] },
- { &fs_features[0], 27, 0, 0, 0, &fs_names[144], &fs_settings[111] },
- { &fs_features[1], 26, 1, 0, 0, &fs_names[133], &fs_settings[110] },
- { &fs_features[2], 25, 1, 0, 0, &fs_names[130], &fs_settings[108] },
- { &fs_features[3], 24, 1, 0, 0, &fs_names[120], &fs_settings[106] },
- { &fs_features[4], 23, 1, 0, 0, &fs_names[109], &fs_settings[97] },
- { &fs_features[5], 22, 1, 0, 0, &fs_names[106], &fs_settings[87] },
- { &fs_features[6], 21, 1, 1, 0, &fs_names[103], &fs_settings[85] },
- { &fs_features[7], 20, 1, 0, 0, &fs_names[91], &fs_settings[83] },
- { &fs_features[8], 19, 1, 0, 0, &fs_names[84], &fs_settings[72] },
- { &fs_features[9], 18, 1, 0, 0, &fs_names[78], &fs_settings[66] },
- { &fs_features[10], 17, 1, 0, 0, &fs_names[74], &fs_settings[61] },
- { &fs_features[11], 16, 1, 0, 0, &fs_names[66], &fs_settings[58] },
- { &fs_features[12], 15, 0, 0, 0, &fs_names[60], &fs_settings[51] },
- { &fs_features[13], 14, 0, 0, 0, &fs_names[53], &fs_settings[46] },
- { &fs_features[14], 13, 1, 0, 0, &fs_names[50], &fs_settings[40] },
- { &fs_features[15], 11, 1, 0, 0, &fs_names[46], &fs_settings[38] },
- { &fs_features[16], 10, 1, 0, 0, &fs_names[41], &fs_settings[35] },
- { &fs_features[17], 9, 1, 0, 0, &fs_names[37], &fs_settings[31] },
- { &fs_features[18], 8, 0, 0, 0, &fs_names[31], &fs_settings[28] },
- { &fs_features[19], 6, 1, 0, 0, &fs_names[28], &fs_settings[23] },
- { &fs_features[20], 5, 1, 0, 0, &fs_names[25], &fs_settings[21] },
- { &fs_features[21], 4, 1, 0, 0, &fs_names[22], &fs_settings[19] },
- { &fs_features[22], 3, 1, 0, 0, &fs_names[15], &fs_settings[17] },
- { &fs_features[23], 2, 1, 0, 0, &fs_names[11], &fs_settings[11] },
- { &fs_features[24], 1, 0, 0, 0, &fs_names[2], &fs_settings[8] },
- { &fs_features[25], 0, 0, 0, 0, &fs_names[0], &fs_settings[0] },
- { NULL, 0, 0, 0, 0, NULL, NULL }
-};
-
-MacFeat *default_mac_feature_map = &fs_features[26],
- *builtin_mac_feature_map=&fs_features[26],
- *user_mac_feature_map;
-
-
-struct macname *MacNameCopy(struct macname *mn) {
- struct macname *head=NULL, *last=NULL, *cur;
-
- while ( mn!=NULL ) {
- cur = chunkalloc(sizeof(struct macname));
- cur->enc = mn->enc;
- cur->lang = mn->lang;
- cur->name = copy(mn->name);
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- mn = mn->next;
- }
-return( head );
-}
-
-/* Sigh. This list is duplicated in macencui.c */
static struct { char *name; int code; } localmaclang[] = {
{N_("English"), 0},
{N_("French"), 1},
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/memory.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/memory.c
new file mode 100644
index 00000000000..3d977672cdb
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/memory.c
@@ -0,0 +1,101 @@
+/* Copyright (C) 2000-2012 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "basics.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* wrappers around standard memory routines so we can trap errors. */
+static void default_trap(void) {
+ fprintf(stderr, "Attempt to allocate memory failed.\n" );
+ abort();
+}
+
+static void (*trap)(void) = default_trap;
+
+void galloc_set_trap(void (*newtrap)(void)) {
+ if ( newtrap==NULL ) newtrap = default_trap;
+ trap = newtrap;
+}
+
+#ifdef USE_OUR_MEMORY
+void *galloc(long size) {
+ void *ret;
+ /* Avoid malloc(0) as malloc is allowed to return NULL.
+ * If malloc fails, call trap() to allow it to possibly
+ * recover memory and try again.
+ */
+ while (( ret = malloc(size==0 ? sizeof(int) : size))==NULL )
+ trap();
+ memset(ret,0x3c,size); /* fill with random junk for debugging */
+return( ret );
+}
+
+void *gcalloc(int cnt,long size) {
+ void *ret;
+ while (( ret = calloc(cnt,size))==NULL )
+ trap();
+return( ret );
+}
+
+void *grealloc(void *old,long size) {
+ void *ret;
+ while (( ret = realloc(old,size))==NULL )
+ trap();
+return( ret );
+}
+
+void gfree(void *old) {
+ free(old);
+}
+#endif /* USE_OUR_MEMORY */
+
+void NoMoreMemMessage(void) {
+/* Output an 'Out of memory' message, then continue */
+ fprintf(stderr, "Out of memory\n" );
+}
+
+char *copy(const char *str) {
+ char *ret;
+
+ if ( str==NULL )
+return( NULL );
+ ret = (char *) galloc(strlen(str)+1);
+ strcpy(ret,str);
+return( ret );
+}
+
+char *copyn(const char *str,long n) {
+ char *ret;
+
+ if ( str==NULL )
+return( NULL );
+ ret = (char *) galloc(n+1);
+ memcpy(ret,str,n);
+ ret[n]='\0';
+return( ret );
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.c
index 6bed24e9a54..db051b7fe54 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.c
@@ -64,57 +64,20 @@ return(axismap->designs[axismap->points-1]);
static char *_MMMakeFontname(MMSet *mm,real *normalized,char **fullname) {
char *pt, *pt2, *hyphen=NULL;
char *ret = NULL;
- int i,j;
-
- if ( mm->apple ) {
- for ( i=0; i<mm->named_instance_count; ++i ) {
- for ( j=0; j<mm->axis_count; ++j ) {
- if (( normalized[j] == -1 &&
- RealApprox(mm->named_instances[i].coords[j],mm->axismaps[j].min) ) ||
- ( normalized[j] == 0 &&
- RealApprox(mm->named_instances[i].coords[j],mm->axismaps[j].def) ) ||
- ( normalized[j] == 1 &&
- RealApprox(mm->named_instances[i].coords[j],mm->axismaps[j].max) ))
- /* A match so far */;
- else
- break;
- }
- if ( j==mm->axis_count )
- break;
- }
- if ( i!=mm->named_instance_count ) {
- char *styles = PickNameFromMacName(mm->named_instances[i].names);
- if ( styles==NULL )
- styles = FindEnglishNameInMacName(mm->named_instances[i].names);
- if ( styles!=NULL ) {
- ret = galloc(strlen(mm->normal->familyname)+ strlen(styles)+3 );
- strcpy(ret,mm->normal->familyname);
- hyphen = ret+strlen(ret);
- strcpy(hyphen," ");
- strcpy(hyphen+1,styles);
- free(styles);
- }
- }
- }
+ int i;
- if ( ret==NULL ) {
- pt = ret = galloc(strlen(mm->normal->familyname)+ mm->axis_count*15 + 1);
- strcpy(pt,mm->normal->familyname);
- pt += strlen(pt);
- *pt++ = '_';
- for ( i=0; i<mm->axis_count; ++i ) {
- if ( !mm->apple )
- sprintf( pt, " %d%s", (int) rint(MMAxisUnmap(mm,i,normalized[i])),
- MMAxisAbrev(mm->axes[i]));
- else
- sprintf( pt, " %.1f%s", MMAxisUnmap(mm,i,normalized[i]),
- MMAxisAbrev(mm->axes[i]));
- pt += strlen(pt);
- }
- if ( pt>ret && pt[-1]==' ' )
- --pt;
- *pt = '\0';
+ pt = ret = galloc(strlen(mm->normal->familyname)+ mm->axis_count*15 + 1);
+ strcpy(pt,mm->normal->familyname);
+ pt += strlen(pt);
+ *pt++ = '_';
+ for ( i=0; i<mm->axis_count; ++i ) {
+ sprintf( pt, " %d%s", (int) rint(MMAxisUnmap(mm,i,normalized[i])),
+ MMAxisAbrev(mm->axes[i]));
+ pt += strlen(pt);
}
+ if ( pt>ret && pt[-1]==' ' )
+ --pt;
+ *pt = '\0';
*fullname = ret;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/namelist.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/namelist.c
index d2795bc9600..cb88d72d195 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/namelist.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/namelist.c
@@ -569,10 +569,12 @@ return( NULL );
if ( nl2==NULL ) {
ff_post_error(_("NameList base missing"),_("NameList %s based on %s which could not be found"), nl->title, pt );
NameListFree(nl);
+ fclose(file);
return( NULL );
} else if ( nl->basedon!=NULL ) {
ff_post_error(_("NameList based twice"),_("NameList %s based on two NameLists"), nl->title );
NameListFree(nl);
+ fclose(file);
return( NULL );
}
nl->basedon = nl2;
@@ -582,6 +584,7 @@ return( NULL );
if ( *test=='\0' ) {
ff_post_error(_("NameList parsing error"),_("Missing rename \"to\" name %s\n%s"), nl->title, buffer );
NameListFree(nl);
+ fclose(file);
return( NULL );
}
*test='\0';
@@ -591,6 +594,7 @@ return( NULL );
if ( *test=='\0' ) {
ff_post_error(_("NameList parsing error"),_("Missing rename \"to\" name %s\n%s"), nl->title, buffer );
NameListFree(nl);
+ fclose(file);
return( NULL );
}
if ( rn_cnt>=rn_max-1 )
@@ -608,6 +612,7 @@ return( NULL );
if ( end==pt || uni<0 || uni>=unicode4_size ) {
ff_post_error(_("NameList parsing error"),_("Bad unicode value when parsing %s\n%s"), nl->title, buffer );
NameListFree(nl);
+ fclose(file);
return( NULL );
}
pt = end;
@@ -615,6 +620,7 @@ return( NULL );
if ( *pt=='\0' ) {
ff_post_error(_("NameList parsing error"),_("Missing name when parsing %s for unicode %x"), nl->title, uni );
NameListFree(nl);
+ fclose(file);
return( NULL );
}
for ( test=pt; *test; ++test ) {
@@ -624,6 +630,7 @@ return( NULL );
*test=='%' || *test=='/' ) {
ff_post_error(_("NameList parsing error"),_("Bad name when parsing %s for unicode %x"), nl->title, uni );
NameListFree(nl);
+ fclose(file);
return( NULL );
}
if ( *test&0x80 ) {
@@ -644,6 +651,7 @@ return( NULL );
else {
ff_post_error(_("NameList parsing error"),_("Multiple names when parsing %s for unicode %x"), nl->title, uni );
NameListFree(nl);
+ fclose(file);
return( NULL );
}
}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/noprefs.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/noprefs.c
index ba1f9ca5bfc..7fb9545d923 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/noprefs.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/noprefs.c
@@ -84,8 +84,6 @@ extern int new_em_size; /* in splineutil2.c */
extern int new_fonts_are_order2; /* in splineutil2.c */
extern int loaded_fonts_same_as_new; /* in splineutil2.c */
extern int use_second_indic_scripts; /* in tottfgpos.c */
-extern MacFeat *default_mac_feature_map, /* from macenc.c */
- *user_mac_feature_map;
extern int allow_utf8_glyphnames; /* in charinfo.c */
extern int ask_user_for_cmap; /* in parsettf.c */
extern NameList *force_names_when_opening;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsepfa.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsepfa.c
index 0c4108fa99e..1cff6a4858a 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsepfa.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsepfa.c
@@ -2575,7 +2575,6 @@ FontDict *_ReadPSFont(FILE *in) {
temp = tmpfile();
if ( temp==NULL ) {
LogError( _("Cannot open a temporary file\n") );
- fclose(in);
return(NULL);
}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
index 259682f61b4..c682146b352 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
@@ -30,7 +30,6 @@
#include <ustring.h>
#include <math.h>
#include <locale.h>
-#include <gwidget.h>
#include "ttf.h"
extern char *AdobeStandardEncoding[], *AdobeExpertEncoding[];
@@ -1066,9 +1065,6 @@ return( 0 ); /* Not version 1 of true type, nor Open Type */
case CHR('B','A','S','E'):
info->base_start = offset;
break;
- case CHR('b','s','l','n'):
- info->bsln_start = offset;
- break;
case CHR('C','F','F',' '):
info->cff_start = offset;
info->cff_length = length;
@@ -1152,30 +1148,6 @@ return( 0 ); /* Not version 1 of true type, nor Open Type */
info->math_start = offset;
info->math_length = length;
break;
- /* Apple stuff */
-#if 0
- case CHR('a','c','n','t'):
- info->acnt_start = offset;
- break;
-#endif
- case CHR('f','e','a','t'):
- info->feat_start = offset;
- break;
- case CHR('l','c','a','r'):
- info->lcar_start = offset;
- break;
- case CHR('m','o','r','t'):
- info->mort_start = offset;
- break;
- case CHR('m','o','r','x'):
- info->morx_start = offset;
- break;
- case CHR('o','p','b','d'):
- info->opbd_start = offset;
- break;
- case CHR('p','r','o','p'):
- info->prop_start = offset;
- break;
/* to make sense of instrs */
case CHR('c','v','t',' '):
info->cvt_start = offset;
@@ -1204,24 +1176,6 @@ return( 0 ); /* Not version 1 of true type, nor Open Type */
info->bdf_start = offset;
break;
- /* Apple's mm fonts */
- case CHR('g','v','a','r'):
- info->gvar_start = offset;
- info->gvar_len = length;
- break;
- case CHR('f','v','a','r'):
- info->fvar_start = offset;
- info->fvar_len = length;
- break;
- case CHR('a','v','a','r'):
- info->avar_start = offset;
- info->avar_len = length;
- break;
- case CHR('c','v','a','r'):
- info->cvar_start = offset;
- info->cvar_len = length;
- break;
-
default:
for ( j=0; j<info->savecnt; ++j ) if ( info->savetab[j].tag == tag ) {
info->savetab[j].offset = offset;
@@ -1253,10 +1207,6 @@ return( 0 ); /* Not version 1 of true type, nor Open Type */
LogError( _("This font contains multiple glyph descriptions\n only one will be used.\n"));
if ( info->gpos_start!=0 && info->kern_start!=0 )
LogError( _("This font contains both a 'kern' table and a 'GPOS' table.\n The 'kern' table will only be read if there is no 'kern' feature in 'GPOS'.\n"));
- if ( (info->mort_start!=0 || info->morx_start!=0) && info->gsub_start!=0 )
- LogError( _("This font contains both a 'mor[tx]' table and a 'GSUB' table.\n FF will only read feature/settings in 'morx' which do not match features\n found in 'GSUB'.\n"));
- if ( info->base_start!=0 && info->bsln_start!=0 )
- LogError( _("This font contains both a 'BASE' table and a 'bsln' table.\n FontForge will only read one of them ('BASE').\n"));
return( true );
}
@@ -1389,66 +1339,6 @@ return( NULL );
return( base );
}
-static struct macname *AddMacName(FILE *ttf,
- int strlen, int stroff,int spec,int language, struct macname *last) {
- struct macname *new = chunkalloc(sizeof(struct macname));
- long pos = ftell(ttf);
- char *pt;
- int i;
-
- new->next = last;
- new->enc = spec;
- new->lang = language;
- new->name = pt = galloc(strlen+1);
-
- fseek(ttf,stroff,SEEK_SET);
-
- for ( i=0; i<strlen; ++i )
- *pt++ = getc(ttf);
- *pt = '\0';
-
- fseek(ttf,pos,SEEK_SET);
-return( new );
-}
-
-static void MacFeatureAdd(FILE *ttf, struct ttfinfo *info, int id,
- int strlen, int stroff,int spec,int language) {
- MacFeat *f;
- struct macsetting *s;
-
- for ( f=info->features; f!=NULL; f=f->next ) {
- if ( f->strid==id ) {
- f->featname = AddMacName(ttf,strlen,stroff,spec,language,f->featname);
-return;
- } else {
- for ( s=f->settings; s!=NULL; s=s->next ) {
- if ( s->strid==id ) {
- s->setname = AddMacName(ttf,strlen,stroff,spec,language,s->setname);
-return;
- }
- }
- }
- }
- /* Well, there are some things in the name table other than feature/setting*/
- /* names. Let's keep track of everything just in case.... */
- if ( info->fvar_start!=0 ) {
- struct macidname *mi, *p;
- for ( p=NULL, mi=info->macstrids; mi!=NULL && mi->id!=id; p = mi, mi=mi->next );
- if ( mi==NULL ) {
- mi = chunkalloc(sizeof(struct macidname));
- mi->id = id;
- mi->last = mi->head = AddMacName(ttf,strlen,stroff,spec,language,NULL);
- if ( p==NULL )
- info->macstrids = mi;
- else
- p->next = mi;
- } else {
- mi->last->next = AddMacName(ttf,strlen,stroff,spec,language,NULL);
- mi->last = mi->last->next;
- }
- }
-}
-
static void ValidatePostScriptFontName(struct ttfinfo *info, char *str) {
char *end, *pt, *npt;
int complained = false;
@@ -1554,10 +1444,7 @@ static void TTFAddLangStr(FILE *ttf, struct ttfinfo *info, int id,
struct ttflangname *cur, *prev;
char *str;
- if ( plat==1 && id>=256 && (info->features!=NULL || info->fvar_start!=0)) {
- MacFeatureAdd(ttf,info,id,strlen,stroff,spec,language);
-return;
- } else if ( id<0 || id>=ttf_namemax )
+ if ( id<0 || id>=ttf_namemax )
return;
str = _readencstring(ttf,stroff,strlen,plat,spec,language);
@@ -1699,29 +1586,10 @@ struct otfname *FindAllLangEntries(FILE *ttf, struct ttfinfo *info, int id ) {
return( head );
}
-static struct macname *reversemacnames(struct macname *mn) {
- struct macname *next, *prev=NULL;
-
- if ( mn==NULL )
-return( NULL );
-
- next = mn->next;
- while ( next!=NULL ) {
- mn->next = prev;
- prev = mn;
- mn = next;
- next = mn->next;
- }
- mn->next = prev;
-return( mn );
-}
-
static void readttfcopyrights(FILE *ttf,struct ttfinfo *info) {
int i, cnt, tableoff;
int platform, specific, language, name, str_len, stroff;
- if ( info->feat_start!=0 )
- readmacfeaturemap(ttf,info);
if ( info->copyright_start!=0 ) {
fseek(ttf,info->copyright_start,SEEK_SET);
/* format selector = */ getushort(ttf);
@@ -1782,16 +1650,6 @@ static void readttfcopyrights(FILE *ttf,struct ttfinfo *info) {
if ( info->fontname!=NULL )
ValidatePostScriptFontName(info,info->fontname);
}
-
- if ( info->features ) {
- MacFeat *mf;
- struct macsetting *ms;
- for ( mf=info->features; mf!=NULL; mf = mf->next ) {
- mf->featname = reversemacnames(mf->featname);
- for ( ms=mf->settings; ms!=NULL; ms=ms->next )
- ms->setname = reversemacnames(ms->setname);
- }
- }
}
static void readttfpreglyph(FILE *ttf,struct ttfinfo *info) {
@@ -5287,8 +5145,6 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
/* for example if we have a vrt2 substitution of A to <unencoded> */
/* we could name the unencoded "A.vrt2" (though in this case we might */
/* try A.vert instead */ /* Werner suggested this */
- /* We could try this from morx too, except that apple features don't */
- /* use meaningful ids. That is A.15,3 isn't very readable */
for ( i=info->glyph_cnt-1; i>=0 ; --i )
if ( info->chars[i]!=NULL && info->chars[i]->name==NULL )
break;
@@ -5532,10 +5388,6 @@ return( 0 );
} else if ( info->glyphlocations_start!=0 && info->glyph_start!=0 ) {
info->to_order2 = (!loaded_fonts_same_as_new ||
(loaded_fonts_same_as_new && new_fonts_are_order2));
- /* If it's an apple mm font, then we don't want to change the order */
- /* This messes up the point count */
- if ( info->gvar_start!=0 && info->fvar_start!=0 )
- info->to_order2 = true;
readttfglyphs(ttf,info);
} else if ( info->cff_start!=0 ) {
info->to_order2 = (loaded_fonts_same_as_new && new_fonts_are_order2);
@@ -5581,16 +5433,8 @@ return( 0 );
readttfpostnames(ttf,info); /* If no postscript table we'll guess at names */
if ( info->gdef_start!=0 ) /* ligature caret positioning info */
readttfgdef(ttf,info);
- else {
- if ( info->prop_start!=0 )
- readttfprop(ttf,info);
- if ( info->lcar_start!=0 )
- readttflcar(ttf,info);
- }
if ( info->base_start!=0 )
readttfbase(ttf,info);
- else if ( info->bsln_start!=0 )
- readttfbsln(ttf,info);
if ( info->gasp_start!=0 )
readttfgasp(ttf,info);
/* read the cvt table before reading variation data */
@@ -5605,21 +5449,14 @@ return( 0 );
}
for ( i=0; i<info->savecnt; ++i ) if ( info->savetab[i].offset!=0 )
TtfCopyTableBlindly(info,ttf,info->savetab[i].offset,info->savetab[i].len,info->savetab[i].tag);
- /* Do this before reading kerning info */
- if ( info->to_order2 && info->gvar_start!=0 && info->fvar_start!=0 )
- readttfvariations(info,ttf);
if ( info->gpos_start!=0 ) /* kerning info may live in the gpos table too */
readttfgpossub(ttf,info,true);
/* Load the 'kern' table if the GPOS table either didn't exist or didn't */
/* contain any kerning info */
if ( info->kern_start!=0 && !LookupListHasFeature(info->gpos_lookups,CHR('k','e','r','n')))
readttfkerns(ttf,info);
- if ( info->opbd_start!=0 && !LookupListHasFeature(info->gpos_lookups,CHR('l','f','b','d')))
- readttfopbd(ttf,info);
if ( info->gsub_start!=0 )
readttfgpossub(ttf,info,false);
- if ( info->morx_start!=0 || info->mort_start!=0 )
- readttfmort(ttf,info);
if ( info->pfed_start!=0 )
pfed_read(ttf,info);
@@ -5656,17 +5493,6 @@ static void SymbolFixup(struct ttfinfo *info) {
map->enccount = max;
}
-void AltUniFigure(SplineFont *sf,EncMap *map) {
- int i,gid;
-
- if ( map->enc!=&custom ) {
- for ( i=0; i<map->enccount; ++i ) if ( (gid = map->map[i])!=-1 ) {
- int uni = UniFromEnc(i,map->enc);
- AltUniAdd(sf->glyphs[gid],uni);
- }
- }
-}
-
static void NameConsistancyCheck(SplineFont *sf,EncMap *map) {
/* Many fonts seem to have glyph names which mean something other than */
/* what the encoding says of the glyph */
@@ -5775,146 +5601,9 @@ static void UseGivenEncoding(SplineFont *sf,struct ttfinfo *info) {
}
sf->map = info->map;
sf->uni_interp = info->uni_interp;
- AltUniFigure(sf,sf->map);
NameConsistancyCheck(sf, sf->map);
}
-static char *AxisNameConvert(uint32 tag) {
- char buffer[8];
-
- if ( tag==CHR('w','g','h','t'))
-return( copy("Weight"));
- if ( tag==CHR('w','d','t','h'))
-return( copy("Width"));
- if ( tag==CHR('o','p','s','z'))
-return( copy("OpticalSize"));
- if ( tag==CHR('s','l','n','t'))
-return( copy("Slant"));
-
- buffer[0] = tag>>24;
- buffer[1] = tag>>16;
- buffer[2] = tag>>8;
- buffer[3] = tag&0xff;
- buffer[4] = 0;
-return( copy(buffer ));
-}
-
-static struct macname *FindMacName(struct ttfinfo *info, int strid) {
- struct macidname *sid;
-
- for ( sid=info->macstrids; sid!=NULL; sid=sid->next ) {
- if ( sid->id == strid )
-return( sid->head );
- }
-return( NULL );
-}
-
-static SplineFont *SFFromTuple(SplineFont *basesf,struct variations *v,int tuple,
- MMSet *mm, struct ttfinfo *info) {
- SplineFont *sf;
- int i;
- RefChar *r;
- (void)info; /* for -Wall */
- sf = SplineFontEmpty();
- sf->display_size = basesf->display_size;
- sf->display_antialias = basesf->display_antialias;
-
- sf->fontname = MMMakeMasterFontname(mm,tuple,&sf->fullname);
- sf->familyname = copy(basesf->familyname);
- sf->weight = copy("All");
- sf->italicangle = basesf->italicangle;
- sf->strokewidth = basesf->strokewidth;
- sf->strokedfont = basesf->strokedfont;
- sf->upos = basesf->upos;
- sf->uwidth = basesf->uwidth;
- sf->ascent = basesf->ascent;
- sf->hasvmetrics = basesf->hasvmetrics;
- sf->descent = basesf->descent;
- sf->kerns = v->tuples[tuple].khead;
- sf->vkerns = v->tuples[tuple].vkhead;
- sf->map = basesf->map;
- sf->mm = mm;
- sf->glyphmax = sf->glyphcnt = basesf->glyphcnt;
- sf->glyphs = v->tuples[tuple].chars;
- sf->layers[ly_fore].order2 = sf->layers[ly_back].order2 = true;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( basesf->glyphs[i]!=NULL ) {
- SplineChar *sc = sf->glyphs[i];
- sc->orig_pos = i;
- sc->parent = sf;
- sc->layers[ly_fore].order2 = sc->layers[ly_back].order2 = true;
- }
- sf->grid.order2 = true;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- for ( r=sf->glyphs[i]->layers[ly_fore].refs; r!=NULL; r=r->next )
- SCReinstanciateRefChar(sf->glyphs[i],r,ly_fore);
- }
-
- sf->ttf_tables = v->tuples[tuple].cvt;
-
- v->tuples[tuple].chars = NULL;
- v->tuples[tuple].khead = NULL;
- v->tuples[tuple].vkhead = NULL;
- v->tuples[tuple].cvt = NULL;
-return( sf );
-}
-
-static void MMFillFromVAR(SplineFont *sf, struct ttfinfo *info) {
- MMSet *mm = chunkalloc(sizeof(MMSet));
- struct variations *v = info->variations;
- int i,j;
-
- sf->mm = mm;
- mm->normal = sf;
- mm->apple = true;
- mm->axis_count = v->axis_count;
- mm->instance_count = v->tuple_count;
- mm->instances = galloc(v->tuple_count*sizeof(SplineFont *));
- mm->positions = galloc(v->tuple_count*v->axis_count*sizeof(real));
- for ( i=0; i<v->tuple_count; ++i ) for ( j=0; j<v->axis_count; ++j )
- mm->positions[i*v->axis_count+j] = v->tuples[i].coords[j];
- mm->defweights = gcalloc(v->tuple_count,sizeof(real)); /* Doesn't apply */
- mm->axismaps = gcalloc(v->axis_count,sizeof(struct axismap));
- for ( i=0; i<v->axis_count; ++i ) {
- mm->axes[i] = AxisNameConvert(v->axes[i].tag);
- mm->axismaps[i].min = v->axes[i].min;
- mm->axismaps[i].def = v->axes[i].def;
- mm->axismaps[i].max = v->axes[i].max;
- if ( v->axes[i].paircount==0 ) {
- mm->axismaps[i].points = 3;
- mm->axismaps[i].blends = galloc(3*sizeof(real));
- mm->axismaps[i].designs = galloc(3*sizeof(real));
- mm->axismaps[i].blends[0] = -1; mm->axismaps[i].designs[0] = mm->axismaps[i].min;
- mm->axismaps[i].blends[1] = 0; mm->axismaps[i].designs[1] = mm->axismaps[i].def;
- mm->axismaps[i].blends[2] = 1; mm->axismaps[i].designs[2] = mm->axismaps[i].max;
- } else {
- mm->axismaps[i].points = v->axes[i].paircount;
- mm->axismaps[i].blends = galloc(v->axes[i].paircount*sizeof(real));
- mm->axismaps[i].designs = galloc(v->axes[i].paircount*sizeof(real));
- for ( j=0; j<v->axes[i].paircount; ++j ) {
- if ( v->axes[i].mapfrom[j]<=0 ) {
- mm->axismaps[i].designs[j] = mm->axismaps[i].def +
- v->axes[i].mapfrom[j]*(mm->axismaps[i].def-mm->axismaps[i].min);
- } else {
- mm->axismaps[i].designs[j] = mm->axismaps[i].def +
- v->axes[i].mapfrom[j]*(mm->axismaps[i].max-mm->axismaps[i].def);
- }
- mm->axismaps[i].blends[j] = v->axes[i].mapto[j];
- }
- }
- mm->axismaps[i].axisnames = MacNameCopy(FindMacName(info, v->axes[i].nameid));
- }
- mm->named_instance_count = v->instance_count;
- mm->named_instances = galloc(v->instance_count*sizeof(struct named_instance));
- for ( i=0; i<v->instance_count; ++i ) {
- mm->named_instances[i].coords = v->instances[i].coords;
- v->instances[i].coords = NULL;
- mm->named_instances[i].names = MacNameCopy(FindMacName(info, v->instances[i].nameid));
- }
- for ( i=0; i<mm->instance_count; ++i )
- mm->instances[i] = SFFromTuple(sf,v,i,mm,info);
- VariationFree(info);
-}
-
static void SFRelativeWinAsDs(SplineFont *sf) {
if ( !sf->pfminfo.winascent_add || !sf->pfminfo.windescent_add ||
!sf->pfminfo.hheadascent_add || !sf->pfminfo.hheaddescent_add ) {
@@ -6116,8 +5805,6 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
sf->kerns = info->khead;
sf->vkerns = info->vkhead;
sf->possub = info->possub;
- sf->sm = info->sm;
- sf->features = info->features;
sf->gpos_lookups = info->gpos_lookups;
sf->gsub_lookups = info->gsub_lookups;
@@ -6196,9 +5883,6 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
otl->features = FLOrder(otl->features);
}
- if ( info->variations!=NULL )
- MMFillFromVAR(sf,info);
-
if ( info->cff_length!=0 && !sf->layers[ly_fore].order2 ) {
/* Clean up the hint masks, We create an initial hintmask whether we */
/* need it or not */
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfatt.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfatt.c
index b6c45fe956f..97974e3baf5 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfatt.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfatt.c
@@ -31,7 +31,6 @@
#include <math.h>
#include <locale.h>
#include <stdlib.h>
-#include <ggadget.h> /* For GTextInfo */
#include "ttf.h"
static uint16 *getAppleClassTable(FILE *ttf, int classdef_offset, int cnt, int sub, int div, struct ttfinfo *info) {
@@ -1770,6 +1769,7 @@ static struct { uint32 tag; char *str; } tagstr[] = {
{ 0, NULL }
};
+
static void gsubSimpleSubTable(FILE *ttf, int stoffset, struct ttfinfo *info,
struct lookup *l, struct lookup_subtable *subtable, int justinuse) {
int coverage, cnt, i, j, which;
@@ -2928,113 +2928,6 @@ return;
info->g_bounds = 0;
}
-static void readttf_applelookup(FILE *ttf,struct ttfinfo *info,
- void (*apply_values)(struct ttfinfo *info, int gfirst, int glast,FILE *ttf),
- void (*apply_value)(struct ttfinfo *info, int gfirst, int glast,FILE *ttf),
- void (*apply_default)(struct ttfinfo *info, int gfirst, int glast,void *def),
- void *def, int allow_out_of_bounds) {
- int format, i, first, last, data_off, cnt, prev;
- uint32 here;
- uint32 base = ftell(ttf);
-
- format = getushort(ttf);
- switch ( format ) {
- case 0: /* Simple array */
- apply_values(info,0,info->glyph_cnt-1,ttf);
- break;
- case 2: /* Segment Single */
- /* Entry size */ getushort(ttf);
- cnt = getushort(ttf);
- /* search range */ getushort(ttf);
- /* log2(cnt) */ getushort(ttf);
- /* range shift */ getushort(ttf);
- prev = 0;
- for ( i=0; i<cnt; ++i ) {
- last = getushort(ttf);
- first = getushort(ttf);
- if ( last<first || last>=0xffff ||
- (!allow_out_of_bounds && last>=info->glyph_cnt )) {
- LogError( _("Bad lookup table: format=2 (%d/%d), first=%d last=%d total glyphs in font=%d\n"),
- i,cnt,first,last,info->glyph_cnt );
- info->bad_gx = true;
- } else {
- if ( apply_default!=NULL )
- apply_default(info,prev,first-1,def);
- apply_value(info,first,last,ttf);
- prev = last+1;
- }
- }
- break;
- case 4: /* Segment multiple */
- /* Entry size */ getushort(ttf);
- cnt = getushort(ttf);
- /* search range */ getushort(ttf);
- /* log2(cnt) */ getushort(ttf);
- /* range shift */ getushort(ttf);
- prev = 0;
- for ( i=0; i<cnt; ++i ) {
- last = getushort(ttf);
- first = getushort(ttf);
- data_off = getushort(ttf);
- if ( last<first || last>=0xffff ||
- (!allow_out_of_bounds && last>=info->glyph_cnt )) {
- LogError( _("Bad lookup table: format=4 (%d/%d), first=%d last=%d total glyphs in font=%d\n"),
- i,cnt,first,last,info->glyph_cnt );
- info->bad_gx = true;
- } else {
- here = ftell(ttf);
- if ( apply_default!=NULL )
- apply_default(info,prev,first-1,def);
- fseek(ttf,base+data_off,SEEK_SET);
- apply_values(info,first,last,ttf);
- fseek(ttf,here,SEEK_SET);
- prev = last+1;
- }
- }
- break;
- case 6: /* Single table */
- /* Entry size */ getushort(ttf);
- cnt = getushort(ttf);
- /* search range */ getushort(ttf);
- /* log2(cnt) */ getushort(ttf);
- /* range shift */ getushort(ttf);
- prev = 0;
- for ( i=0; i<cnt; ++i ) {
- first = getushort(ttf);
- if ( first>=0xffff || (!allow_out_of_bounds && first>=info->glyph_cnt )) {
- LogError( _("Bad lookup table: format=6, first=%d total glyphs in font=%d\n"),
- first,info->glyph_cnt );
- info->bad_gx = true;
- } else {
- if ( apply_default!=NULL )
- apply_default(info,prev,first-1,def);
- apply_value(info,first,first,ttf);
- prev = first+1;
- }
- }
- break;
- case 8: /* Simple array */
- first = getushort(ttf);
- cnt = getushort(ttf);
- if ( first+cnt>=0xffff || (!allow_out_of_bounds && first+cnt>=info->glyph_cnt )) {
- LogError( _("Bad lookup table: format=8, first=%d cnt=%d total glyphs in font=%d\n"),
- first,cnt,info->glyph_cnt );
- info->bad_gx = true;
- } else {
- if ( apply_default!=NULL ) {
- apply_default(info,0,first-1,def);
- apply_default(info,first+cnt,info->glyph_cnt-1,def);
- }
- apply_values(info,first,first+cnt-1,ttf);
- }
- break;
- default:
- LogError( _("Invalid lookup table format. %d\n"), format );
- info->bad_gx = true;
- break;
- }
-}
-
static void OTLAppend(struct ttfinfo *info,OTLookup *otl,int gpos) {
OTLookup *prev;
int pos=0;
@@ -3069,1544 +2962,13 @@ static void OTLRemove(struct ttfinfo *info,OTLookup *otl,int gpos) {
OTLookupFree(otl);
}
-static OTLookup *NewMacLookup(struct ttfinfo *info,int gpos) {
- OTLookup *otl;
-
- otl = chunkalloc(sizeof(OTLookup));
- otl->lookup_type = gpos ? kern_statemachine : morx_context;
- otl->subtables = chunkalloc(sizeof(struct lookup_subtable));
- otl->subtables->lookup = otl;
- otl->features = chunkalloc(sizeof(FeatureScriptLangList));
- if ( gpos )
- otl->features->featuretag = CHR('k','e','r','n');
- else {
- otl->features->featuretag = (info->mort_feat<<16) | (info->mort_setting);
- otl->features->ismac = true;
- }
- OTLAppend(info,otl,gpos);
-return( otl );
-}
-
-static OTLookup *NewMacSubsLookup(struct ttfinfo *info,OTLookup *parent,
- int nest_index, OTLookup **subs) {
- OTLookup *otl;
- char *name, *format;
-
- if ( subs[nest_index]!=NULL )
-return( subs[nest_index] );
-
- /* These are nested lookups, only to be activated by a state machine */
- /* as such they have no feature tags nor scripts of their own. */
- otl = chunkalloc(sizeof(OTLookup));
- otl->lookup_type = gsub_single;
- otl->subtables = chunkalloc(sizeof(struct lookup_subtable));
- otl->subtables->lookup = otl;
-/* GT: This is to give the name to a nested substitution lookup invoked by */
-/* GT: a statemachine. The %s is the name of the statemachine('s lookup) */
-/* GT: and the %d is n, where this lookup is the n'th defined for this state */
-/* GT: machine */
-#ifdef LUA_FF_LIB
- format = _("%s_ns_%d");
-#else
- format = _("%s nested-substitutions %d");
-#endif
- name = galloc(strlen(parent->lookup_name)+strlen(format)+10);
- sprintf( name, format, parent->lookup_name, nest_index );
- otl->lookup_name = name;
-#ifdef LUA_FF_LIB
- otl->subtables->subtable_name = strconcat(name,"_s");
-#else
- otl->subtables->subtable_name = strconcat3(name," ",_("subtable"));
-#endif
- OTLAppend(info,otl,false);
- subs[nest_index] = otl;
-return( otl );
-}
-
static void InfoNameOTLookup(OTLookup *otl,struct ttfinfo *info) {
SplineFont sf;
memset(&sf,0,sizeof(sf));
- sf.features = info->features;
NameOTLookup(otl,&sf);
}
-static void TTF_SetProp(struct ttfinfo *info,int gnum, int prop) {
- int offset;
- PST *pst;
-
- if ( gnum<0 || gnum>=info->glyph_cnt ) {
- LogError( _("Glyph out of bounds in 'prop' table %d\n"), gnum );
- info->bad_gx = true;
-return;
- }
-
- if ( prop&0x1000 ) { /* Mirror */
- offset = (prop<<20)>>28;
- if ( gnum+offset>=0 && gnum+offset<info->glyph_cnt &&
- info->chars[gnum+offset]->name!=NULL ) {
- pst = chunkalloc(sizeof(PST));
- pst->type = pst_substitution;
- pst->subtable = info->mort_subs_lookup->subtables;
- FListAppendScriptLang(info->mort_subs_lookup->features,SCScriptFromUnicode(info->chars[gnum]),
- DEFAULT_LANG);
- pst->next = info->chars[gnum]->possub;
- info->chars[gnum]->possub = pst;
- pst->u.subs.variant = copy(info->chars[gnum+offset]->name);
- }
- }
-}
-
-static void prop_apply_values(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- int i;
-
- for ( i=gfirst; i<=glast; ++i )
- TTF_SetProp(info,i, getushort(ttf));
-}
-
-static void prop_apply_value(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- int i;
- int prop;
-
- prop = getushort(ttf);
- for ( i=gfirst; i<=glast; ++i )
- TTF_SetProp(info,i, prop);
-}
-
-static void prop_apply_default(struct ttfinfo *info, int gfirst, int glast,void *def) {
- int def_prop, i;
-
- def_prop = (intpt) def;
- for ( i=gfirst; i<=glast; ++i )
- TTF_SetProp(info,i, def_prop);
-}
-
-void readttfprop(FILE *ttf,struct ttfinfo *info) {
- int def;
-
- fseek(ttf,info->prop_start,SEEK_SET);
- /* The one example that I've got has a wierd version, so I don't check it */
- /* the three versions that I know about are all pretty much the same, just a few extra flags */
- /* version = */ getlong(ttf);
- /* format = */ getushort(ttf);
- def = getushort(ttf);
- info->mort_subs_lookup = NewMacLookup(info,false);
- info->mort_subs_lookup->lookup_type = gsub_single;
- info->mort_subs_lookup->features->featuretag = CHR('r','t','l','a');
- info->mort_subs_lookup->features->ismac = false;
- info->mort_subs_lookup->subtables->per_glyph_pst_or_kern = true;
- readttf_applelookup(ttf,info,
- prop_apply_values,prop_apply_value,
- prop_apply_default,(void *) (intpt) def, false);
- InfoNameOTLookup(info->mort_subs_lookup,info);
-}
-
-static void TTF_SetLcaret(struct ttfinfo *info, int gnum, int offset, FILE *ttf) {
- uint32 here = ftell(ttf);
- PST *pst;
- SplineChar *sc;
- int cnt, i;
-
- if ( gnum<0 || gnum>=info->glyph_cnt ) {
- LogError( _("Glyph out of bounds in 'lcar' table %d\n"), gnum );
- info->bad_gx = true;
-return;
- } else if ( (sc=info->chars[gnum])==NULL )
-return;
-
- fseek(ttf,info->lcar_start+offset,SEEK_SET);
- cnt = getushort(ttf);
- pst = chunkalloc(sizeof(PST));
- pst->type = pst_lcaret;
- pst->subtable = NULL;
- pst->next = sc->possub;
- sc->possub = pst;
- sc->lig_caret_cnt_fixed = true;
- pst->u.lcaret.cnt = cnt;
- pst->u.lcaret.carets = galloc(cnt*sizeof(uint16));
- for ( i=0; i<cnt; ++i )
- pst->u.lcaret.carets[i] = getushort(ttf);
- fseek(ttf,here,SEEK_SET);
-}
-
-static void lcar_apply_values(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- int i;
-
- for ( i=gfirst; i<=glast; ++i )
- TTF_SetLcaret(info,i, getushort(ttf), ttf);
-}
-
-static void lcar_apply_value(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- int i;
- int offset;
-
- offset = getushort(ttf);
- for ( i=gfirst; i<=glast; ++i )
- TTF_SetLcaret(info,i, offset, ttf);
-}
-
-void readttflcar(FILE *ttf,struct ttfinfo *info) {
-
- fseek(ttf,info->lcar_start,SEEK_SET);
- /* version = */ getlong(ttf);
- if ( getushort(ttf)!=0 ) /* A format type of 1 has the caret locations */
-return; /* indicated by points */
- readttf_applelookup(ttf,info,
- lcar_apply_values,lcar_apply_value,NULL,NULL,false);
-}
-
-static void TTF_SetOpticalBounds(struct ttfinfo *info, int gnum, int left, int right) {
- PST *pst;
- SplineChar *sc;
-
- if ( left==0 && right==0 )
-return;
-
- if ( gnum<0 || gnum>=info->glyph_cnt ) {
- LogError( _("Glyph out of bounds in 'opbd' table %d\n"), gnum );
- info->bad_gx = true;
-return;
- } else if ( (sc=info->chars[gnum])==NULL )
-return;
-
- if ( left!=0 ) {
- pst = chunkalloc(sizeof(PST));
- pst->type = pst_position;
- pst->subtable = info->mort_subs_lookup->subtables;
- FListAppendScriptLang(info->mort_subs_lookup->features,SCScriptFromUnicode(sc),
- DEFAULT_LANG);
- pst->next = sc->possub;
- sc->possub = pst;
- pst->u.pos.xoff = left;
- pst->u.pos.h_adv_off = left;
- }
- if ( right!=0 ) {
- pst = chunkalloc(sizeof(PST));
- pst->type = pst_position;
- pst->subtable = info->mort_pos_lookup2->subtables;
- FListAppendScriptLang(info->mort_pos_lookup2->features,SCScriptFromUnicode(sc),
- DEFAULT_LANG);
- pst->next = sc->possub;
- sc->possub = pst;
- pst->u.pos.h_adv_off = -right;
- }
-}
-
-static void opbd_apply_values(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- int i, left, right, offset;
- uint32 here;
-
- for ( i=gfirst; i<=glast; ++i ) {
- offset = getushort(ttf);
- here = ftell(ttf);
- fseek(ttf,info->opbd_start+6/*opbd header*/+offset,SEEK_SET);
- left = (int16) getushort(ttf);
- /* top = (int16) */ getushort(ttf);
- right = (int16) getushort(ttf);
- /* bottom = (int16) */ getushort(ttf);
- fseek(ttf,here,SEEK_SET);
- TTF_SetOpticalBounds(info,i, left, right);
- }
-}
-
-static void opbd_apply_value(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- int i, left, right, offset;
- uint32 here;
-
- offset = getushort(ttf);
- here = ftell(ttf);
- fseek(ttf,info->opbd_start+offset,SEEK_SET);
- left = (int16) getushort(ttf);
- /* top = (int16) */ getushort(ttf);
- right = (int16) getushort(ttf);
- /* bottom = (int16) */ getushort(ttf);
- fseek(ttf,here,SEEK_SET);
-
- for ( i=gfirst; i<=glast; ++i )
- TTF_SetOpticalBounds(info,i, left, right);
-}
-
-void readttfopbd(FILE *ttf,struct ttfinfo *info) {
-
- fseek(ttf,info->opbd_start,SEEK_SET);
- /* version = */ getlong(ttf);
- if ( getushort(ttf)!=0 ) /* A format type of 1 has the bounds */
-return; /* indicated by points */
- info->mort_subs_lookup = NewMacLookup(info,true);
- info->mort_subs_lookup->lookup_type = gpos_single;
- info->mort_subs_lookup->features->featuretag = CHR('l','f','b','d');
- info->mort_subs_lookup->features->ismac = false;
- info->mort_subs_lookup->subtables->per_glyph_pst_or_kern = true;
-
- info->mort_pos_lookup2 = NewMacLookup(info,true);
- info->mort_pos_lookup2->lookup_type = gpos_single;
- info->mort_pos_lookup2->features->featuretag = CHR('r','t','b','d');
- info->mort_pos_lookup2->features->ismac = false;
- info->mort_pos_lookup2->subtables->per_glyph_pst_or_kern = true;
-
- readttf_applelookup(ttf,info,
- opbd_apply_values,opbd_apply_value,NULL,NULL,false);
- InfoNameOTLookup(info->mort_subs_lookup,info);
- InfoNameOTLookup(info->mort_pos_lookup2,info);
-}
-
-/* Interesting. The mac allows the creation of temporary gids beyond the */
-/* range specified by the font, as long as the user never sees them. So */
-/* it seems perfectly legal for one substitution to use a gid of 1111 */
-/* if that gid never reaches output but will be converted into a real gid */
-/* by a subsequent substitution. I saw this used in a conditional situation */
-/* to provide a temporary context for a later match. */
-static SplineChar *CreateBadGid(struct ttfinfo *info,int badgid) {
- int i;
- SplineChar *fake;
- char name[60];
-
- if ( badgid<0 || badgid>=0xffff ) /* <0 should never happen, 0xffff is the special "deleted" glyph, >0xffff should never happen */
-return( NULL );
-
- for ( i=0; i<info->badgid_cnt; ++i )
- if ( info->badgids[i]->orig_pos == badgid )
-return( info->badgids[i] );
-
- if ( info->badgid_cnt>=info->badgid_max )
- info->badgids = grealloc(info->badgids,(info->badgid_max += 20)*sizeof(SplineChar *));
- fake = SplineCharCreate(2);
- fake->orig_pos = badgid;
- sprintf( name, "Out-Of-Range-GID-%d", badgid );
- fake->name = copy(name);
- fake->widthset = true; /* So it doesn't just vanish on us */
- fake->width = fake->vwidth = info->emsize;
- info->badgids[info->badgid_cnt++] = fake;
-return( fake );
-}
-
-static void TTF_SetMortSubs(struct ttfinfo *info, int gnum, int gsubs) {
- PST *pst;
- SplineChar *sc, *ssc;
-
- if ( gsubs==0 )
-return;
-
- if ( gnum<0 || gnum>=info->glyph_cnt ) {
- if ( !info->warned_morx_out_of_bounds_glyph ) {
- LogError( _("Glyph out of bounds in 'mort'/'morx' table %d\n"), gnum );
- info->bad_gx = true;
- info->warned_morx_out_of_bounds_glyph = true;
- }
- sc = CreateBadGid(info,gnum);
- } else
- sc = info->chars[gnum];
- ssc = NULL;
- if ( gsubs<0 || (gsubs>=info->glyph_cnt && gsubs!=0xffff)) {
- if ( !info->warned_morx_out_of_bounds_glyph ) {
- LogError( _("Substitute glyph out of bounds in 'mort'/'morx' table %d\n"), gsubs );
- info->bad_gx = true;
- info->warned_morx_out_of_bounds_glyph = true;
- }
- ssc = CreateBadGid(info,gsubs);
- } else if ( gsubs!=0xffff )
- ssc=info->chars[gsubs];
- if ( sc==NULL || (gsubs!=0xffff && ssc==NULL) )
-return;
-
- pst = chunkalloc(sizeof(PST));
- pst->type = pst_substitution;
- pst->subtable = info->mort_subs_lookup->subtables;
- if ( info->mort_subs_lookup->features!=NULL )
- FListsAppendScriptLang(info->mort_subs_lookup->features,SCScriptFromUnicode(sc),
- DEFAULT_LANG);
- pst->next = sc->possub;
- sc->possub = pst;
- pst->u.subs.variant = gsubs!=0xffff ? copy(ssc->name) : copy(MAC_DELETED_GLYPH_NAME);
-}
-
-static void mort_apply_values(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- uint16 gnum;
- int i;
-
- for ( i=gfirst; i<=glast; ++i ) {
- gnum = getushort(ttf);
- TTF_SetMortSubs(info,i, gnum);
- }
-}
-
-static void mort_apply_value(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- uint16 gnum;
- int i;
-
- gnum = getushort(ttf);
-
- for ( i=gfirst; i<=glast; ++i )
- TTF_SetMortSubs(info,i, gnum );
-}
-
-static void mortclass_apply_values(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- int i;
-
- for ( i=gfirst; i<=glast; ++i )
- info->morx_classes[i] = getushort(ttf);
-}
-
-static void mortclass_apply_value(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- uint16 class;
- int i;
-
- class = getushort(ttf);
-
- for ( i=gfirst; i<=glast; ++i )
- info->morx_classes[i] = class;
-}
-
-int32 memlong(uint8 *data,int len, int offset) {
- if ( offset>=0 && offset+3<len ) {
- int ch1 = data[offset], ch2 = data[offset+1], ch3 = data[offset+2], ch4 = data[offset+3];
-return( (ch1<<24)|(ch2<<16)|(ch3<<8)|ch4 );
- } else {
- LogError( _("Bad font, offset out of bounds.\n") );
-return( 0 );
- }
-}
-
-int memushort(uint8 *data,int len, int offset) {
- if ( offset>=0 && offset+1<len ) {
- int ch1 = data[offset], ch2 = data[offset+1];
-return( (ch1<<8)|ch2 );
- } else {
- LogError( _("Bad font, offset out of bounds.\n") );
-return( 0 );
- }
-}
-
-void memputshort(uint8 *data,int offset,uint16 val) {
- data[offset] = (val>>8);
- data[offset+1] = val&0xff;
-}
-
-#define MAX_LIG_COMP 16
-struct statemachine {
- uint8 *data;
- int length;
- uint32 nClasses;
- uint32 classOffset, stateOffset, entryOffset, ligActOff, compOff, ligOff;
- uint16 *classes;
- uint16 lig_comp_classes[MAX_LIG_COMP];
- uint16 lig_comp_glyphs[MAX_LIG_COMP];
- int lcp;
- uint8 *states_in_use;
- int smax;
- struct ttfinfo *info;
- int cnt;
-};
-
-static void mort_figure_ligatures(struct statemachine *sm, int lcp, int off, int32 lig_offset,
- struct ttfinfo *info) {
- uint32 lig;
- int i, j, lig_glyph;
- PST *pst;
- int len;
-
- if ( lcp<0 || off+3>sm->length )
-return;
-
- lig = memlong(sm->data,sm->length, off);
- off += sizeof(int32);
-
- for ( i=0; i<sm->info->glyph_cnt; ++i ) if ( sm->classes[i]==sm->lig_comp_classes[lcp] ) {
- sm->lig_comp_glyphs[lcp] = i;
- lig_offset += memushort(sm->data,sm->length,2*( ((((int32) lig)<<2)>>2) + i ) );
- if ( lig&0xc0000000 ) {
- if ( lig_offset+1 > sm->length ) {
- LogError( _("Invalid ligature offset\n") );
- info->bad_gx = true;
- break;
- }
- lig_glyph = memushort(sm->data,sm->length,lig_offset);
- if ( lig_glyph>=sm->info->glyph_cnt ) {
- LogError( _("Attempt to make a ligature for glyph %d out of "),
- lig_glyph );
- for ( j=lcp; j<sm->lcp; ++j )
- LogError("%d ",sm->lig_comp_glyphs[j]);
- LogError("\n");
- info->bad_gx = true;
- } else {
- char *comp;
- for ( len=0, j=lcp; j<sm->lcp; ++j )
- if ( sm->lig_comp_glyphs[j]<sm->info->glyph_cnt &&
- sm->info->chars[sm->lig_comp_glyphs[j]]!=NULL )
- len += strlen(sm->info->chars[sm->lig_comp_glyphs[j]]->name)+1;
- comp = galloc(len+1);
- *comp = '\0';
- for ( j=lcp; j<sm->lcp; ++j ) {
- if ( sm->lig_comp_glyphs[j]<sm->info->glyph_cnt &&
- sm->info->chars[sm->lig_comp_glyphs[j]]!=NULL ) {
- if ( *comp!='\0' )
- strcat(comp," ");
- strcat(comp,sm->info->chars[sm->lig_comp_glyphs[j]]->name);
- }
- }
- if ( lig_glyph<sm->info->glyph_cnt && sm->info->chars[lig_glyph]!=NULL ) {
- for ( pst=sm->info->chars[lig_glyph]->possub; pst!=NULL; pst=pst->next )
- if ( pst->type==pst_ligature && pst->subtable==sm->info->mort_subs_lookup->subtables &&
- strcmp(comp,pst->u.lig.components)==0 )
- break;
- /* There are cases where there will be multiple entries for */
- /* the same lig. ie. if we have "ff" and "ffl" then there */
- /* will be multiple entries for "ff" */
- if ( pst == NULL ) {
- pst = chunkalloc(sizeof(PST));
- pst->type = pst_ligature;
- pst->subtable = sm->info->mort_subs_lookup->subtables;
- if ( sm->info->mort_subs_lookup->features!=NULL )
- FListsAppendScriptLang(sm->info->mort_subs_lookup->features,
- SCScriptFromUnicode(sm->info->chars[lig_glyph]),
- DEFAULT_LANG);
- pst->u.lig.components = comp;
- pst->u.lig.lig = sm->info->chars[lig_glyph];
- pst->next = sm->info->chars[lig_glyph]->possub;
- sm->info->chars[lig_glyph]->possub = pst;
- } else
- free(comp);
- } else {
- LogError( _("Bad font: Ligature glyph %d is missing\n"), lig_glyph );
- info->bad_gx = true;
- }
- }
- } else
- mort_figure_ligatures(sm,lcp-1,off,lig_offset,info);
- lig_offset -= memushort(sm->data,sm->length,2*( ((((int32) lig)<<2)>>2) + i ) );
- }
-}
-
-static void follow_mort_state(struct statemachine *sm,int offset,int class,
- struct ttfinfo *info) {
- int state = (offset-sm->stateOffset)/sm->nClasses;
- int class_top, class_bottom;
-
- if ( state<0 || state>=sm->smax || sm->states_in_use[state] || sm->lcp>=MAX_LIG_COMP )
-return;
- ++ sm->cnt;
- if ( sm->cnt>=10000 ) {
- if ( sm->cnt==10000 )
-/* GT: This is a reference to "Much Ado About Nothing". The string should read */
-/* GT: "A ligature sub-table in Apple's 'mort'/'morx' table is too\ncomplex for me to understand. I shall give up on it.\nYour ligatures may not be complete." */
- LogError(_("In an attempt to process the ligatures of this font, I've concluded\nthat the state machine in Apple's mort/morx table is\n(like the learned constable) too cunning to be understood.\nI shall give up on it. Your ligatures may be incomplete.\n") );
- info->bad_gx = true;
-return;
- }
- sm->states_in_use[state] = true;
-
- if ( class==-1 ) { class_bottom = 0; class_top = sm->nClasses; }
- else { class_bottom = class; class_top = class+1; }
- for ( class=class_bottom; class<class_top; ++class ) {
- int ent = sm->data[offset+class];
- int newState = memushort(sm->data,sm->length,sm->entryOffset+4*ent);
- int flags = memushort(sm->data,sm->length,sm->entryOffset+4*ent+2);
- /* If we have the same entry as state 0, then presumably we are */
- /* ignoring the components read so far and starting over with a new */
- /* lig (similarly for state 1) */
- if (( state!=0 && sm->data[sm->stateOffset+class] == ent ) ||
- (state>1 && sm->data[sm->stateOffset+sm->nClasses+class]==ent ))
- continue;
- if ( flags&0x8000 ) /* Set component */
- sm->lig_comp_classes[sm->lcp++] = class;
- if ( flags&0x3fff ) {
- mort_figure_ligatures(sm, sm->lcp-1, flags & 0x3fff, 0,info);
- } else if ( flags&0x8000 )
- follow_mort_state(sm,newState,(flags&0x4000)?class:-1,info);
- if ( flags&0x8000 )
- --sm->lcp;
- }
- sm->states_in_use[state] = false;
-}
-
-static void morx_figure_ligatures(struct statemachine *sm, int lcp, int ligindex, int32 lig_offset,
- struct ttfinfo *info) {
- uint32 lig;
- int i, j, lig_glyph;
- PST *pst;
- int len;
-
- if ( lcp<0 || sm->ligActOff+4*ligindex+3>(unsigned)sm->length )
-return;
-
- lig = memlong(sm->data,sm->length, sm->ligActOff+4*ligindex);
- ++ligindex;
-
- for ( i=0; i<sm->info->glyph_cnt; ++i ) if ( sm->classes[i]==sm->lig_comp_classes[lcp] ) {
- sm->lig_comp_glyphs[lcp] = i;
- lig_offset += memushort(sm->data,sm->length,sm->compOff + 2*( ((((int32) lig)<<2)>>2) + i ) );
- if ( lig&0xc0000000 ) {
- if ( sm->ligOff+2*lig_offset+1 > (unsigned)sm->length ) {
- LogError( _("Invalid ligature offset\n") );
- info->bad_gx = true;
- break;
- }
- lig_glyph = memushort(sm->data,sm->length,sm->ligOff+2*lig_offset);
- if ( lig_glyph>=sm->info->glyph_cnt || sm->info->chars[lig_glyph]==NULL ) {
- LogError( _("Attempt to make a ligature for (non-existent) glyph %d out of "),
- lig_glyph );
- info->bad_gx = true;
- for ( j=lcp; j<sm->lcp; ++j )
- LogError("%d ",sm->lig_comp_glyphs[j]);
- LogError("\n");
- } else {
- char *comp;
- for ( len=0, j=lcp; j<sm->lcp; ++j )
- len += strlen(sm->info->chars[sm->lig_comp_glyphs[j]]->name)+1;
- comp = galloc(len);
- *comp = '\0';
- for ( j=lcp; j<sm->lcp; ++j ) {
- if ( *comp!='\0' )
- strcat(comp," ");
- strcat(comp,sm->info->chars[sm->lig_comp_glyphs[j]]->name);
- }
- for ( pst=sm->info->chars[lig_glyph]->possub; pst!=NULL; pst=pst->next )
- if ( pst->type==pst_ligature && pst->subtable==sm->info->mort_subs_lookup->subtables &&
- strcmp(comp,pst->u.lig.components)==0 )
- break;
- /* There are cases where there will be multiple entries for */
- /* the same lig. ie. if we have "ff" and "ffl" then there */
- /* will be multiple entries for "ff" */
- if ( pst == NULL ) {
- pst = chunkalloc(sizeof(PST));
- pst->type = pst_ligature;
- pst->subtable = sm->info->mort_subs_lookup->subtables;
- if ( sm->info->mort_subs_lookup->features!=NULL )
- FListsAppendScriptLang(sm->info->mort_subs_lookup->features,
- SCScriptFromUnicode(sm->info->chars[lig_glyph]),
- DEFAULT_LANG);
- pst->u.lig.components = comp;
- pst->u.lig.lig = sm->info->chars[lig_glyph];
- pst->next = sm->info->chars[lig_glyph]->possub;
- sm->info->chars[lig_glyph]->possub = pst;
- } else
- free(comp);
- }
- } else
- morx_figure_ligatures(sm,lcp-1,ligindex,lig_offset,info);
- lig_offset -= memushort(sm->data,sm->length,sm->compOff + 2*( ((((int32) lig)<<2)>>2) + i ) );
- }
-}
-
-static void follow_morx_state(struct statemachine *sm,int state,int class,
- struct ttfinfo *info) {
- int class_top, class_bottom;
-
- if ( state<0 || state>=sm->smax || sm->states_in_use[state] || sm->lcp>=MAX_LIG_COMP )
-return;
- ++ sm->cnt;
- if ( sm->cnt>=10000 ) {
- if ( sm->cnt==10000 )
- LogError(_("In an attempt to process the ligatures of this font, I've concluded\nthat the state machine in Apple's mort/morx table is\n(like the learned constable) too cunning to be understood.\nI shall give up on it. Your ligatures may be incomplete.\n") );
- info->bad_gx = true;
-return;
- }
- sm->states_in_use[state] = true;
-
- if ( class==-1 ) { class_bottom = 0; class_top = sm->nClasses; }
- else { class_bottom = class; class_top = class+1; }
- for ( class=class_bottom; class<class_top; ++class ) {
- int ent = memushort(sm->data, sm->length,sm->stateOffset + 2*(state*sm->nClasses+class) );
- int newState = memushort(sm->data,sm->length,sm->entryOffset+6*ent);
- int flags = memushort(sm->data,sm->length,sm->entryOffset+6*ent+2);
- int ligindex = memushort(sm->data,sm->length,sm->entryOffset+6*ent+4);
- /* If we have the same entry as state 0, then presumably we are */
- /* ignoring the components read so far and starting over with a new */
- /* lig (similarly for state 1) */
- if (( state!=0 && memushort(sm->data, sm->length,sm->stateOffset + 2*class) == ent ) ||
- (state>1 && memushort(sm->data,sm->length, sm->stateOffset + 2*(sm->nClasses+class))==ent ))
- continue;
- if ( flags&0x8000 ) /* Set component */
- sm->lig_comp_classes[sm->lcp++] = class;
- if ( flags&0x2000 ) {
- morx_figure_ligatures(sm, sm->lcp-1, ligindex, 0,info);
- } else if ( flags&0x8000 )
- follow_morx_state(sm,newState,(flags&0x4000)?class:-1,info);
- if ( flags&0x8000 )
- --sm->lcp;
- }
- sm->states_in_use[state] = false;
-}
-
-static void readttf_mortx_lig(FILE *ttf,struct ttfinfo *info,int ismorx,uint32 base,uint32 length) {
- uint32 here;
- struct statemachine sm;
- int first, cnt, i;
-
- memset(&sm,0,sizeof(sm));
- sm.info = info;
- here = ftell(ttf);
- length -= here-base;
- sm.data = galloc(length);
- sm.length = length;
- if ( fread(sm.data,1,length,ttf)!=length ) {
- free(sm.data);
- LogError( _("Bad mort ligature table. Not long enough\n"));
- info->bad_gx = true;
-return;
- }
- fseek(ttf,here,SEEK_SET);
- if ( ismorx ) {
- sm.nClasses = memlong(sm.data,sm.length, 0);
- sm.classOffset = memlong(sm.data,sm.length, sizeof(int32));
- sm.stateOffset = memlong(sm.data,sm.length, 2*sizeof(int32));
- sm.entryOffset = memlong(sm.data,sm.length, 3*sizeof(int32));
- sm.ligActOff = memlong(sm.data,sm.length, 4*sizeof(int32));
- sm.compOff = memlong(sm.data,sm.length, 5*sizeof(int32));
- sm.ligOff = memlong(sm.data,sm.length, 6*sizeof(int32));
- fseek(ttf,here+sm.classOffset,SEEK_SET);
- /* I used only to allocate space for info->glyph_cnt entries */
- /* but some fonts use out of bounds gids as flags to contextual */
- /* morx subtables, so allocate a full 65536 */
- sm.classes = info->morx_classes = galloc(65536*sizeof(uint16));
- for ( i=0; i<65536; ++i )
- sm.classes[i] = 1; /* Out of bounds */
- readttf_applelookup(ttf,info,
- mortclass_apply_values,mortclass_apply_value,NULL,NULL,true);
- sm.smax = length/(2*sm.nClasses);
- sm.states_in_use = gcalloc(sm.smax,sizeof(uint8));
- follow_morx_state(&sm,0,-1,info);
- } else {
- sm.nClasses = memushort(sm.data,sm.length, 0);
- sm.classOffset = memushort(sm.data,sm.length, sizeof(uint16));
- sm.stateOffset = memushort(sm.data,sm.length, 2*sizeof(uint16));
- sm.entryOffset = memushort(sm.data,sm.length, 3*sizeof(uint16));
- sm.ligActOff = memushort(sm.data,sm.length, 4*sizeof(uint16));
- sm.compOff = memushort(sm.data,sm.length, 5*sizeof(uint16));
- sm.ligOff = memushort(sm.data,sm.length, 6*sizeof(uint16));
- sm.classes = galloc(info->glyph_cnt*sizeof(uint16));
- for ( i=0; i<info->glyph_cnt; ++i )
- sm.classes[i] = 1; /* Out of bounds */
- first = memushort(sm.data,sm.length, sm.classOffset);
- cnt = memushort(sm.data,sm.length, sm.classOffset+sizeof(uint16));
- for ( i=0; i<cnt; ++i )
- sm.classes[first+i] = sm.data[sm.classOffset+2*sizeof(uint16)+i];
- sm.smax = length/sm.nClasses;
- sm.states_in_use = gcalloc(sm.smax,sizeof(uint8));
- follow_mort_state(&sm,sm.stateOffset,-1,info);
- }
- free(sm.data);
- free(sm.states_in_use);
- free(sm.classes);
-}
-
-struct statetable {
- uint32 state_start;
- int nclasses;
- int nstates;
- int nentries;
- int state_offset;
- int entry_size; /* size of individual entry */
- int entry_extras; /* Number of extra glyph offsets */
- int first_glyph; /* that's classifyable */
- int nglyphs;
- uint8 *classes;
- uint8 *state_table; /* state_table[nstates][nclasses], each entry is an */
- /* index into the following array */
- uint16 *state_table2; /* morx version. States are have 2 byte entries */
- uint16 *classes2;
- uint8 *transitions;
- uint32 extra_offsets[3];
-};
-
-static struct statetable *read_statetable(FILE *ttf, int ent_extras, int ismorx, struct ttfinfo *info) {
- struct statetable *st = gcalloc(1,sizeof(struct statetable));
- uint32 here = ftell(ttf);
- int nclasses, class_off, state_off, entry_off;
- int state_max, ent_max, old_state_max, old_ent_max;
- int i, j, ent, new_state, ent_size;
- int error;
-
- st->state_start = here;
-
- if ( ismorx ) {
- nclasses = getlong(ttf);
- class_off = getlong(ttf);
- state_off = getlong(ttf);
- entry_off = getlong(ttf);
- st->extra_offsets[0] = getlong(ttf);
- st->extra_offsets[1] = getlong(ttf);
- st->extra_offsets[2] = getlong(ttf);
- } else {
- nclasses = getushort(ttf); /* Number of bytes per state in state subtable, equal to number of classes */
- class_off = getushort(ttf);
- state_off = getushort(ttf);
- entry_off = getushort(ttf);
- st->extra_offsets[0] = getushort(ttf);
- st->extra_offsets[1] = getushort(ttf);
- st->extra_offsets[2] = getushort(ttf);
- }
- st->nclasses = nclasses;
- st->state_offset = state_off;
-
- /* parse class subtable */
- fseek(ttf,here+class_off,SEEK_SET);
- error = 0;
- if ( ismorx ) {
- /* I used only to allocate space for info->glyph_cnt entries */
- /* but some fonts use out of bounds gids as flags to contextual */
- /* morx subtables, so allocate a full 65536 */
- st->classes2 = info->morx_classes = galloc(65536*sizeof(uint16));
- for ( i=0; i<65536; ++i )
- st->classes2[i] = 1; /* Out of bounds */
- readttf_applelookup(ttf,info,
- mortclass_apply_values,mortclass_apply_value,NULL,NULL,true);
- for ( i=0; i<65536; ++i ) {
- if ( /*st->classes2[i]<0 ||*/ st->classes2[i]>=st->nclasses ) {
- if ( !error )
- LogError( _("Bad class in state machine.\n" ));
- info->bad_gx = true;
- error = true;
- st->classes2[i] = 1; /* Out of bounds */
- }
- }
- } else {
- st->first_glyph = getushort(ttf);
- st->nglyphs = getushort(ttf);
- if ( feof(ttf)) {
- LogError(_("Bad glyph count in mort table.\n"));
- info->bad_gx = true;
- st->nglyphs = 0;
- }
- st->classes = galloc(st->nglyphs);
- fread(st->classes,1,st->nglyphs,ttf);
- for ( i=0; i<st->nglyphs; ++i ) {
- if ( /*st->classes[i]<0 ||*/ st->classes[i]>=st->nclasses ) {
- if ( !error )
- LogError( _("Bad class in state machine.\n" ));
- info->bad_gx = true;
- error = true;
- st->classes[i] = 1; /* Out of bounds */
- }
- }
- }
-
-
- /* The size of an entry is variable. There are 2 uint16 fields at the begin-*/
- /* ning of all entries. There may be some number of shorts following these*/
- /* used for indexing special tables. */
- ent_size = 4 + 2*ent_extras;
- st->entry_size = ent_size;
- st->entry_extras = ent_extras;
-
- /* Apple does not provide a way of figuring out the size of either of the */
- /* state or entry tables, so we must parse both as we go and try to work */
- /* out the maximum values... */
- /* There are always at least 2 states defined. Parse them and find what */
- /* is the biggest entry they use, then parse those entries and find what */
- /* is the biggest state they use, and then repeat until we don't find any*/
- /* more states or entries */
- old_state_max = 0; old_ent_max = 0;
- state_max = 2; ent_max = 0;
- while ( old_state_max!=state_max ) {
- i = old_state_max*nclasses;
- fseek(ttf,here+state_off+(ismorx?(int)(i*sizeof(uint16)):i),SEEK_SET);
- old_state_max = state_max;
- for ( ; i<state_max*nclasses; ++i ) {
- ent = ismorx ? getushort(ttf) : getc(ttf);
- if ( ent+1 > ent_max )
- ent_max = ent+1;
- }
- if ( ent_max==old_ent_max ) /* Nothing more */
- break;
- if ( ent_max>1000 ) {
- LogError( _("It looks to me as though there's a morx sub-table with more than 1000\n transitions. Which makes me think there's probably an error\n" ));
- info->bad_gx = true;
- free(st);
-return( NULL );
- }
- fseek(ttf,here+entry_off+old_ent_max*ent_size,SEEK_SET);
- i = old_ent_max;
- old_ent_max = ent_max;
- for ( ; i<ent_max; ++i ) {
- new_state = getushort(ttf);
- if ( !ismorx )
- new_state = (new_state-state_off)/nclasses;
- /* flags = */ getushort(ttf);
- for ( j=0; j<ent_extras; ++j )
- /* glyphOffsets[j] = */ getushort(ttf);
- if ( new_state+1>state_max )
- state_max = new_state+1;
- }
- if ( state_max>1000 ) {
- LogError( _("It looks to me as though there's a morx sub-table with more than 1000\n states. Which makes me think there's probably an error\n" ));
- info->bad_gx = true;
- free(st);
-return( NULL );
- }
- }
-
- st->nstates = state_max;
- st->nentries = ent_max;
-
- fseek(ttf,here+state_off,SEEK_SET);
- /* an array of arrays of state transitions, each represented by one byte */
- /* which is an index into the Entry subtable, which comes next. */
- /* One dimension is the number of states, and the other the */
- /* number of classes (classes vary faster than states) */
- /* The first two states are predefined, 0 is start of text, 1 start of line*/
- if ( ismorx ) {
- st->state_table2 = galloc(st->nstates*st->nclasses*sizeof(uint16));
- for ( i=0; i<st->nstates*st->nclasses; ++i )
- st->state_table2[i] = getushort(ttf);
- } else {
- st->state_table = galloc(st->nstates*st->nclasses);
- fread(st->state_table,1,st->nstates*st->nclasses,ttf);
- }
-
- /* parse the entry subtable */
- fseek(ttf,here+entry_off,SEEK_SET);
- st->transitions = galloc(st->nentries*st->entry_size);
- fread(st->transitions,1,st->nentries*st->entry_size,ttf);
-return( st );
-}
-
-static void statetablefree(struct statetable *st) {
- free( st->classes );
- free( st->state_table );
- free( st->classes2 );
- free( st->state_table2 );
- free( st->transitions );
- free( st );
-}
-
-static void tagSMWithScriptLang(FeatureScriptLangList *fl,
- struct statetable *st,int ismorx,struct ttfinfo *info) {
- int i;
-
- if ( ismorx ) {
- for ( i=0; i<info->glyph_cnt; ++i )
- if ( st->classes2[i]>=4 && info->chars[i]!=NULL )
- FListsAppendScriptLang(fl,SCScriptFromUnicode(info->chars[i]),
- DEFAULT_LANG);
- } else {
- for ( i=st->first_glyph; i<st->first_glyph+st->nglyphs && i<info->glyph_cnt; ++i )
- if ( info->chars[i]!=NULL )
- FListsAppendScriptLang(fl,SCScriptFromUnicode(info->chars[i]),
- DEFAULT_LANG);
- }
-}
-
-static char **ClassesFromStateTable(struct statetable *st,int ismorx,struct ttfinfo *info) {
- /* On the mac the first four classes should be left blank. only class 1 */
- /* (out of bounds) is supposed to be used in the class array anyway */
- char **classes = galloc(st->nclasses*sizeof(char *));
- int *lens = gcalloc(st->nclasses,sizeof(int));
- int i;
-
-
- if ( ismorx ) {
- for ( i=0; i<info->glyph_cnt; ++i ) if ( info->chars[i]!=NULL )
- lens[st->classes2[i]] += strlen( info->chars[i]->name )+1;
- if ( info->badgids!=NULL )
- for ( i=0; i<info->badgid_cnt; ++i ) if ( info->badgids[i]!=NULL )
- lens[st->classes2[info->badgids[i]->orig_pos]] += strlen( info->badgids[i]->name )+1;
- } else {
- for ( i=st->first_glyph; i<st->first_glyph+st->nglyphs && i<info->glyph_cnt; ++i )
- if ( info->chars[i]!=NULL )
- lens[st->classes[i-st->first_glyph]] += strlen( info->chars[i]->name )+1;
- }
- classes[0] = classes[1] = classes[2] = classes[3] = NULL;
- for ( i=4; i<st->nclasses; ++i ) {
- classes[i] = galloc(lens[i]+1);
- *classes[i] = '\0';
- }
- if ( ismorx ) {
- for ( i=0; i<info->glyph_cnt; ++i ) if ( st->classes2[i]>=4 && info->chars[i]!=NULL ) {
- strcat(classes[st->classes2[i]],info->chars[i]->name );
- strcat(classes[st->classes2[i]]," ");
- }
- if ( info->badgids!=NULL )
- for ( i=0; i<info->badgid_cnt; ++i ) if ( info->badgids[i]!=NULL && st->classes2[info->badgids[i]->orig_pos]>=4) {
- strcat(classes[st->classes2[info->badgids[i]->orig_pos]],info->badgids[i]->name );
- strcat(classes[st->classes2[info->badgids[i]->orig_pos]]," ");
- }
- } else {
- for ( i=st->first_glyph; i<st->first_glyph+st->nglyphs && i<info->glyph_cnt; ++i ) if ( st->classes[i-st->first_glyph]>=4 && info->chars[i]!=NULL ) {
- strcat(classes[st->classes[i-st->first_glyph]],info->chars[i]->name );
- strcat(classes[st->classes[i-st->first_glyph]]," " );
- }
- }
- for ( i=4; i<st->nclasses; ++i ) {
- int len = strlen(classes[i]);
- if ( len!=0 )
- classes[i][len-1] = '\0'; /* Remove trailing space */
- }
- free(lens);
-return( classes );
-}
-
-static char *NamesOfList(uint32 pos,int cnt, FILE *ttf, struct ttfinfo *info) {
- int i, len, glyph;
- char *str;
-
- if ( cnt==0 )
-return(NULL);
-
- fseek(ttf,pos,SEEK_SET);
- for ( i=len=0; i<cnt; ++i ) {
- glyph = getushort(ttf);
- if ( glyph<info->glyph_cnt )
- len += strlen(info->chars[glyph]->name)+1;
- }
- if ( len==0 )
-return( NULL );
- str = galloc(len+1);
- fseek(ttf,pos,SEEK_SET);
- for ( i=len=0; i<cnt; ++i ) {
- glyph = getushort(ttf);
- if ( glyph<info->glyph_cnt ) {
- strcpy(str+len,info->chars[glyph]->name);
- len += strlen(info->chars[glyph]->name);
- str[len++] = ' ';
- }
- }
- str[len-1] = '\0';
-return( str );
-}
-
-#if 0
-static void RunStateFindKernDepth_(ASM *as,int state,int kdepth,uint8 *used) {
- int j, kd;
-
- if ( used[state] )
-return;
- used[state] = true;
-
- for ( j=0; j<as->class_cnt; ++j ) {
- kd = kdepth;
- flags = as->state[state*as->class_cnt+j];
- if ( flags&0x8000 )
- ++kd;
- if ( (flags&0x3fff)!=0 ) {
- as->state[state*as->class_cnt+j].u.kern.kcnt = kd;
- kd = 0;
- }
- RunStateFindKernDepth_(as,as->state[state*as->class_cnt+j].next_state,kd,used);
- }
-}
-
-static void RunStateFindKernDepth(ASM *as) {
- uint8 *used = gcalloc(as->class_cnt);
- int i;
-
- for ( i=0; i<as->class_cnt*as->state_cnt; ++i ) {
- as->state[i].u.kern.kerns = NULL;
- as->state[i].u.kern.kcnt = (as->state[i].flags&0x3fff)==0 ? 0 : -1;
- }
- RunStateFindKernDepth_(as,0,0,used);
- RunStateFindKernDepth_(as,1,0,used);
-}
-#endif
-
-static void KernReadKernList(FILE *ttf,uint32 pos, struct asm_state *trans) {
-/* Apple does not document how to detect the end of the list */
-/* They say "an odd value that depends on coverage" */
-/* They should say "an odd value". Any odd value terminates the list. */
-/* coverage is irrelevant */
-/* Note: List is backwards (glyphs are popped of LIFO so last glyph on */
-/* in stack gets first kern value) */
-/* There are at most 8 glyphs */
- int i,j,k;
- int16 buffer[8]; /* At most 8 kerns are supported */
-
- fseek(ttf,pos,SEEK_SET);
- for ( i=0; i<8; ++i ) {
- buffer[i]=(int16) getushort(ttf);
- if ( buffer[i]&1 ) {
- buffer[i] &= ~1;
- ++i;
- break;
- }
- }
- if ( i==0 ) {
- trans->u.kern.kerns = NULL;
- } else {
- trans->u.kern.kerns = galloc(i*sizeof(int16));
- for ( j=i-1, k=0; k<i; ++k, --j )
- trans->u.kern.kerns[k] = buffer[j];
- }
- trans->u.kern.kcnt = i;
-}
-
-static void read_perglyph_subs(FILE *ttf,struct ttfinfo *info,
- int subs_base,int subs_end,struct statetable *st,
- uint8 *classes_subbed, int evermarked, uint8 *used) {
- /* The file is positioned at the start of a per-glyph substitution table */
- /* Sadly great chunks of this table have been omitted. We are where glyph */
- /* 0 would be if it were present. We've no idea what has been omitted */
- /* Simple checks: if the file pointer is outside of the area devoted to */
- /* substitutions then we know it is ignorable. */
- /* If the current glyph is not in the list of glyphs which could ever */
- /* be substituted then we know it is ignorable. */
- /* Note: the above list is easily figured for substitutions on the current*/
- /* glyph, but if a substitution ever happens to a marked glyph then we */
- /* can't guess. We could check for all classes that get marked, but that*/
- /* doesn't work if there is a current substitution before the class is */
- /* marked, after that we don't know what class the glyph might have */
- /* Instead, for marked subs, we keep track of all locations which were */
- /* used in a current-only sub, and assume that they aren't valid for us */
- /* If the putative substitution glyph is not a valid glyph then we know */
- /* it is ignorable */
- int i, subs, was = info->mort_tag_mac;
- uint32 here;
-
- info->mort_tag_mac = false;
- for ( i=0; i<info->glyph_cnt; ++i ) {
- here = ftell(ttf);
- subs = getushort(ttf);
- if ( subs>=info->glyph_cnt && subs!=0xffff ) /* 0xffff means delete the substituted glyph */
- continue;
- if ( subs==0 ) /* A little risky, one could substitute notdef */
- continue; /* but they shouldn't */
- if ( here<(unsigned)subs_base )
- continue;
- if ( here>=(unsigned)subs_end )
- break;
- if ( evermarked ) {
- if ( used[(here-subs_base)/2] )
- continue;
- } else if ( i<st->first_glyph || i>=st->first_glyph+st->nglyphs ) {
- if ( !classes_subbed[1]) { /* Out of bounds class */
- if ( i>=st->first_glyph+st->nglyphs )
- break;
- continue;
- }
- } else {
- if ( !classes_subbed[st->classes[i-st->first_glyph]] )
- continue;
- }
-
- if ( !evermarked )
- used[(here-subs_base)/2] = true;
- TTF_SetMortSubs(info, i, subs);
- }
- info->mort_tag_mac = was;
-}
-
-static int sm_lookupfind(int32 *lookups,int *_lm,int off) {
- int lm = *_lm, i;
- for ( i=0; i<=lm; ++i )
- if ( lookups[i]==off )
-return( i );
- (*_lm)++;
- lookups[i] = off;
-return( i );
-}
-
-static ASM *readttf_mortx_asm(FILE *ttf,struct ttfinfo *info,int ismorx,
- uint32 subtab_len,enum asm_type type,int extras,
- uint32 coverage, OTLookup *otl) {
- struct statetable *st;
- ASM *as;
- int i,j;
- uint32 here = ftell(ttf);
-
- st = read_statetable(ttf,extras,ismorx,info);
- if ( st==NULL )
-return(NULL);
-
- as = chunkalloc(sizeof(ASM));
- as->type = type;
- as->flags = coverage>>16;
- as->class_cnt = st->nclasses;
- as->state_cnt = st->nstates;
- as->classes = ClassesFromStateTable(st,ismorx,info);
- as->state = galloc(st->nclasses*st->nstates*sizeof(struct asm_state));
- if ( otl==NULL )
- otl = NewMacLookup(info,false);
- otl->lookup_type = type==asm_indic ? morx_indic : type==asm_context ? morx_context : morx_insert;
- as->subtable = otl->subtables; otl->subtables->sm = as;
- tagSMWithScriptLang(otl->features,st,ismorx,info);
- InfoNameOTLookup(otl,info);
- for ( i=0; i<st->nclasses*st->nstates; ++i ) {
- int trans;
- if ( ismorx ) {
- trans = st->state_table2[i];
- as->state[i].next_state = memushort(st->transitions,st->nentries*st->entry_size,trans*st->entry_size);
- } else {
- trans = st->state_table[i];
- as->state[i].next_state = (memushort(st->transitions,st->nentries*st->entry_size,trans*st->entry_size)-st->state_offset)/st->nclasses;
- }
- as->state[i].flags = memushort(st->transitions,st->nentries*st->entry_size,trans*st->entry_size+2);
- if ( extras>0 )
- as->state[i].u.context.mark_lookup = (void *) (intpt) memushort(st->transitions,st->nentries*st->entry_size, trans*st->entry_size+2+2);
- if ( extras>1 )
- as->state[i].u.context.cur_lookup = (void *) (intpt) memushort(st->transitions,st->nentries*st->entry_size, trans*st->entry_size+2+2+2);
- }
- /* Indic tables have no attached subtables, just a verb in the flag field */
- /* so for them we are done. For the others... */
- if ( !ismorx && type==asm_insert ) {
- for ( i=0; i<st->nclasses*st->nstates; ++i ) {
- char *cur=NULL, *mark=NULL;
- if ( (as->state[i].flags&0x3e0)!=0 && as->state[i].u.context.mark_lookup!=NULL ) {
- cur = NamesOfList(here+(intpt) as->state[i].u.context.mark_lookup,
- (as->state[i].flags&0x3e0)>>5,ttf,info);
- }
- if ( (as->state[i].flags&0x01f)!=0 && as->state[i].u.context.cur_lookup!=NULL ) {
- mark = NamesOfList(here+(intpt) as->state[i].u.context.cur_lookup,
- as->state[i].flags&0x01f,ttf,info);
- }
- as->state[i].u.insert.cur_ins=cur;
- as->state[i].u.insert.mark_ins=mark;
- }
- } else if ( ismorx && type == asm_insert ) {
- for ( i=0; i<st->nclasses*st->nstates; ++i ) {
- char *cur=NULL, *mark=NULL;
- if ( (as->state[i].flags&0x3e0)!=0 && (intpt) as->state[i].u.context.mark_lookup!=0xffff ) {
- cur = NamesOfList(here+st->extra_offsets[0]+((intpt) as->state[i].u.context.mark_lookup)*2,
- (as->state[i].flags&0x3e0)>>5,ttf,info);
- }
- if ( (as->state[i].flags&0x01f)!=0 && ((intpt) as->state[i].u.context.cur_lookup)!=0xffff ) {
- mark = NamesOfList(here+st->extra_offsets[0]+((intpt) as->state[i].u.context.cur_lookup)*2,
- as->state[i].flags&0x01f,ttf,info);
- }
- as->state[i].u.insert.cur_ins=cur;
- as->state[i].u.insert.mark_ins=mark;
- }
- } else if ( !ismorx && type == asm_context ) {
- /* I don't see any good way to parse a per-glyph substitution table */
- /* the problem being that most of the per-glyph table is missing */
- /* but I don't know which bits. The offsets I'm given point to */
- /* where glyph 0 would be if it were present in the table, but */
- /* mostly only the bit used is present... */
- /* I could walk though the state machine and find all classes that */
- /* go to a specific substitution (which would tell me what glyphs */
- /* were active). That's not hard for substitutions of the current */
- /* glyph, but it is intractibable for marked glyphs. And I can't */
- /* do one without the other. So I do neither. */
- /* One thing I could test fairly easily would be to see whether */
- /* class 1 (out of bounds) is ever available for a substitution */
- /* (if it ever has a mark set on it or has a current substitution)*/
- /* if not, then I can ignore any putative substitutions for class */
- /* 1 glyphs (actually I should do this for all classes)*/
- /* Damn. That doesn't work for marks. Because a current substitution*/
- /* may be applied, and then the glyph gets marked. So we've no idea*/
- /* what class the newly marked glyph might live in */
- /* Apple's docs say the substitutions are offset from the "state */
- /* subtable", but it seems much more likely that they are offset */
- /* from the substitution table (given that Apple's docs are often */
- /* wrong */ /* Apple's docs are right. not clear why that offset */
- /* is there */
- uint8 *classes_subbed = gcalloc(st->nclasses,1);
- int lookup_max = -1, index, index_max;
- int32 *lookups = galloc(st->nclasses*st->nstates*sizeof(int32));
- uint8 *evermarked = gcalloc(st->nclasses*st->nstates,sizeof(uint8));
- uint8 *used;
- OTLookup **subs;
-
- index_max = 0;
- for ( i=0; i<st->nclasses*st->nstates; ++i ) {
- if ( as->state[i].u.context.mark_lookup!=NULL ) {
- index = sm_lookupfind(lookups,&lookup_max,(int16) (intpt) as->state[i].u.context.mark_lookup);
- if ( index>index_max ) index_max = index;
- }
- if ( as->state[i].u.context.cur_lookup!=NULL ) {
- index = sm_lookupfind(lookups,&lookup_max,(int16) (intpt) as->state[i].u.context.cur_lookup);
- if ( index>index_max ) index_max = index;
- }
- }
- subs = gcalloc(index_max+1,sizeof(OTLookup *));
-
- for ( i=0; i<st->nclasses*st->nstates; ++i ) {
- if ( as->state[i].u.context.mark_lookup!=NULL ) {
- index = sm_lookupfind(lookups,&lookup_max,(int16) (intpt) as->state[i].u.context.mark_lookup);
- evermarked[index] = true;
- as->state[i].u.context.mark_lookup = NewMacSubsLookup(info,otl,index,subs);
- }
- if ( as->state[i].u.context.cur_lookup!=NULL ) {
- index = sm_lookupfind(lookups,&lookup_max,(int16) (intpt) as->state[i].u.context.cur_lookup);
- as->state[i].u.context.cur_lookup = NewMacSubsLookup(info,otl,index,subs);
- }
- }
- used = gcalloc((subtab_len-st->extra_offsets[0]+1)/2,sizeof(uint8));
- /* first figure things that only appear in current subs */
- /* then go back and work on things that apply to things which are also in marked subs */
- for ( j=0; j<2; ++j ) for ( i=0; i<=lookup_max; ++i ) if ( evermarked[i]==j ) {
- info->mort_subs_lookup = NewMacSubsLookup(info,otl,i,subs);
- info->mort_is_nested = true;
- if ( !evermarked[i] ) { int k,l;
- memset(classes_subbed,0,st->nclasses);
- for ( k=0; k<st->nstates; ++k ) for ( l=0; l<st->nclasses; ++l ) {
- if ( as->state[k*st->nclasses+l].u.context.cur_lookup == info->mort_subs_lookup )
- classes_subbed[l] = true;
- }
- }
- fseek(ttf,here/*+st->extra_offsets[0]*/+lookups[i]*2,SEEK_SET);
- read_perglyph_subs(ttf,info,here+st->extra_offsets[0],here+subtab_len,
- st,classes_subbed,evermarked[i],used);
- }
- info->mort_is_nested = false;
- free(classes_subbed);
- free(lookups);
- free(used);
- free(evermarked);
- free(subs);
- } else if ( ismorx && type == asm_context ) {
- int lookup_max= -1;
- uint32 *lookups;
- OTLookup **subs;
-
- for ( i=0; i<st->nclasses*st->nstates; ++i ) {
- if ( (intpt) as->state[i].u.context.mark_lookup!=0xffff ) {
- if ( ((int) (intpt) as->state[i].u.context.mark_lookup)>lookup_max )
- lookup_max = (intpt) as->state[i].u.context.mark_lookup;
- }
- if ( (intpt) as->state[i].u.context.cur_lookup!=0xffff ) {
- if ( ((int) (intpt) as->state[i].u.context.cur_lookup)>lookup_max )
- lookup_max = (intpt) as->state[i].u.context.cur_lookup;
- }
- }
- ++lookup_max;
- subs = gcalloc(lookup_max,sizeof(OTLookup *));
- for ( i=0; i<st->nclasses*st->nstates; ++i ) {
- if ( (intpt) as->state[i].u.context.mark_lookup!=0xffff ) {
- as->state[i].u.context.mark_lookup = NewMacSubsLookup(info,otl,(intpt) as->state[i].u.context.mark_lookup,subs);
- } else
- as->state[i].u.context.mark_lookup = NULL;
- if ( (intpt) as->state[i].u.context.cur_lookup!=0xffff ) {
- as->state[i].u.context.cur_lookup = NewMacSubsLookup(info,otl,(intpt) as->state[i].u.context.cur_lookup,subs);
- } else
- as->state[i].u.context.cur_lookup = NULL;
- }
- lookups = galloc(lookup_max*sizeof(uint32));
- fseek(ttf,here+st->extra_offsets[0],SEEK_SET);
- for ( i=0; i<lookup_max; ++i )
- lookups[i] = getlong(ttf) + here+st->extra_offsets[0];
- for ( i=0; i<lookup_max; ++i ) {
- fseek(ttf,lookups[i],SEEK_SET);
- info->mort_subs_lookup = NewMacSubsLookup(info,otl,i,subs);
- info->mort_is_nested = true;
- readttf_applelookup(ttf,info,
- mort_apply_values,mort_apply_value,NULL,NULL,true);
- }
- info->mort_is_nested = false;
- free(subs);
- free(lookups);
- } else if ( type == asm_kern ) {
- for ( i=0; i<st->nclasses*st->nstates; ++i ) {
- if ( (as->state[i].flags&0x3fff)!=0 ) {
- KernReadKernList(ttf,here+(as->state[i].flags&0x3fff),
- &as->state[i]);
- as->state[i].flags &= ~0x3fff;
- } else {
- as->state[i].u.kern.kcnt = 0;
- as->state[i].u.kern.kerns = NULL;
- }
- }
- }
- as->next = info->sm;
- info->sm = as;
- statetablefree(st);
-return( as );
-}
-
-static int InfoHasGSUBTag(struct ttfinfo *info, uint32 tag, int apple_lookup_type) {
- OTLookup *otl;
- FeatureScriptLangList *feat;
-
- if ( apple_lookup_type==0 || /* Indic rearrangement */
- apple_lookup_type==1 || /* Contextual substitution */
- apple_lookup_type==5 ) /* Contextual insertion */
-return( false ); /* These types can either not be represented in OT */
- /* or not converted to AAT -- so we'd better read them */
- /* We can't really do contextual ligatures either, but we parse that table*/
- /* for the non-contextual ligs (which is most of them) */
-
- for ( otl = info->gsub_lookups; otl!=NULL; otl=otl->next ) {
- for ( feat = otl->features; feat!=NULL; feat=feat->next ) {
- if ( feat->featuretag == tag &&
- Macable(NULL,otl))
-return( true );
- }
- }
-return( false );
-}
-
-static void FeatMarkAsEnabled(struct ttfinfo *info,int featureType,
- int featureSetting);
-
-static uint32 readmortchain(FILE *ttf,struct ttfinfo *info, uint32 base, int ismorx) {
- uint32 chain_len, nfeatures, nsubtables, default_flags;
- uint32 enable_flags, disable_flags, flags;
- int featureType, featureSetting;
- int i,j,k;
- uint32 length, coverage;
- uint32 here;
- uint32 tag;
- struct tagmaskfeature { uint32 tag, enable_flags; uint16 ismac, feat, set; } tmf[32];
- int r2l;
- (void)base; /* for -Wall */
- default_flags = getlong(ttf);
- chain_len = getlong(ttf);
- if ( ismorx ) {
- nfeatures = getlong(ttf);
- nsubtables = getlong(ttf);
- } else {
- nfeatures = getushort(ttf);
- nsubtables = getushort(ttf);
- }
-
- k = 0;
- for ( i=0; i<(int)nfeatures; ++i ) {
- featureType = getushort(ttf);
- featureSetting = getushort(ttf);
- enable_flags = getlong(ttf);
- disable_flags = getlong(ttf);
- if ( feof(ttf))
-return( chain_len );
- if ( enable_flags & default_flags )
- FeatMarkAsEnabled(info,featureType,featureSetting);
- tag = MacFeatureToOTTag(featureType,featureSetting);
- if ( enable_flags!=0 && k<32 ) {
- if ( tag==0 ) {
- tmf[k].tag = (featureType<<16) | featureSetting;
- tmf[k].ismac = true;
- } else {
- tmf[k].tag = tag;
- tmf[k].ismac = false;
- }
- tmf[k].feat = featureType;
- tmf[k].set = featureSetting;
- tmf[k++].enable_flags = enable_flags;
- }
- }
- if ( k==0 )
-return( chain_len );
-
- for ( i=0; i<(int)nsubtables; ++i ) {
- here = ftell(ttf);
- if ( ismorx ) {
- length = getlong(ttf);
- coverage = getlong(ttf);
- } else {
- length = getushort(ttf);
- coverage = getushort(ttf);
- coverage = ((coverage&0xe000)<<16) | (coverage&7); /* convert to morx format */
- }
- r2l = (coverage & 0x40000000)? 1 : 0;
- flags = getlong(ttf);
- for ( j=k-1; j>=0 && (!(flags&tmf[j].enable_flags) || (tmf[j].enable_flags&~flags)!=0); --j );
- if ( j==-1 )
- for ( j=k-1; j>=0 && (!(flags&tmf[j].enable_flags) || tmf[j].feat==0); --j );
- if ( j>=0 ) {
- if ( !tmf[j].ismac &&
- ((coverage&0xff)==0 ||
- (coverage&0xff)==1 ||
- (coverage&0xff)==5 )) {
- /* Only do the opentype tag conversion if we've got a format */
- /* we can convert to opentype. Otherwise it is useless and */
- /* confusing */
- tmf[j].ismac = true;
- tmf[j].tag = (tmf[j].feat<<16) | tmf[j].set;
- }
- info->mort_r2l = r2l;
- info->mort_tag_mac = tmf[j].ismac;
- info->mort_feat = tmf[j].feat; info->mort_setting = tmf[j].set;
- /* If we've already read gsub. And this feature setting matches */
- /* and opentype feature tag. And we've got an OpenType lookup */
- /* attached to that feature tag. And it's a lookup type we can */
- /* convert... Then don't parse this sub-table, we shall assume */
- /* it is simply a duplicate of the OT version */
- if ( info->gsub_start!=0 &&
- (tag = MacFeatureToOTTag(tmf[j].feat,tmf[j].set))!=0 &&
- InfoHasGSUBTag(info,tag,coverage&0xff))
- /* Skip it */;
- else switch( coverage&0xff ) {
- case 0: /* Indic rearangement */
- readttf_mortx_asm(ttf,info,ismorx,length,asm_indic,0,
- coverage,NULL);
- break;
- case 1: /* contextual glyph substitution */
- readttf_mortx_asm(ttf,info,ismorx,length,asm_context,2,
- coverage,NULL);
- break;
- case 2: /* ligature substitution */
- /* Apple's ligature state machines are too weird to be */
- /* represented easily, but I can parse them into a set */
- /* of ligatures -- assuming they are unconditional */
- info->mort_subs_lookup = NewMacLookup(info,false);
- info->mort_subs_lookup->lookup_type = gsub_ligature;
- if ( !tmf[j].ismac ) {
- info->mort_subs_lookup->features->next = chunkalloc(sizeof(FeatureScriptLangList));
- info->mort_subs_lookup->features->next->featuretag = tmf[j].tag;
- info->mort_subs_lookup->features->next->ismac = false;
- }
- info->mort_subs_lookup->subtables->per_glyph_pst_or_kern = true;
- readttf_mortx_lig(ttf,info,ismorx,here,length);
- InfoNameOTLookup(info->mort_subs_lookup,info);
- /* We can give the lookup a better name after we've made a */
- /* guess at what scripts it involves => substitutions first */
- break;
- case 4: /* non-contextual glyph substitutions */
- info->mort_subs_lookup = NewMacLookup(info,false);
- info->mort_subs_lookup->lookup_type = gsub_single;
- if ( !tmf[j].ismac ) {
- info->mort_subs_lookup->features->next = chunkalloc(sizeof(FeatureScriptLangList));
- info->mort_subs_lookup->features->next->featuretag = tmf[j].tag;
- info->mort_subs_lookup->features->next->ismac = false;
- }
- info->mort_subs_lookup->subtables->per_glyph_pst_or_kern = true;
- readttf_applelookup(ttf,info,
- mort_apply_values,mort_apply_value,NULL,NULL,true);
- InfoNameOTLookup(info->mort_subs_lookup,info);
- break;
- case 5: /* contextual glyph insertion */
- readttf_mortx_asm(ttf,info,ismorx,length,asm_insert,2,
- coverage,NULL);
- break;
- }
- }
- fseek(ttf, here+length, SEEK_SET );
- }
-
-return( chain_len );
-}
-
-void readttfmort(FILE *ttf,struct ttfinfo *info) {
- uint32 base = info->morx_start!=0 ? info->morx_start : info->mort_start;
- uint32 here, len;
- int ismorx;
- int32 version;
- int i, nchains;
-
- fseek(ttf,base,SEEK_SET);
- version = getlong(ttf);
- ismorx = version == 0x00020000;
- if ( version!=0x00010000 && version != 0x00020000 )
-return;
- nchains = getlong(ttf);
- if ( feof(ttf)) {
- LogError( _("Unexpected end of file found in morx chain.\n" ));
- info->bad_gx = true;
-return;
- }
- info->mort_max = nchains*33; /* Maximum of one feature per bit ? */
- for ( i=0; i<nchains; ++i ) {
- here = ftell(ttf);
- len = readmortchain(ttf,info,base,ismorx);
- if ( feof(ttf)) {
- LogError( _("Unexpected end of file found in morx chain.\n"));
- info->bad_gx = true;
- break;
- }
- fseek(ttf,here+len,SEEK_SET);
- }
- /* Some Apple fonts use out of range gids as flags in conditional substitutions */
- /* generally to pass information from one sub-table to another which then */
- /* removes the flag */
- if ( info->badgid_cnt!=0 ) {
- /* Merge the fake glyphs in with the real ones */
- info->chars = grealloc(info->chars,(info->glyph_cnt+info->badgid_cnt)*sizeof(SplineChar *));
- for ( i=0; i<info->badgid_cnt; ++i ) {
- info->chars[info->glyph_cnt+i] = info->badgids[i];
- info->badgids[i]->orig_pos = info->glyph_cnt+i;
- }
- info->glyph_cnt += info->badgid_cnt;
- free(info->badgids);
- }
-}
-
/* Apple's docs imply that kerning info is always provided left to right, even*/
/* for right to left scripts. My guess is that their docs are wrong, as they */
/* often are, but if that be so then we need code in here to reverse */
@@ -4620,63 +2982,46 @@ void readttfkerns(FILE *ttf,struct ttfinfo *info) {
KernClass *kc;
uint32 begin_table;
uint16 *class1, *class2;
- int tupleIndex;
int isv;
- SplineChar **chars;
OTLookup *otl;
fseek(ttf,info->kern_start,SEEK_SET);
version = getushort(ttf);
tabcnt = getushort(ttf);
if ( version!=0 ) {
- fseek(ttf,info->kern_start,SEEK_SET);
- version = getlong(ttf);
- tabcnt = getlong(ttf);
+ LogError(_("Invalid or unsupported version (0x%x) for 'kern' table"), version );
+ info->bad_gx = true;
+return;
}
for ( tab=0; tab<tabcnt; ++tab ) {
begin_table = ftell(ttf);
- if ( version==0 ) {
- /* version = */ getushort(ttf);
- len = getushort(ttf);
- coverage = getushort(ttf);
- format = coverage>>8;
- flags_good = ((coverage&7)<=1);
- isv = !(coverage&1);
- tupleIndex = -1;
- header_size = 6;
- } else {
- len = getlong(ttf);
- coverage = getushort(ttf);
- /* Apple has reordered the bits */
- format = (coverage&0xff);
- flags_good = ((coverage&0xdf00)==0 || (coverage&0xdf00)==0x8000);
- isv = coverage&0x8000? 1 : 0;
- tupleIndex = getushort(ttf);
- if ( coverage&0x2000 ) {
- if ( info->variations==NULL )
- flags_good = false; /* Ignore if we failed to load the tuple data */
- else if ( tupleIndex>=info->variations->tuple_count )
- flags_good = false; /* Bad tuple */
- } else
- tupleIndex = -1;
- header_size = 8;
- }
+ /* version = */ getushort(ttf);
+ len = getushort(ttf);
+ coverage = getushort(ttf);
+ format = coverage>>8;
+ flags_good = ((coverage&7)<=1);
+ isv = !(coverage&1);
+ header_size = 6;
otl = NULL;
if ( flags_good ) {
- otl = NewMacLookup(info,true);
+ otl = chunkalloc(sizeof(OTLookup));
otl->lookup_type = gpos_pair;
- if ( isv ) {
- otl->features->featuretag = CHR('v','k','r','n');
- otl->features->ismac = false;
- }
+ otl->subtables = chunkalloc(sizeof(struct lookup_subtable));
+ otl->subtables->lookup = otl;
otl->subtables->per_glyph_pst_or_kern = true;
otl->subtables->vertical_kerning = isv;
+ otl->features = chunkalloc(sizeof(FeatureScriptLangList));
+ if (isv)
+ otl->features->featuretag = CHR('v','k','r','n');
+ else
+ otl->features->featuretag = CHR('k','e','r','n');
+ OTLAppend(info,otl,true);
}
if ( flags_good && format==0 ) {
/* format 0, horizontal kerning data (as pairs) not perpendicular */
- chars = tupleIndex==-1 ? info->chars : info->variations->tuples[tupleIndex].chars;
+ SplineChar **chars = info->chars;
npairs = getushort(ttf);
- if ( version==0 && (len-14 != 6*npairs || npairs>10920 )) {
+ if ( len-14 != 6*npairs || npairs>10920 ) {
LogError( _("In the 'kern' table, a subtable's length does not match the number of kerning pairs.") );
info->bad_gx = true;
}
@@ -4720,32 +3065,15 @@ void readttfkerns(FILE *ttf,struct ttfinfo *info) {
}
}
InfoNameOTLookup(otl,info);
- } else if ( flags_good && format==1 ) {
- /* format 1 is an apple state machine which can handle weird cases */
- /* OpenType's spec doesn't document this */
- /* Apple's docs are wrong about this table, they claim */
- /* there is a special value which marks the end of the kerning */
- /* lists. In fact there is no such value, the list is as long */
- /* as there are things on the kern stack */
- otl->lookup_type = kern_statemachine;
- readttf_mortx_asm(ttf,info,false,len-header_size,asm_kern,0,
- isv ? 0x80000000 : 0 /* coverage doesn't really apply */,otl);
- fseek(ttf,begin_table+len,SEEK_SET);
} else if ( flags_good && (format==2 || format==3 )) {
/* two class based formats */
KernClass **khead, **klast;
- if ( isv && tupleIndex==-1 ) {
+ if ( isv ) {
khead = &info->vkhead;
klast = &info->vklast;
- } else if ( tupleIndex==-1 ) {
+ } else {
khead = &info->khead;
klast = &info->klast;
- } else if ( isv ) {
- khead = &info->variations->tuples[tupleIndex].vkhead;
- klast = &info->variations->tuples[tupleIndex].vklast;
- } else {
- khead = &info->variations->tuples[tupleIndex].khead;
- klast = &info->variations->tuples[tupleIndex].klast;
}
if ( *khead==NULL )
*khead = kc = chunkalloc(sizeof(KernClass));
@@ -4826,92 +3154,6 @@ void readttfkerns(FILE *ttf,struct ttfinfo *info) {
}
}
-void readmacfeaturemap(FILE *ttf,struct ttfinfo *info) {
- MacFeat *last=NULL, *cur;
- struct macsetting *slast, *scur;
- struct fs { int n; int off; } *fs;
- int featcnt, i, j, flags;
-
- fseek(ttf,info->feat_start,SEEK_SET);
- /* version =*/ getfixed(ttf);
- featcnt = getushort(ttf);
- /* reserved */ getushort(ttf);
- /* reserved */ getlong(ttf);
- if ( feof(ttf)) {
- LogError( _("End of file in feat table.\n" ));
- info->bad_gx = true;
-return;
- }
-
- fs = galloc(featcnt*sizeof(struct fs));
- for ( i=0; i<featcnt; ++i ) {
- cur = chunkalloc(sizeof(MacFeat));
- if ( last==NULL )
- info->features = cur;
- else
- last->next = cur;
- last = cur;
-
- cur->feature = getushort(ttf);
- fs[i].n = getushort(ttf);
- fs[i].off = getlong(ttf);
- flags = getushort(ttf);
- cur->strid = getushort(ttf);
- if ( flags&0x8000 ) cur->ismutex = true;
- if ( flags&0x4000 )
- cur->default_setting = flags&0xff;
- if ( feof(ttf)) {
- free(fs);
- LogError( _("End of file in feat table.\n" ));
- info->bad_gx = true;
-return;
- }
- }
-
- for ( i=0, cur=info->features; i<featcnt; ++i, cur = cur->next ) {
- fseek(ttf,info->feat_start+fs[i].off,SEEK_SET);
- slast = NULL;
- for ( j=0; j<fs[i].n; ++j ) {
- scur = chunkalloc(sizeof(struct macsetting));
- if ( slast==NULL )
- cur->settings = scur;
- else
- slast->next = scur;
- slast = scur;
-
- scur->setting = getushort(ttf);
- scur->strid = getushort(ttf);
- if ( feof(ttf)) {
- free(fs);
- LogError( _("End of file in feat table.\n") );
- info->bad_gx = true;
-return;
- }
- }
- }
- free(fs);
-}
-
-static void FeatMarkAsEnabled(struct ttfinfo *info,int featureType,
- int featureSetting) {
- MacFeat *f;
- struct macsetting *s;
-
- for ( f = info->features; f!=NULL && f->feature!=featureType; f=f->next );
- if ( f==NULL )
-return;
- if ( f->ismutex ) {
- for ( s=f->settings ; s!=NULL; s=s->next )
- s->initially_enabled = ( s->setting==featureSetting );
- f->default_setting = featureSetting;
- } else {
- for ( s=f->settings ; s!=NULL && s->setting!=featureSetting; s=s->next );
- if ( s!=NULL )
- s->initially_enabled = true;
- }
-return;
-}
-
/******************************************************************************/
/* ******************************* MATH Table ******************************* */
/* ********************** (Not strictly OpenType yet) *********************** */
@@ -5486,123 +3728,3 @@ return;
}
}
}
-
-static void bsln_apply_values(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- int i;
-
- for ( i=gfirst; i<=glast; ++i )
- info->bsln_values[i]= getushort(ttf);
-}
-
-static void bsln_apply_value(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
- int i;
- int bsln;
-
- bsln = getushort(ttf);
- for ( i=gfirst; i<=glast; ++i )
- info->bsln_values[i]= bsln;
-}
-
-static void bsln_apply_default(struct ttfinfo *info, int gfirst, int glast,void *def) {
- int def_bsln, i;
-
- def_bsln = (intpt) def;
- for ( i=gfirst; i<=glast; ++i )
- info->bsln_values[i]= def_bsln;
-}
-
-void readttfbsln(FILE *ttf,struct ttfinfo *info) {
- int def, ap_def, version, format;
- uint16 *values;
- int offsets[32];
- SplineChar *sc;
- BasePoint pos;
- int mapping[32];
- int i;
- struct Base *base;
- struct basescript *bs;
-
- fseek(ttf,info->bsln_start,SEEK_SET);
- version = getlong(ttf);
- if ( version!=0x00010000 )
-return;
- format = getushort(ttf);
- def = getushort(ttf);
- if ( format==0 || format==1 ) {
- for ( i=0; i<32; ++i )
- offsets[i] = (int16) getushort(ttf);
- } else if ( format==2 || format==3 ) {
- int stdGID = getushort(ttf);
- int ptnum;
- if ( stdGID>=info->glyph_cnt || (sc = info->chars[stdGID])==NULL )
-return;
- for ( i=0; i<32; ++i ) {
- ptnum = getushort(ttf);
- if ( ttfFindPointInSC(sc,ly_fore,ptnum,&pos,NULL)!=-1 )
-return;
- offsets[i] = pos.y;
- }
- }
-
- if ( format&1 ) {
- info->bsln_values = values = gcalloc(info->glyph_cnt,sizeof(uint16));
- readttf_applelookup(ttf,info,
- bsln_apply_values,bsln_apply_value,
- bsln_apply_default,(void *) (intpt) def, false);
- } else
- values = NULL;
-
- for ( i=1; i<32; ++i ) mapping[i] = 3; /* Roman */
-
- info->horiz_base = base = chunkalloc(sizeof(struct Base));
- base->baseline_cnt = 4;
- base->baseline_tags = galloc(4*sizeof(uint32));
- base->baseline_tags[0] = CHR('h','a','n','g'); /* Apple 3 */
- if ( offsets[1]!= offsets[2] ) {
- base->baseline_tags[1] = CHR('i','d','e','o'); /* Apple 2 */
- base->baseline_tags[2] = CHR('m','a','t','h'); /* Apple 4 */
- base->baseline_tags[3] = CHR('r','o','m','n'); /* Apple 0 */
-
- /* Map from Apple's baseline indeces, to OT tag positions */
- mapping[3] = 0;
- mapping[2] = 1;
- mapping[4] = 2;
- mapping[0] = 3;
- /* Apple baseline 1 does not map to an OT tag */
- /* I assume baseline 1 is the normal baseline for CJK on Macs */
- /* (because baseline 2 often (and wrongly) contains the same value */
- } else {
- /* baseline 1 (centered ideographic) and baseline 2 (low ideographic) */
- /* are documented to be different. Yet most of the fonts I have looked*/
- /* at (and I've only got about 4 test cases) have the low ideographic*/
- /* baseline set to the centered baseline. If I were to copy that to */
- /* OT it would be really bad. So even though baseline data is provided*/
- /* I shall ignore it if it looks WRONG! */
- base->baseline_cnt = 3;
- base->baseline_tags[1] = CHR('m','a','t','h'); /* Apple 4 */
- base->baseline_tags[2] = CHR('r','o','m','n'); /* Apple 0 */
- mapping[3] = 0;
- mapping[4] = 1;
- mapping[0] = 2;
- }
-
- for ( i=0; i<info->glyph_cnt; ++i ) if ( (sc=info->chars[i])!=NULL ) {
- uint32 script = SCScriptFromUnicode(sc);
- if ( script==DEFAULT_SCRIPT )
- continue;
- for ( bs=base->scripts; bs!=NULL && bs->script!=script; bs=bs->next );
- if ( bs!=NULL )
- continue;
- bs = chunkalloc(sizeof(struct basescript));
- bs->script = script;
- ap_def = def;
- if ( values!=NULL )
- ap_def = values[i];
- bs->def_baseline = mapping[ap_def];
- bs->baseline_pos = galloc(4*sizeof(int16));
- for ( i=0; i<5; ++i ) if ( i!=1 )
- bs->baseline_pos[mapping[i]] = offsets[i] - offsets[ap_def];
- bs->next = base->scripts;
- base->scripts = bs;
- }
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfvar.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfvar.c
deleted file mode 100644
index 1467fcbc06b..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfvar.c
+++ /dev/null
@@ -1,771 +0,0 @@
-/* Copyright (C) 2000-2008 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaedit.h"
-#include <chardata.h>
-#include <utype.h>
-#include <ustring.h>
-#include <math.h>
-#include <locale.h>
-#include <gwidget.h>
-#include "ttf.h"
-
-/***************************************************************************/
-/* */
-/* Apple documents these tables at */
-/* http:// developer.apple.com/fonts/TTRefMan/RM06/Chap6[fgca]var.html */
-/* The documentation for fvar is inconsistant. At one point it says that */
-/* countSizePairs should be 3, at another point 2. It should be 2. */
-/* The documentation for gvar is not intelligable, cvar refers you to gvar */
-/* and is thus also incomprehensible */
-/* The documentation for avar appears correct, but as Apple has no fonts */
-/* with an 'avar' table, so it's hard to test. */
-/* */
-/***************************************************************************/
-
-/* Parse Apple's variation tables (font, glyph, cvt and axis) */
-/* To be interesting a font must have an fvar and a gvar */
-/* If it's hinted it better have a cvar */
-/* It may have an avar if it wants to be complicated */
-
-void VariationFree(struct ttfinfo *info) {
- int i,j;
- struct variations *variation = info->variations;
-
- if ( variation==NULL )
-return;
- if ( variation->axes!=NULL ) {
- for ( i=0; i<variation->axis_count; ++i ) {
- free(variation->axes[i].mapfrom);
- free(variation->axes[i].mapto);
- }
- free(variation->axes);
- }
- if ( variation->instances!=NULL ) {
- for ( i=0; i<variation->instance_count; ++i ) {
- free(variation->instances[i].coords);
- }
- free(variation->instances);
- }
- if ( variation->tuples!=NULL ) {
- for ( i=0; i<variation->tuple_count; ++i ) {
- free(variation->tuples[i].coords);
- if ( variation->tuples[i].chars!=NULL )
- for ( j=0; j<info->glyph_cnt; ++j )
- SplineCharFree(variation->tuples[i].chars[j]);
- free(variation->tuples[i].chars);
- KernClassListFree(variation->tuples[i].khead);
- KernClassListFree(variation->tuples[i].vkhead);
- }
- free(variation->tuples);
- }
- free(variation);
- info->variations = NULL;
-}
-
-static void parsefvar(struct ttfinfo *info, FILE *ttf) {
- int data_off, axis_count, instance_count, cnt;
- int i,j;
-
- fseek(ttf,info->fvar_start,SEEK_SET);
- if ( getlong(ttf)!=0x00010000 ) /* I only understand version 1 */
-return;
- data_off = getushort(ttf);
- cnt = getushort(ttf);
- if ( cnt>2 )
- LogError( _("Hmm, this 'fvar' table has more count/size pairs than I expect\n") );
- else if ( cnt<2 ) {
- LogError( _("Hmm, this 'fvar' table has too few count/size pairs, I shan't parse it\n") );
-return;
- }
- axis_count = getushort(ttf);
- if ( axis_count==0 || axis_count>4 ) {
- if ( axis_count==0 )
- LogError( _("Hmm, this 'fvar' table has no axes, that doesn't make sense.\n") );
- else
- LogError( _("Hmm, this 'fvar' table has more axes than FontForge can handle.\n") );
-return;
- }
- if ( getushort(ttf)!=20 ) {
- LogError( _("Hmm, this 'fvar' table has an unexpected size for an axis, I shan't parse it\n") );
-return;
- }
- instance_count = getushort(ttf);
- if ( getushort(ttf)!=4+4*axis_count ) {
- LogError( _("Hmm, this 'fvar' table has an unexpected size for an instance, I shan't parse it\n") );
-return;
- }
- if ( data_off+axis_count*20+instance_count*(4+4*axis_count)> (int)info->fvar_len ) {
- LogError( _("Hmm, this 'fvar' table is too short\n") );
-return;
- }
-
- info->variations = gcalloc(1,sizeof(struct variations));
- info->variations->axis_count = axis_count;
- info->variations->instance_count = instance_count;
- info->variations->axes = gcalloc(axis_count,sizeof(struct taxis));
- info->variations->instances = gcalloc(instance_count,sizeof(struct tinstance));
- for ( i=0; i<instance_count; ++i )
- info->variations->instances[i].coords = galloc(axis_count*sizeof(real));
-
- fseek(ttf,info->fvar_start+data_off,SEEK_SET);
- for ( i=0; i<axis_count; ++i ) {
- struct taxis *a = &info->variations->axes[i];
- a->tag = getlong(ttf);
- a->min = getlong(ttf)/65536.0;
- a->def = getlong(ttf)/65536.0;
- a->max = getlong(ttf)/65536.0;
- /* flags = */ getushort(ttf);
- a->nameid = getushort(ttf);
- }
- for ( i=0; i<instance_count; ++i ) {
- struct tinstance *ti = &info->variations->instances[i];
- ti->nameid = getushort(ttf);
- /* flags = */ getushort(ttf);
- for ( j=0 ; j<axis_count; ++j )
- ti->coords[j] = getlong(ttf)/65536.0;
- }
-}
-
-static void parseavar(struct ttfinfo *info, FILE *ttf) {
- int axis_count, pair_count;
- int i,j;
-
- if ( info->variations==NULL || info->avar_start==0 || info->avar_len==0 )
-return;
-
- fseek(ttf,info->avar_start,SEEK_SET);
- if ( getlong(ttf)!=0x00010000 ) { /* I only understand version 1 */
- VariationFree(info);
-return;
- }
- axis_count = getlong(ttf);
- if ( axis_count!=info->variations->axis_count ) {
- LogError( _("Hmm, the axis count in the 'avar' table is different from that in the 'fvar' table.\n") );
- VariationFree(info);
-return;
- }
- for ( i=0; i<axis_count; ++i ) {
- pair_count = getushort(ttf);
- if ( pair_count!=0 ) {
- info->variations->axes[i].mapfrom = galloc(pair_count*sizeof(real));
- info->variations->axes[i].mapto= galloc(pair_count*sizeof(real));
- for ( j=0; j<pair_count; ++j ) {
- info->variations->axes[i].mapfrom[j] = getushort(ttf)/16384.0;
- info->variations->axes[i].mapto[j] = getushort(ttf)/16384.0;
- }
- }
- }
- if ( ftell(ttf)-info->avar_start>info->avar_len) {
- LogError( _("Hmm, the the 'avar' table is too long.\n") );
- VariationFree(info);
-return;
- }
-}
-
-static SplineChar **InfoCopyGlyphs(struct ttfinfo *info) {
- SplineChar **chars = galloc(info->glyph_cnt*sizeof(SplineChar *));
- int i;
- RefChar *r;
-
- for ( i=0; i<info->glyph_cnt; ++i ) {
- if ( info->chars[i]==NULL )
- chars[i] = NULL;
- else {
- chars[i] = SplineCharCopy(info->chars[i],NULL,NULL);
- free(chars[i]->ttf_instrs); chars[i]->ttf_instrs = NULL;
- chars[i]->ttf_instrs_len = 0;
- PSTFree(chars[i]->possub); chars[i]->possub = NULL;
- for ( r=chars[i]->layers[ly_fore].refs; r!=NULL; r=r->next )
- r->sc = NULL;
- chars[i]->changed = false;
- chars[i]->ticked = false;
- }
- }
-
- for ( i=0; i<info->glyph_cnt; ++i )
- ttfFixupRef(chars,i);
-return( chars );
-}
-
-#define BAD_DELTA 0x10001
-static int *readpackeddeltas(FILE *ttf,int n) {
- int *deltas;
- int runcnt, i, j;
-
- deltas = galloc(n*sizeof(int));
-
- i = 0;
- while ( i<n ) {
- runcnt = getc(ttf);
- if ( runcnt&0x80 ) {
- /* runcnt zeros get added */
- for ( j=0; j<=(runcnt&0x3f) && i<n ; ++j )
- deltas[i++] = 0;
- } else if ( runcnt&0x40 ) {
- /* runcnt shorts from the stack */
- for ( j=0 ; j<=(runcnt&0x3f) && i<n ; ++j )
- deltas[i++] = (int16) getushort(ttf);
- } else {
- /* runcnt signed bytes from the stack */
- for ( j=0; j<=(runcnt&0x3f) && i<n; ++j )
- deltas[i++] = (int8) getc(ttf);
- }
- if ( j<=(runcnt&0x3f) ) {
- if ( n>0 )
- deltas[0] = BAD_DELTA;
- }
- }
-return( deltas );
-}
-
-#define ALL_POINTS 0x10001
-#define END_OF_POINTS 0x10000
-
-static int *readpackedpoints(FILE *ttf) {
- int *points;
- int n, runcnt, i, j, first;
-
- n = getc(ttf);
- if ( n==EOF )
- n = 0;
- if ( n&0x80 )
- n = getc(ttf)|((n&0x7f)<<8);
- points = galloc((n+1)*sizeof(int));
- if ( n==0 )
- points[0] = ALL_POINTS;
- else {
- i = 0;
- while ( i<n ) {
- runcnt = getc(ttf);
- if ( runcnt&0x80 ) {
- runcnt = (runcnt&0x7f);
- points[i++] = first = getushort(ttf);
- /* first point not included in runcount */
- for ( j=0; j<runcnt && i<n; ++j )
- points[i++] = (first += getushort(ttf));
- } else {
- points[i++] = first = getc(ttf);
- for ( j=0; j<runcnt && i<n; ++j )
- points[i++] = (first += getc(ttf));
- }
- }
- points[n] = END_OF_POINTS;
- }
-return( points );
-}
-
-static int TuplesMatch(struct variations *v, int vtest, int dbase) {
- /* variations for [0,1] make up part of design [1,1], but not the other */
- /* way round */
- int i;
-
- if ( dbase>=v->tuple_count )
-return( false );
-
- if ( vtest==dbase )
-return( true );
- for ( i=0; i<v->axis_count; ++i ) {
- if ( v->tuples[vtest].coords[i]==0 && v->tuples[dbase].coords[i]!=0 )
-return( false );
- if ( v->tuples[dbase].coords[i]!=0 &&
- v->tuples[dbase].coords[i]!=v->tuples[vtest].coords[i] )
-return( false );
- }
-return( true );
-}
-
-static int PointCount(SplineChar *sc) {
- int i;
- RefChar *ref;
- SplineSet *ss;
- SplinePoint *sp;
-
- if ( sc->layers[ly_fore].refs!=NULL )
- for ( i=0, ref=sc->layers[ly_fore].refs; ref!=NULL; ++i, ref=ref->next );
- else {
- for ( i=0, ss = sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- for ( sp=ss->first; sp!=NULL ; ) {
- if ( sp->ttfindex!=0xffff && sp->ttfindex!=0xfffe )
- ++i;
- if ( sp->nextcpindex!=0xffff && sp->nextcpindex!=0xfffe )
- ++i;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- }
- }
-return( i );
-}
-
-static void SCShiftAllBy(SplineChar *sc,int xd, int yd) {
- /* If they change the left/right side-bearing, I think that means everything */
- /* should be shifted over */
- SplineSet *ss;
- SplinePoint *sp;
- RefChar *ref;
-
- if ( xd==0 && yd==0 )
-return;
-
- for ( ss = sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- for ( sp=ss->first; sp!=NULL ; ) {
- if ( sp->ttfindex!=0xffff && sp->ttfindex!=0xfffe ) {
- sp->me.x += xd;
- sp->me.y += yd;
- }
- if ( sp->nextcpindex!=0xffff && sp->nextcpindex!=0xfffe ) {
- sp->nextcp.x += xd;
- sp->nextcp.y += yd;
- if ( sp->next!=NULL )
- sp->next->to->prevcp = sp->nextcp;
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp == ss->first )
- break;
- }
- }
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- ref->transform[4] += xd;
- ref->transform[5] += yd;
- SCReinstanciateRefChar(sc,ref,ly_fore);
- }
-}
-
-static void VaryGlyph(SplineChar *sc,int *points, int *xdeltas, int *ydeltas,
- int pcnt) {
- /* A character contains either composites or contours */
- int i,j;
- RefChar *ref;
- SplineSet *ss;
- SplinePoint *sp;
- Spline *s, *first;
-
- if ( points[0]==ALL_POINTS ) {
- if ( sc->layers[ly_fore].refs!=NULL ) {
- for ( i=0, ref=sc->layers[ly_fore].refs; ref!=NULL; ++i, ref=ref->next ) {
- if ( xdeltas[i]!=0 || ydeltas[i]!=0 ) {
- ref->transform[4] += xdeltas[i];
- ref->transform[5] += ydeltas[i];
- SCReinstanciateRefChar(sc,ref,ly_fore);
- }
- }
- } else {
- for ( ss = sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- for ( sp=ss->first; sp!=NULL ; ) {
- if ( sp->ttfindex!=0xffff && sp->ttfindex!=0xfffe ) {
- sp->me.x += xdeltas[sp->ttfindex];
- sp->me.y += ydeltas[sp->ttfindex];
- }
- if ( sp->nextcpindex!=0xffff && sp->nextcpindex!=0xfffe ) {
- sp->nextcp.x += xdeltas[sp->nextcpindex];
- sp->nextcp.y += ydeltas[sp->nextcpindex];
- if ( sp->next!=NULL )
- sp->next->to->prevcp = sp->nextcp;
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp == ss->first )
- break;
- }
- }
- }
- SCShiftAllBy(sc,-xdeltas[pcnt-4],0);
- SCShiftAllBy(sc,0,-ydeltas[pcnt-2]);
- sc->width += xdeltas[pcnt-3];
- sc->vwidth += ydeltas[pcnt-1];
- } else {
- j = 0;
- if ( sc->layers[ly_fore].refs!=NULL ) {
- for ( i=0, ref=sc->layers[ly_fore].refs; ref!=NULL; ++i, ref=ref->next ) {
- if ( points[j]==i ) {
- if ( xdeltas[j]!=0 || ydeltas[j]!=0 ) {
- ref->transform[4] += xdeltas[j];
- ref->transform[5] += ydeltas[j];
- SCReinstanciateRefChar(sc,ref,ly_fore);
- }
- ++j;
- }
- }
- } else {
- for ( i=0, ss = sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- if ( ss->first->prev!=NULL && ss->first->prev->from->nextcpindex==points[j] ) {
- ss->first->prevcp.x += xdeltas[j];
- ss->first->prevcp.y += ydeltas[j];
- ss->first->prev->from->nextcp = ss->first->prevcp;
- ++j;
- }
- for ( sp=ss->first; sp!=NULL ; ++i ) {
- if ( sp->ttfindex!=0xffff && sp->ttfindex!=0xfffe )
- ++i;
- if ( sp->ttfindex==points[j] ) {
- sp->me.x += xdeltas[j];
- sp->me.y += ydeltas[j++];
- }
- if ( sp->nextcpindex!=0xffff && sp->nextcpindex!=0xfffe )
- ++i;
- if ( sp->nextcpindex==points[j] ) {
- sp->nextcp.x += xdeltas[j];
- sp->nextcp.y += ydeltas[j++];
- if ( sp->next!=NULL )
- sp->next->to->prevcp = sp->nextcp;
- } else if ( sp->nonextcp ) {
- sp->nextcp = sp->me;
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp == ss->first )
- break;
- }
- first = NULL;
- }
- }
- if ( points[j]==i )
- SCShiftAllBy(sc,-xdeltas[j++],0);
- if ( points[j]==i+1 )
- sc->width += xdeltas[j++];
- if ( points[j]==i+2 )
- SCShiftAllBy(sc,0,-ydeltas[j++]);
- if ( points[j]==i+3 )
- sc->vwidth += ydeltas[j++];
- }
- if ( sc->layers[ly_fore].refs==NULL ) {
- for ( ss = sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- for ( sp=ss->first; sp!=NULL ; ++i ) {
- if ( sp->ttfindex==0xffff ) {
- sp->me.x = ( sp->nextcp.x + sp->prevcp.x )/2;
- sp->me.y = ( sp->nextcp.y + sp->prevcp.y )/2;
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp == ss->first )
- break;
- }
-
- first = NULL;
- for ( s=ss->first->next; s!=NULL && s!=first; s=s->to->next ) {
- SplineRefigure(s);
- if ( first==NULL ) first = s;
- }
- }
- }
-}
-
-static void VaryGlyphs(struct ttfinfo *info,int tupleIndex,int gnum,
- int *points, FILE *ttf ) {
- /* one annoying thing about gvar, is that the variations do not describe */
- /* designs. well variations for [0,1] describes that design, but the */
- /* design for [1,1] includes the variations [0,1], [1,0], and [1,1] */
- int pcnt, tc;
- int *xdeltas, *ydeltas;
- struct variations *v = info->variations;
-
- if ( info->chars[gnum]==NULL ) /* Apple doesn't support ttc so this */
-return; /* can't happen */
- if ( points==NULL ) {
- LogError( _("Mismatched local and shared tuple flags.\n") );
-return;
- }
-
- if ( points[0]==ALL_POINTS )
- pcnt = PointCount(info->chars[gnum])+4;
- else {
- for ( pcnt=0; points[pcnt]!=END_OF_POINTS; ++pcnt );
- }
- xdeltas = readpackeddeltas(ttf,pcnt);
- ydeltas = readpackeddeltas(ttf,pcnt);
- if ( xdeltas[0]!=BAD_DELTA && ydeltas[0]!=BAD_DELTA )
- for ( tc = 0; tc<v->tuple_count; ++tc ) {
- if ( TuplesMatch(v,tc,tupleIndex))
- VaryGlyph(v->tuples[tc].chars[gnum],points,xdeltas,ydeltas,pcnt);
- } else {
- static int warned = false;
- if ( !warned )
- LogError( _("Incorrect number of deltas in glyph %d (%s)\n"), gnum,
- info->chars[gnum]->name!=NULL?info->chars[gnum]->name:"<Nameless>" );
- warned = true;
- }
- free(xdeltas);
- free(ydeltas);
-}
-
-static void parsegvar(struct ttfinfo *info, FILE *ttf) {
- /* I'm only going to support a subset of the gvar. Only the global tuples */
- int axiscount, globaltc, gvarflags, gc, i,j,g;
- uint32 tupoff, dataoff, *gvars;
- struct variations *v = info->variations;
- int warned=false;
-
- fseek(ttf,info->gvar_start,SEEK_SET);
- if ( getlong(ttf)!=0x00010000 ) { /* I only understand version 1 */
- VariationFree(info);
-return;
- }
- axiscount = getushort(ttf);
- if ( axiscount!=info->variations->axis_count ) {
- LogError( _("Hmm, the axis count in the 'gvar' table is different from that in the 'fvar' table.\n") );
- VariationFree(info);
-return;
- }
- globaltc = getushort(ttf);
- tupoff = getlong(ttf) + info->gvar_start;
- gc = getushort(ttf);
- gvarflags = getushort(ttf);
- dataoff = getlong(ttf) + info->gvar_start;
- if ( globaltc==0 || globaltc>AppleMmMax ) {
- if ( globaltc==0 )
- LogError( _("Hmm, no global tuples specified in the 'gvar' table.\n") );
- else
- LogError( _("Hmm, too many global tuples specified in the 'gvar' table.\n FontForge only supports %d\n"), AppleMmMax );
- VariationFree(info);
-return;
- }
- if ( gc>info->glyph_cnt ) {
- LogError( _("Hmm, more glyph variation data specified than there are glyphs in font.\n") );
- VariationFree(info);
-return;
- }
-
- gvars = galloc((gc+1)*sizeof(uint32));
- if ( gvarflags&1 ) { /* 32 bit data */
- for ( i=0; i<=gc; ++i )
- gvars[i] = getlong(ttf)+dataoff;
- } else {
- for ( i=0; i<=gc; ++i )
- gvars[i] = getushort(ttf)*2 +dataoff; /* Undocumented *2 */
- }
-
- v->tuple_count = globaltc;
- v->tuples = gcalloc(globaltc,sizeof(struct tuples));
- fseek(ttf,tupoff,SEEK_SET);
- for ( i=0; i<globaltc; ++i ) {
- v->tuples[i].coords = galloc(axiscount*sizeof(float));
- for ( j=0; j<axiscount; ++j )
- v->tuples[i].coords[j] = ((short) getushort(ttf))/16384.0;
- v->tuples[i].chars = InfoCopyGlyphs(info);
- }
-
- for ( g=0; g<gc; ++g ) if ( gvars[g]!=gvars[g+1] ) {
- int tc;
- uint32 datoff;
- int *sharedpoints=NULL;
- fseek(ttf,gvars[g],SEEK_SET);
- tc = getushort(ttf);
- datoff = gvars[g]+getushort(ttf);
- if ( tc&0x8000 ) {
- uint32 here = ftell(ttf);
- fseek(ttf,datoff,SEEK_SET);
- sharedpoints = readpackedpoints(ttf);
- datoff = ftell(ttf);
- fseek(ttf,here,SEEK_SET);
- }
- for ( i=0; i<(tc&0xfff); ++i ) {
- int tupleDataSize, tupleIndex;
- tupleDataSize = getushort(ttf);
- tupleIndex = getushort(ttf);
- if ( tupleIndex&0xc000 ) {
- if ( !warned )
- LogError( _("Warning: Glyph %d contains either private or intermediate tuple data.\n FontForge supports neither.\n"),
- g);
- warned = true;
- if ( tupleIndex&0x8000 )
- fseek(ttf,2*axiscount,SEEK_CUR);
- if ( tupleIndex&0x4000 )
- fseek(ttf,4*axiscount,SEEK_CUR);
- } else {
- int *localpoints=NULL;
- uint32 here = ftell(ttf);
- fseek(ttf,datoff,SEEK_SET);
- if ( tupleIndex&0x2000 )
- localpoints = readpackedpoints(ttf);
- VaryGlyphs(info,tupleIndex&0xfff,g,
- (tupleIndex&0x2000)?localpoints:sharedpoints,ttf);
- free(localpoints);
- fseek(ttf,here,SEEK_SET);
- }
- datoff += tupleDataSize;
- }
- free(sharedpoints);
- }
- free(gvars);
-}
-
-static void AlterEntry(struct ttf_table *cvt, int i, int delta ) {
- int val = memushort(cvt->data,cvt->len,2*i);
- memputshort(cvt->data,2*i,val+delta);
-}
-
-static void VaryCvt(struct tuples *tuple,int *points, int *deltas,
- int pcnt, struct ttf_table *orig_cvt) {
- struct ttf_table *cvt;
- int i;
-
- if ( (cvt = tuple->cvt)==NULL ) {
- cvt = tuple->cvt = chunkalloc(sizeof(struct ttf_table));
- cvt->tag = orig_cvt->tag;
- cvt->len = cvt->maxlen = orig_cvt->len;
- cvt->data = galloc(cvt->len);
- memcpy(cvt->data,orig_cvt->data,cvt->len);
- }
- if ( points[0]==ALL_POINTS ) {
- for ( i=0; i<pcnt; ++i )
- AlterEntry(cvt,i,deltas[i]);
- } else {
- for ( i=0; i<pcnt; ++i )
- AlterEntry(cvt,points[i],deltas[i]);
- }
-}
-
-static void VaryCvts(struct ttfinfo *info,int tupleIndex, int *points, FILE *ttf,
- struct ttf_table *origcvt ) {
- /* one annoying thing about gvar, is that the variations do not describe */
- /* designs. well variations for [0,1] describes that design, but the */
- /* design for [1,1] includes the variations [0,1], [1,0], and [1,1] */
- /* And same is true of cvar */
- int pcnt, tc;
- int *deltas;
- struct variations *v = info->variations;
-
- if ( points[0]==ALL_POINTS )
- pcnt = origcvt->len/sizeof(uint16);
- else {
- for ( pcnt=0; points[pcnt]!=END_OF_POINTS; ++pcnt );
- }
- deltas = readpackeddeltas(ttf,pcnt);
- if ( deltas[0]!=BAD_DELTA )
- for ( tc = 0; tc<v->tuple_count; ++tc ) {
- if ( TuplesMatch(v,tc,tupleIndex))
- VaryCvt(&v->tuples[tc],points,deltas,pcnt,origcvt);
- } else {
- static int warned = false;
- if ( !warned )
- LogError( _("Incorrect number of deltas in cvt\n") );
- warned = true;
- }
- free(deltas);
-}
-
-static void parsecvar(struct ttfinfo *info, FILE *ttf) {
- struct ttf_table *cvt;
- int tuplecount;
- uint32 offset;
- int *sharedpoints=NULL;
- int i;
- int warned = false;
-
- for ( cvt = info->tabs; cvt!=NULL && cvt->tag!=CHR('c','v','t',' '); cvt=cvt->next );
- if ( cvt==NULL )
-return;
-
- fseek(ttf,info->cvar_start,SEEK_SET);
- if ( getlong(ttf)!=0x00010000 ) { /* I only understand version 1 */
- /* I think I can live without cvt variations... */
- /* So I shan't free the structure */
-return;
- }
-
- tuplecount = getushort(ttf);
- offset = info->cvar_start+getushort(ttf);
- /* The documentation implies there are flags packed into the tuplecount */
- /* but John Jenkins tells me that shared points don't apply to cvar */
- /* Might as well parse it just in case */
- if ( tuplecount&0x8000 ) {
- uint32 here = ftell(ttf);
- fseek(ttf,offset,SEEK_SET);
- sharedpoints = readpackedpoints(ttf);
- offset = ftell(ttf);
- fseek(ttf,here,SEEK_SET);
- }
- for ( i=0; i<(tuplecount&0xfff); ++i ) {
- int tupleDataSize, tupleIndex;
- tupleDataSize = getushort(ttf);
- tupleIndex = getushort(ttf);
- /* there is no provision here for a global tuple coordinate section */
- /* so John says there are no tuple indeces. Just embedded tuples */
- if ( tupleIndex&0x4000 ) {
- if ( !warned )
- LogError( _("Warning: 'cvar' contains intermediate tuple data.\n FontForge doesn't support this.\n") );
- warned = true;
- if ( tupleIndex&0x8000 )
- fseek(ttf,2*info->variations->axis_count,SEEK_CUR);
- if ( tupleIndex&0x4000 )
- fseek(ttf,4*info->variations->axis_count,SEEK_CUR);
- } else {
- int *localpoints=NULL;
- uint32 here;
- int j,k,ti;
- ti = tupleIndex&0xfff;
- if ( tupleIndex&0x8000 ) {
- real *coords = galloc(info->variations->axis_count*sizeof(real));
- for ( j=0; j<info->variations->axis_count; ++j )
- coords[j] = ((int16) getushort(ttf))/16384.0;
- for ( k=0 ; k<info->variations->tuple_count; ++k ) {
- for ( j=0; j<info->variations->axis_count; ++j )
- if ( coords[j]!=info->variations->tuples[k].coords[j] )
- break;
- if ( j==info->variations->axis_count )
- break;
- }
- ti = -1;
- if ( k!=info->variations->tuple_count )
- ti = k;
- }
- if ( ti!=-1 ) {
- here = ftell(ttf);
- fseek(ttf,offset,SEEK_SET);
- if ( tupleIndex&0x2000 )
- localpoints = readpackedpoints(ttf);
- VaryCvts(info,ti,(tupleIndex&0x2000)?localpoints:sharedpoints,ttf,cvt);
- free(localpoints);
- fseek(ttf,here,SEEK_SET);
- }
- }
- offset += tupleDataSize;
- }
- free(sharedpoints);
-}
-
-void readttfvariations(struct ttfinfo *info, FILE *ttf) {
- if ( info->gvar_start==0 || info->gvar_len==0 || info->fvar_start==0 || info->fvar_len==0 )
-return;
-
- ff_progress_change_line2(_("Processing Variations"));
- parsefvar(info,ttf);
- if ( info->variations!=NULL && info->avar_start!=0 )
- parseavar(info,ttf);
- if ( info->variations!=NULL )
- parsegvar(info,ttf);
- if ( info->variations!=NULL && info->cvar_start!=0 && info->cvt_start!=0 )
- parsecvar(info,ttf);
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pfaedit.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pfaedit.h
index 2a638d1dcf3..dc06e0e0807 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pfaedit.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pfaedit.h
@@ -60,7 +60,6 @@ extern int autohint_before_rasterize;
extern int autohint_before_generate;
extern int seperate_hint_controls;
extern int no_windowing_ui;
-extern uint32 default_background;
extern int use_utf8_in_script;
extern int new_em_size;
@@ -79,6 +78,4 @@ extern Encoding *enclist;
#define SCRIPT_MENU_MAX 10
-extern MacFeat *default_mac_feature_map;
-
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psread.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psread.c
index 2f6c6ec2df5..b54cbac638d 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psread.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psread.c
@@ -31,7 +31,6 @@
#include <utype.h>
#include "psfont.h"
#include "sd.h"
-#include "views.h" /* For CharViewBase */
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h> /* Solaris defines isnan in ieeefp rather than math.h */
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.h
index 6d72f3e8630..ecb62e8b66a 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.h
@@ -60,7 +60,6 @@ typedef struct kernclass1 {
typedef struct generic_pst1 {
PST pst;
- uint8 macfeature; /* tag should be interpretted as <feature,setting> rather than 'abcd' */
uint16 flags;
uint16 script_lang_index; /* 0xffff means none */
uint32 tag;
@@ -73,12 +72,6 @@ typedef struct generic_fpst1 {
uint32 tag;
} FPST1;
-typedef struct generic_asm1 { /* Apple State Machine */
- ASM sm;
- uint16 feature, setting;
- uint32 opentype_tag; /* If converted from opentype */
-} ASM1;
-
typedef struct splinefont1 {
SplineFont sf;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinechar.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinechar.c
index 7245bb926bb..b123de4827d 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinechar.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinechar.c
@@ -30,7 +30,6 @@
#include <locale.h>
# include <ustring.h>
# include <utype.h>
-# include <gresource.h>
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h> /* Solaris defines isnan in ieeefp rather than math.h */
#endif
@@ -149,25 +148,6 @@ void SplineSetsRound2Int(SplineSet *spl,real factor, int inspiro, int onlysel) {
}
}
-
-void AltUniAdd(SplineChar *sc,int uni) {
- struct altuni *altuni;
-
- if ( sc!=NULL && uni!=-1 && uni!=sc->unicodeenc ) {
- for ( altuni = sc->altuni; altuni!=NULL && (altuni->unienc!=uni ||
- altuni->vs!=-1 ||
- altuni->fid); altuni=altuni->next );
- if ( altuni==NULL ) {
- altuni = chunkalloc(sizeof(struct altuni));
- altuni->next = sc->altuni;
- sc->altuni = altuni;
- altuni->unienc = uni;
- altuni->vs = -1;
- altuni->fid = 0;
- }
- }
-}
-
void SCOrderAP(SplineChar *sc) {
int lc=0, cnt=0, out=false, i,j;
AnchorPoint *ap, **array;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefill.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefill.c
index c8f55197d6e..b9e52fb9fbd 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefill.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefill.c
@@ -29,12 +29,9 @@
#include <string.h>
#include <ustring.h>
#include <math.h>
-#include "gdraw.h"
#include "splinefont.h"
#include "edgelist.h"
-Color default_background = 0xffffff; /* white */
-
static void HintsFree(Hints *h) {
Hints *hnext;
for ( ; h!=NULL; h = hnext ) {
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c
index 2e80ebccead..a3b610a7174 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c
@@ -160,7 +160,6 @@ return( sc );
if ( map->enc->psnames!=NULL &&
(sc = SFGetChar(sf,dummy.unicodeenc,dummy.name))!=NULL ) {
map->map[enc] = sc->orig_pos;
- AltUniAdd(sc,dummy.unicodeenc);
return( sc );
}
sc = SFSplineCharCreate(sf);
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.h
index 658d66ed5a8..6dc6cec2b8a 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.h
@@ -66,7 +66,6 @@
#define CHR(ch1,ch2,ch3,ch4) (((ch1)<<24)|((ch2)<<16)|((ch3)<<8)|(ch4))
#define MmMax 16 /* PS says at most this many instances for type1/2 mm fonts */
-#define AppleMmMax 26 /* Apple sort of has a limit of 4095, but we only support this many */
typedef struct ipoint {
int x;
@@ -335,10 +334,6 @@ enum otlookup_type {
gsub_contextchain = 0x006,
/* GSUB extension 7 */
gsub_reversecchain = 0x008,
- /* mac state machines */
- morx_indic = 0x0fd,
- morx_context = 0x0fe,
- morx_insert = 0x0ff,
/* ********************* */
gpos_start = 0x100, /* Not a lookup type */
@@ -351,7 +346,6 @@ enum otlookup_type {
gpos_context = 0x107,
gpos_contextchain = 0x108,
/* GPOS extension 9 */
- kern_statemachine = 0x1ff
/* otlookup&0xff == lookup type for the appropriate table */
/* otlookup>>8: 0=>GSUB, 1=>GPOS */
@@ -365,9 +359,6 @@ enum otlookup_typemasks {
gsub_context_mask = 0x00010,
gsub_contextchain_mask = 0x00020,
gsub_reversecchain_mask = 0x00040,
- morx_indic_mask = 0x00080,
- morx_context_mask = 0x00100,
- morx_insert_mask = 0x00200,
/* ********************* */
gpos_single_mask = 0x00400,
gpos_pair_mask = 0x00800,
@@ -377,7 +368,6 @@ enum otlookup_typemasks {
gpos_mark2mark_mask = 0x08000,
gpos_context_mask = 0x10000,
gpos_contextchain_mask = 0x20000,
- kern_statemachine_mask = 0x40000
};
#define MAX_LANG 4 /* If more than this we allocate more_langs in chunks of MAX_LANG */
@@ -400,7 +390,6 @@ typedef struct featurescriptlanglist {
uint32 featuretag;
struct scriptlanglist *scripts;
struct featurescriptlanglist *next;
- unsigned int ismac: 1; /* treat the featuretag as a mac feature/setting */
} FeatureScriptLangList;
enum pst_flags { pst_r2l=1, pst_ignorebaseglyphs=2, pst_ignoreligatures=4,
@@ -423,7 +412,6 @@ typedef struct otlookup {
unsigned int ticked: 1;
struct kernclass *kc;
struct generic_fpst *fpst;
- struct generic_asm *sm;
/* Each time an item is added to a lookup we must place it into a */
/* subtable. If it's a kerning class, fpst or state machine it has */
/* a subtable all to itself. If it's an anchor class it can share */
@@ -599,71 +587,6 @@ typedef struct generic_fpst {
uint8 effectively_by_glyphs;
} FPST;
-enum asm_type { asm_indic, asm_context, asm_lig, asm_simple=4, asm_insert,
- asm_kern=0x11 };
-enum asm_flags { asm_vert=0x8000, asm_descending=0x4000, asm_always=0x2000 };
-
-typedef struct generic_asm { /* Apple State Machine */
- struct generic_asm *next;
- uint16 /*enum asm_type*/ type;
- struct lookup_subtable *subtable; /* Lookup contains feature setting info */
- uint16 flags; /* 0x8000=>vert, 0x4000=>r2l, 0x2000=>hor&vert */
- uint8 ticked;
-
- uint16 class_cnt, state_cnt;
- char **classes;
- struct asm_state {
- uint16 next_state;
- uint16 flags;
- union {
- struct {
- struct otlookup *mark_lookup; /* for contextual glyph subs (tag of a nested lookup) */
- struct otlookup *cur_lookup; /* for contextual glyph subs */
- } context;
- struct {
- char *mark_ins;
- char *cur_ins;
- } insert;
- struct {
- int16 *kerns;
- int kcnt;
- } kern;
- } u;
- } *state;
- /*uint32 opentype_tag; */ /* If converted from opentype */
-} ASM;
-/* State Flags:
- Indic:
- 0x8000 mark current glyph as first in rearrangement
- 0x4000 don't advance to next glyph
- 0x2000 mark current glyph as last
- 0x000f verb
- 0 = no change 8 = AxCD => CDxA
- 1 = Ax => xA 9 = AxCD => DCxA
- 2 = xD => Dx a = ABxD => DxAB
- 3 = AxD => DxA b = ABxD => DxBA
- 4 = ABx => xAB c = ABxCD => CDxAB
- 5 = ABx => xBA d = ABxCD => CDxBA
- 6 = xCD => CDx e = ABxCD => DCxAB
- 7 = xCD => DCx f = ABxCD => DCxBA
- Contextual:
- 0x8000 mark current glyph
- 0x4000 don't advance to next glyph
- Insert:
- 0x8000 mark current glyph
- 0x4000 don't advance to next glyph
- 0x2000 current is Kashida like
- 0x1000 mark is Kashida like
- 0x0800 current insert before
- 0x0400 mark insert before
- 0x03e0 count of chars to be inserted at current (31 max)
- 0x001f count of chars to be inserted at mark (31 max)
- Kern:
- 0x8000 add current glyph to kerning stack
- 0x4000 don't advance to next glyph
- 0x3fff value offset
-*/
-
struct opentype_str {
struct splinechar *sc;
struct vr vr; /* Scaled and rounded gpos modifications (device table info included in xoff, etc. not in adjusts) */
@@ -680,13 +603,6 @@ struct opentype_str {
int16 bsln_off;
};
-struct macname {
- struct macname *next;
- uint16 enc; /* Platform specific encoding. 0=>mac roman, 1=>sjis, 7=>russian */
- uint16 lang; /* Mac languages 0=>english, 1=>french, 2=>german */
- char *name; /* Not a unicode string, uninterpreted mac encoded string */
-};
-
/* Wow, the GPOS 'size' feature stores a string in the name table just as mac */
/* features do */
struct otfname {
@@ -695,22 +611,6 @@ struct otfname {
char *name; /* utf8 */
};
-typedef struct macfeat {
- struct macfeat *next;
- uint16 feature;
- uint8 ismutex;
- uint8 default_setting; /* Apple's docs say both that this is a byte and a short. It's a byte */
- uint16 strid; /* Temporary value, used when reading in */
- struct macname *featname;
- struct macsetting {
- struct macsetting *next;
- uint16 setting;
- uint16 strid;
- struct macname *setname;
- unsigned int initially_enabled: 1;
- } *settings;
-} MacFeat;
-
typedef struct undoes {
struct undoes *next;
enum undotype { ut_none=0, ut_state, ut_tstate, ut_statehint, ut_statename,
@@ -1236,7 +1136,6 @@ typedef struct splinechar {
/* Or an otf font where it is the subr number of a refered character */
/* or a ttf font without bit 1 of head.flags set */
/* or (once upon a time, but no longer) a ttf font with vert metrics where it is the ymax value when we had a font-wide vertical offset */
- /* or when generating morx where it is the mask of tables in which the glyph occurs */
/* Always a temporary value */
int ttf_glyph; /* only used when writing out a ttf or otf font */
Layer *layers; /* layer[0] is background, layer[1] foreground */
@@ -1707,12 +1606,9 @@ typedef struct splinefont {
int32 params[22]; /* param[6] has different meanings in normal and math fonts */
} texdata;
OTLookup *gsub_lookups, *gpos_lookups;
- /* Apple morx subtables become gsub, and kern subtables become gpos */
AnchorClass *anchor;
KernClass *kerns, *vkerns;
FPST *possub;
- ASM *sm; /* asm is a keyword */
- MacFeat *features;
char *chosenname; /* Set for files with multiple fonts in them */
struct mmset *mm; /* If part of a multiple master set */
int16 macstyle;
@@ -1767,7 +1663,6 @@ typedef struct splinefont {
/* to bother the user with specifying it. */
/* (NormalizeDesignVector is fairly basic and shouldn't need user help ever) */
/* (As long as they want piecewise linear) */
-/* I'm not going to support intermediate designs at all for apple var tables */
typedef struct mmset {
int axis_count;
char *axes[4];
@@ -1776,22 +1671,14 @@ typedef struct mmset {
SplineFont *normal;
real *positions; /* array[instance][axis] saying where each instance lies on each axis */
real *defweights; /* array[instance] saying how much of each instance makes the normal font */
- /* for adobe */
struct axismap {
int points; /* size of the next two arrays */
real *blends; /* between [0,1] ordered so that blend[0]<blend[1]<... */
real *designs; /* between the design ranges for this axis, typically [1,999] or [6,72] */
real min, def, max; /* For mac */
- struct macname *axisnames; /* For mac */
} *axismaps; /* array[axis] */
char *cdv, *ndv; /* for adobe */
- int named_instance_count;
- struct named_instance { /* For mac */
- real *coords; /* array[axis], these are in user units */
- struct macname *names;
- } *named_instances;
unsigned int changed: 1;
- unsigned int apple: 1;
} MMSet;
/* mac styles. Useful idea we'll just steal it */
@@ -2066,9 +1953,7 @@ extern struct gimage *ImageAlterClut(struct gimage *image);
extern void ImageListsFree(ImageList *imgs);
extern void TTFLangNamesFree(struct ttflangname *l);
extern void AltUniFree(struct altuni *altuni);
-extern void AltUniFigure(SplineFont *sf,EncMap *map);
extern void AltUniRemove(SplineChar *sc,int uni);
-extern void AltUniAdd(SplineChar *sc,int uni);
extern void MinimumDistancesFree(MinimumDistance *md);
extern void LayerDefault(Layer *);
extern SplineChar *SplineCharCreate(int layer_cnt);
@@ -2087,11 +1972,6 @@ extern FPST *FPSTCopy(FPST *fpst);
extern void FPSTRuleContentsFree(struct fpst_rule *r, enum fpossub_format format);
extern void FPSTRulesFree(struct fpst_rule *r, enum fpossub_format format, int rcnt);
extern void FPSTFree(FPST *fpst);
-extern void ASMFree(ASM *sm);
-extern struct macname *MacNameCopy(struct macname *mn);
-extern void MacNameListFree(struct macname *mn);
-extern void MacSettingListFree(struct macsetting *ms);
-extern void MacFeatListFree(MacFeat *mf);
extern void GlyphVariantsFree(struct glyphvariants *gv);
extern void MathKernVContentsFree(struct mathkernvertex *mk);
extern void MathKernFree(struct mathkern *mk);
@@ -2498,8 +2378,6 @@ extern const char *EncName(Encoding *encname);
extern const char*FindUnicharName(void);
extern Encoding *_FindOrMakeEncoding(const char *name,int make_it);
extern Encoding *FindOrMakeEncoding(const char *name);
-extern void SFDDumpMacFeat(FILE *sfd,MacFeat *mf);
-extern MacFeat *SFDParseMacFeatures(FILE *sfd, char *tok);
extern int SFDWrite(char *filename,SplineFont *sf,EncMap *map,EncMap *normal, int todir);
extern int SFDWriteBak(SplineFont *sf,EncMap *map,EncMap *normal);
extern SplineFont *SFDRead(char *filename);
@@ -2732,11 +2610,6 @@ int SFFigureDefWidth(SplineFont *sf, int *_nomwid);
extern int SFRenameTheseFeatureTags(SplineFont *sf, uint32 tag, int sli, int flags,
uint32 totag, int tosli, int toflags, int ismac);
extern int SFRemoveUnusedNestedFeatures(SplineFont *sf);
-extern int ClassesMatch(int cnt1,char **classes1,int cnt2,char **classes2);
-extern FPST *FPSTGlyphToClass(FPST *fpst);
-
-extern ASM *ASMFromOpenTypeForms(SplineFont *sf,uint32 script);
-extern ASM *ASMFromFPST(SplineFont *sf,FPST *fpst,int ordered);
extern char *utf8_verify_copy(const char *str);
@@ -2749,11 +2622,6 @@ extern int CanEncodingWinLangAsMac(int winlang);
extern const int32 *MacEncToUnicode(int script,int lang);
extern int MacLangFromLocale(void);
extern char *MacLanguageFromCode(int code);
-extern char *FindEnglishNameInMacName(struct macname *mn);
-extern char *PickNameFromMacName(struct macname *mn);
-extern MacFeat *FindMacFeature(SplineFont *sf, int feat,MacFeat **secondary);
-extern struct macsetting *FindMacSetting(SplineFont *sf, int feat, int set,struct macsetting **secondary);
-extern struct macname *FindMacSettingName(SplineFont *sf, int feat, int set);
extern int32 UniFromEnc(int enc, Encoding *encname);
extern int32 EncFromUni(int32 uni, Encoding *encname);
@@ -2840,7 +2708,7 @@ extern int RefDepth(RefChar *ref,int layer);
extern SplineChar *SCHasSubs(SplineChar *sc,uint32 tag);
-extern char *TagFullName(SplineFont *sf,uint32 tag, int ismac, int onlyifknown);
+extern char *TagFullName(SplineFont *sf,uint32 tag, int onlyifknown);
extern uint32 *SFScriptsInLookups(SplineFont *sf,int gpos);
extern uint32 *SFLangsInScript(SplineFont *sf,int gpos,uint32 script);
@@ -2888,7 +2756,6 @@ extern void OTLookupsCopyInto(SplineFont *into_sf,SplineFont *from_sf,
extern struct opentype_str *ApplyTickedFeatures(SplineFont *sf,uint32 *flist, uint32 script, uint32 lang,
int pixelsize, SplineChar **glyphs);
extern int VerticalKernFeature(SplineFont *sf, OTLookup *otl, int ask);
-extern void SFGlyphRenameFixup(SplineFont *sf, char *old, char *new);
struct sllk { uint32 script; int cnt, max; OTLookup **lookups; int lcnt, lmax; uint32 *langs; };
extern void SllkFree(struct sllk *sllk,int sllk_cnt);
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineoverlap.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineoverlap.c
index 1b459508f2a..7e9bb76e17e 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineoverlap.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineoverlap.c
@@ -33,8 +33,6 @@
#endif
#include <stdarg.h>
-#include <gwidget.h> /* For PostNotice */
-
/* First thing we do is divide each spline into a set of sub-splines each of */
/* which is monotonic in both x and y (always increasing or decreasing) */
/* Then we compare each monotonic spline with every other one and see if they*/
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesave.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesave.c
index 68345708ad1..75f95103858 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesave.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesave.c
@@ -32,7 +32,6 @@
#include <ustring.h>
#include <string.h>
#include <utype.h>
-#include <gwidget.h>
int autohint_before_generate = 1;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinestroke.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinestroke.c
index ad73a9194c6..6d9e7fc86c3 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinestroke.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinestroke.c
@@ -27,7 +27,6 @@
#include "pfaedit.h"
#include "splinefont.h"
#include <math.h>
-#include <gwidget.h>
#define PI 3.1415926535897932
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
index 195c1f0536f..a3eb2203bf1 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
@@ -29,7 +29,6 @@
#include "psfont.h"
#include "ustring.h"
#include "utype.h"
-#include "views.h" /* for FindSel structure */
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h> /* Solaris defines isnan in ieeefp rather than math.h */
#endif
@@ -1915,7 +1914,6 @@ static void _SplineFontFromType1(SplineFont *sf, FontDict *fd, struct pscontext
/* formality, it acutally contains a skew. So be ready */
if ( fd->fontmatrix[0]!=0 )
TransByFontMatrix(sf,fd->fontmatrix);
- AltUniFigure(sf,sf->map);
}
static void SplineFontFromType1(SplineFont *sf, FontDict *fd, struct pscontext *pscontext) {
@@ -4095,10 +4093,10 @@ return( new );
void KernClassFreeContents(KernClass *kc) {
int i;
-
- for ( i=1; i<kc->first_cnt; ++i )
+ /* Issue 863 */
+ for ( i=0; i<kc->first_cnt; ++i )
free(kc->firsts[i]);
- for ( i=1; i<kc->second_cnt; ++i )
+ for ( i=0; i<kc->second_cnt; ++i )
free(kc->seconds[i]);
free(kc->firsts);
free(kc->seconds);
@@ -4116,65 +4114,6 @@ void KernClassListFree(KernClass *kc) {
}
}
-void MacNameListFree(struct macname *mn) {
- struct macname *next;
-
- while ( mn!=NULL ) {
- next = mn->next;
- free(mn->name);
- chunkfree(mn,sizeof(struct macname));
- mn = next;
- }
-}
-
-void MacSettingListFree(struct macsetting *ms) {
- struct macsetting *next;
-
- while ( ms!=NULL ) {
- next = ms->next;
- MacNameListFree(ms->setname);
- chunkfree(ms,sizeof(struct macsetting));
- ms = next;
- }
-}
-
-void MacFeatListFree(MacFeat *mf) {
- MacFeat *next;
-
- while ( mf!=NULL ) {
- next = mf->next;
- MacNameListFree(mf->featname);
- MacSettingListFree(mf->settings);
- chunkfree(mf,sizeof(MacFeat));
- mf = next;
- }
-}
-
-void ASMFree(ASM *sm) {
- ASM *next;
- int i;
-
- while ( sm!=NULL ) {
- next = sm->next;
- if ( sm->type==asm_insert ) {
- for ( i=0; i<sm->class_cnt*sm->state_cnt; ++i ) {
- free( sm->state[i].u.insert.mark_ins );
- free( sm->state[i].u.insert.cur_ins );
- }
- } else if ( sm->type==asm_kern ) {
- for ( i=0; i<sm->class_cnt*sm->state_cnt; ++i ) {
- free( sm->state[i].u.kern.kerns );
- }
- }
- for ( i=4; i<sm->class_cnt; ++i )
- free(sm->classes[i]);
- free(sm->state);
- free(sm->classes);
- chunkfree(sm,sizeof(ASM));
- sm = next;
- }
-}
-
void OtfNameListFree(struct otfname *on) {
struct otfname *on_next;
@@ -4342,7 +4281,6 @@ return;
free(sf->xuid);
free(sf->cidregistry);
free(sf->ordering);
- MacFeatListFree(sf->features);
/* We don't free the EncMap. That field is only a temporary pointer. Let the FontViewBase free it, that's where it really lives */
SplinePointListsFree(sf->grid.splines);
AnchorClassesFree(sf->anchor);
@@ -4361,7 +4299,6 @@ return;
KernClassListFree(sf->kerns);
KernClassListFree(sf->vkerns);
FPSTFree(sf->possub);
- ASMFree(sf->sm);
OtfNameListFree(sf->fontstyle_name);
MarkClassFree(sf->mark_class_cnt,sf->mark_classes,sf->mark_class_names);
free( sf->gasp );
@@ -4372,6 +4309,10 @@ return;
#endif
BaseFree(sf->horiz_base);
BaseFree(sf->vert_base);
+ /* issue 863 */
+ for ( i=0; i < sf->layer_cnt; ++i )
+ free (sf->layers[i].name);
+ free(sf->layers);
free(sf);
}
@@ -4387,16 +4328,10 @@ void MMSetFreeContents(MMSet *mm) {
free(mm->axes[i]);
free(mm->axismaps[i].blends);
free(mm->axismaps[i].designs);
- MacNameListFree(mm->axismaps[i].axisnames);
}
free(mm->axismaps);
free(mm->cdv);
free(mm->ndv);
- for ( i=0; i<mm->named_instance_count; ++i ) {
- free(mm->named_instances[i].coords);
- MacNameListFree(mm->named_instances[i].names);
- }
- free(mm->named_instances);
}
void MMSetFree(MMSet *mm) {
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil2.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil2.c
index ce80d837f87..8de073da4ce 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil2.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil2.c
@@ -31,7 +31,6 @@
#include <unistd.h>
#include <time.h>
#include <stdlib.h>
-#include "views.h" /* For SCCharChangedUpdate */
int new_em_size = 1000;
int new_fonts_are_order2 = false;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottf.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottf.c
index 0a89f32fa0e..89a0da5860b 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottf.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottf.c
@@ -32,7 +32,6 @@
#include <utype.h>
#include <ustring.h>
#include <chardata.h>
-#include <gwidget.h>
#ifdef __CygWin
#include <sys/types.h>
@@ -69,25 +68,12 @@ Required for bitmaps
bhed for apple bitmap only fonts, replaces head
Optional for bitmaps
EBSC bitmap scaling table (used in windows "bitmap-only" fonts)
-"Advanced Typograpy"
- Apple
- feat (mapping between morx features and 'name' names)
- kern (if data are present)
- lcar (ligature caret, if data present)
- morx (substitutions, if data present)
- prop (glyph properties, if data present)
- opbd (optical bounds, if data present)
- OpenType
+OpenType
GPOS (opentype, if kern,anchor data are present)
GSUB (opentype, if ligature (other subs) data are present)
GDEF (opentype, if anchor data are present)
MATH
MATH (MS proposal, if math data present)
-Apple variation tables (for distortable (multiple master type) fonts)
- fvar (font variations)
- gvar (glyph variations)
- cvar (cvt variations)
- avar (axis variations)
additional tables
cvt for hinting
gasp to control when things should be hinted
@@ -1887,9 +1873,6 @@ return( latin1_2_utf8_copy(str));
int SFHasInstructions(SplineFont *sf) {
int i;
- if ( sf->mm!=NULL && sf->mm->apple )
- sf = sf->mm->normal;
-
if ( sf->subfontcnt!=0 )
return( false ); /* Truetype doesn't support cid keyed fonts */
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfaat.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfaat.c
deleted file mode 100644
index 559867543f2..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfaat.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Copyright (C) 2000-2008 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaedit.h"
-#include <utype.h>
-
-#include "ttf.h"
-
-/* This file contains routines to create some of the Apple Advanced Typography Tables */
-/* (or GX fonts) */
-
-/* ************************************************************************** */
-/* ************************* The 'morx' table ************************* */
-/* ************************* (and 'feat') ************************* */
-/* ************************************************************************** */
-
-/* Each lookup gets its own subtable, so there may be multiple subtables */
-/* with the same feature/setting. The subtables will be ordered the same */
-/* way the lookups are, which might lead to awkwardness if there are many */
-/* chains and the same feature occurs in several of them */
-/* (only the default language will be used) */
-struct feature {
- int16 featureType, featureSetting;
- MacFeat *mf, *smf;
- struct macsetting *ms, *sms;
- unsigned int vertOnly: 1;
- unsigned int r2l: 1; /* I think this is the "descending" flag */
- unsigned int needsOff: 1;
- unsigned int singleMutex: 1;
- unsigned int dummyOff: 1;
- uint8 subtable_type;
- int chain;
- int32 flag, offFlags;
- uint32 feature_start;
- uint32 feature_len; /* Does not include header yet */
- struct feature *next; /* features in output order */
- struct feature *nexttype; /* features in feature/setting order */
- struct feature *nextsame; /* all features with the same feature/setting */
- int setting_cnt, setting_index, real_index;
-};
-
-
-
-struct transition { uint16 next_state, dontconsume, ismark, trans_ent; LigList *l; };
-struct trans_entries { uint16 next_state, flags, act_index; LigList *l; };
-
-
-int Macable(SplineFont *sf, OTLookup *otl) {
- int ft, fs;
- FeatureScriptLangList *features;
-
- switch ( otl->lookup_type ) {
- /* These lookup types are mac only */
- case kern_statemachine: case morx_indic: case morx_context: case morx_insert:
-return( true );
- /* These lookup types or OpenType only */
- case gsub_multiple: case gsub_alternate:
- case gpos_single: case gpos_cursive: case gpos_mark2base:
- case gpos_mark2ligature: case gpos_mark2mark:
-return( false );
- /* These are OpenType only, but they might be convertable to a state */
- /* machine */
- case gsub_context:
- case gsub_contextchain: case gsub_reversecchain:
- case gpos_context: case gpos_contextchain:
- if ( sf==NULL || sf->sm!=NULL )
-return( false );
- /* Else fall through into the test on the feature tag */;
- /* These two can be expressed in both, and might be either */
- case gsub_single: case gsub_ligature: case gpos_pair:
- for ( features = otl->features; features!=NULL; features = features->next ) {
- if ( features->ismac || OTTagToMacFeature(features->featuretag,&ft,&fs))
-return( true );
- }
- default: /* handle this to silence compiler warnings */
- break;
- }
-return( false );
-}
-
-
-/* ************************************************************************** */
-/* ************************* utility routines ************************* */
-/* ************************************************************************** */
-
-uint32 MacFeatureToOTTag(int featureType,int featureSetting) {
- int i;
- struct macsettingname *msn = user_macfeat_otftag ? user_macfeat_otftag : macfeat_otftag;
-
- for ( i=0; msn[i].otf_tag!=0; ++i )
- if ( msn[i].mac_feature_type == featureType &&
- msn[i].mac_feature_setting == featureSetting )
-return( msn[i].otf_tag );
-
-return( 0 );
-}
-
-int OTTagToMacFeature(uint32 tag, int *featureType,int *featureSetting) {
- int i;
- struct macsettingname *msn = user_macfeat_otftag ? user_macfeat_otftag : macfeat_otftag;
-
- for ( i=0; msn[i].otf_tag!=0; ++i )
- if ( msn[i].otf_tag == tag ) {
- *featureType = msn[i].mac_feature_type;
- *featureSetting = msn[i].mac_feature_setting;
-return( true );
- }
-
- *featureType = 0;
- *featureSetting = 0;
-return( false );
-}
-
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttf.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttf.h
index 0827658bf92..ab2ddac803d 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttf.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttf.h
@@ -37,31 +37,6 @@ struct dup {
struct dup *prev;
};
-struct variations {
- int axis_count;
- struct taxis {
- uint32 tag;
- real min, def, max; /* in user design space */
- int nameid;
- int paircount;
- real *mapfrom; /* after conversion from [-1,1] */
- real *mapto; /* secondary conversiont to [-1,1] */
- } *axes; /* Array of axis_count entries */
- int instance_count; /* Not master designs, but named interpolations in design space */
- struct tinstance {
- int nameid;
- real *coords; /* Location along axes array[axis_count] */
- } *instances;
- int tuple_count;
- struct tuples {
- real *coords; /* Location along axes array[axis_count] */
- SplineChar **chars; /* Varied glyphs, array parallels one in info */
- struct ttf_table *cvt;
- KernClass *khead, *klast, *vkhead, *vklast;
- /* Varied kern classes */
- } *tuples;
-};
-
struct ttfinfo {
int emsize; /* ascent + descent? from the head table */
int ascent, descent; /* from the hhea table */
@@ -153,11 +128,6 @@ struct ttfinfo {
/* EBLT, bloc */
uint32 bitmaploc_start; /* Offset to start of bitmap locator data */
uint32 bitmaploc_length;
- /* gvar, etc. */
- uint32 gvar_start, gvar_len;
- uint32 fvar_start, fvar_len;
- uint32 avar_start, avar_len;
- uint32 cvar_start, cvar_len;
/* head */
uint32 head_start;
/* hhea */
@@ -197,16 +167,6 @@ struct ttfinfo {
/* FFTM -- FontForge timestamps */
uint32 fftm_start;
- /* Apple Advanced Typography Tables */
- uint32 prop_start;
- uint32 lcar_start;
- uint32 opbd_start;
- uint32 acnt_start;
- uint32 feat_start;
- uint32 mort_start;
- uint32 morx_start;
- uint32 bsln_start;
-
/* MATH Table */
uint32 math_start;
uint32 math_length;
@@ -235,27 +195,12 @@ struct ttfinfo {
OTLookup *gpos_lookups, *gsub_lookups, *cur_lookups;
- OTLookup *mort_subs_lookup, *mort_pos_lookup2;
- int mort_r2l, mort_tag_mac, mort_feat, mort_setting, mort_is_nested;
- uint16 *morx_classes;
- uint16 *bsln_values;
-
- int mort_max;
-
struct ttf_table *tabs;
FPST *possub;
- ASM *sm;
- MacFeat *features;
char *chosenname;
int macstyle;
int lookup_cnt; /* Max lookup in current GPOS/GSUB table */
int feature_cnt; /* Max feature in current GPOS/GSUB table */
- struct variations *variations;
- struct macidname {
- int id;
- struct macname *head, *last;
- struct macidname *next;
- } *macstrids;
struct fontdict *fd; /* For reading in Type42 fonts. Glyph names in postscript section must be associated with glyphs in TTF section */
int savecnt;
struct savetab {
@@ -272,8 +217,6 @@ struct ttfinfo {
int mark_class_cnt;
char **mark_classes; /* glyph name list */
char **mark_class_names; /* used within ff (utf8) */
- uint8 warned_morx_out_of_bounds_glyph;
- int badgid_cnt, badgid_max; /* Used when parsing apple morx tables*/
SplineChar **badgids; /* which use out of range glyph IDs as temporary flags */
#ifdef _HAS_LONGLONG
long long creationtime; /* seconds since 1970 */
@@ -535,7 +478,6 @@ struct glyphinfo {
int flags;
int fixed_width;
int32 *bsizes;
- unsigned int dovariations: 1;
unsigned int onlybitmaps: 1;
unsigned int has_instrs: 1;
unsigned int is_ttf: 1;
@@ -624,34 +566,12 @@ struct alltabs {
int bloclen;
FILE *ebsc;
int ebsclen;
- FILE *prop;
- int proplen;
- FILE *opbd;
- int opbdlen;
- FILE *acnt;
- int acntlen;
- FILE *lcar;
- int lcarlen;
- FILE *feat;
- int featlen;
- FILE *morx;
- int morxlen;
- FILE *bsln;
- int bslnlen;
FILE *pfed;
int pfedlen;
FILE *tex;
int texlen;
FILE *bdf;
int bdflen;
- FILE *gvar;
- int gvarlen;
- FILE *fvar;
- int fvarlen;
- FILE *cvar;
- int cvarlen;
- FILE *avar;
- int avarlen;
FILE *fftmf;
int fftmlen;
FILE *dsigf;
@@ -671,17 +591,12 @@ struct alltabs {
unsigned int applebitmaps: 1;
unsigned int otbbitmaps: 1;
unsigned int isotf: 1;
- unsigned int dovariations: 1; /* Output Apple *var tables (for mm fonts) */
unsigned int error: 1;
struct glyphinfo gi;
int isfixed;
struct fd2data *fds;
int next_strid;
- struct feat_name { int strid; struct macname *mn, *smn; } *feat_name;
- struct other_names { int strid; struct macname *mn; struct other_names *next; } *other_names;
- struct macname2 *ordered_feat;
-
int next_lookup; /* for doing nested lookups in contextual features */
short *gn_sid;
enum fontformat format;
@@ -748,46 +663,14 @@ extern void otf_dumpbase(struct alltabs *at, SplineFont *sf);
extern void otf_dump_dummydsig(struct alltabs *at, SplineFont *sf);
extern int gdefclass(SplineChar *sc);
- /* Apple Advanced Typography Tables */
-extern void aat_dumpacnt(struct alltabs *at, SplineFont *sf);
extern void ttf_dumpkerns(struct alltabs *at, SplineFont *sf);
-extern void aat_dumplcar(struct alltabs *at, SplineFont *sf);
-extern void aat_dumpmorx(struct alltabs *at, SplineFont *sf);
-extern void aat_dumpopbd(struct alltabs *at, SplineFont *sf);
-extern void aat_dumpprop(struct alltabs *at, SplineFont *sf);
-extern void aat_dumpbsln(struct alltabs *at, SplineFont *sf);
-extern int LookupHasDefault(OTLookup *otl);
-extern int scriptsHaveDefault(struct scriptlanglist *sl);
-extern int FPSTisMacable(SplineFont *sf, FPST *fpst);
-extern uint32 MacFeatureToOTTag(int featureType,int featureSetting);
-extern int OTTagToMacFeature(uint32 tag, int *featureType,int *featureSetting);
-extern uint16 *props_array(SplineFont *sf,struct glyphinfo *gi);
-extern int haslrbounds(SplineChar *sc, PST **left, PST **right);
-extern int16 *PerGlyphDefBaseline(SplineFont *sf,int *def_baseline);
-extern void FigureBaseOffsets(SplineFont *sf,int def_bsln,int offsets[32]);
-
- /* Apple variation tables */
-extern int ContourPtNumMatch(MMSet *mm, int gid);
-extern int16 **SCFindDeltas(MMSet *mm, int gid, int *_ptcnt);
-extern int16 **CvtFindDeltas(MMSet *mm, int *_ptcnt);
-extern void ttf_dumpvariations(struct alltabs *at, SplineFont *sf);
-
-extern struct macsettingname {
- int mac_feature_type;
- int mac_feature_setting;
- uint32 otf_tag;
-} macfeat_otftag[], *user_macfeat_otftag;
/* TrueType instructions */
extern struct ttf_table *SFFindTable(SplineFont *sf,uint32 tag);
-extern int32 memlong(uint8 *data,int table_len, int offset);
-extern int memushort(uint8 *data,int table_len, int offset);
-extern void memputshort(uint8 *data,int offset,uint16 val);
extern int TTF__getcvtval(SplineFont *sf,int val);
extern int TTF_getcvtval(SplineFont *sf,int val);
extern void SCinitforinstrs(SplineChar *sc);
extern int SSAddPoints(SplineSet *ss,int ptcnt,BasePoint *bp, char *flags);
-extern int Macable(SplineFont *sf, OTLookup *otl);
/* Used by both otf and apple */
extern int LigCaretCnt(SplineChar *sc);
@@ -831,22 +714,13 @@ extern void otf_read_math_used(FILE *ttf,struct ttfinfo *info);
extern void GuessNamesFromMATH(FILE *ttf,struct ttfinfo *info);
/* Parsing advanced typography */
-extern void readmacfeaturemap(FILE *ttf,struct ttfinfo *info);
extern void readttfkerns(FILE *ttf,struct ttfinfo *info);
-extern void readttfmort(FILE *ttf,struct ttfinfo *info);
-extern void readttfopbd(FILE *ttf,struct ttfinfo *info);
-extern void readttflcar(FILE *ttf,struct ttfinfo *info);
-extern void readttfprop(FILE *ttf,struct ttfinfo *info);
-extern void readttfbsln(FILE *ttf,struct ttfinfo *info);
extern void readttfgsubUsed(FILE *ttf,struct ttfinfo *info);
extern void GuessNamesFromGSUB(FILE *ttf,struct ttfinfo *info);
extern void readttfgpossub(FILE *ttf,struct ttfinfo *info,int gpos);
extern void readttfgdef(FILE *ttf,struct ttfinfo *info);
extern void readttfbase(FILE *ttf,struct ttfinfo *info);
-extern void VariationFree(struct ttfinfo *info);
-extern void readttfvariations(struct ttfinfo *info, FILE *ttf);
-
extern struct otfname *FindAllLangEntries(FILE *ttf, struct ttfinfo *info, int id );
/* Known font parameters for 'TeX ' table (fontdims, spacing params, whatever you want to call them) */
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/views.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/views.h
deleted file mode 100644
index a3a02cb6314..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/views.h
+++ /dev/null
@@ -1,1087 +0,0 @@
-/* Copyright (C) 2000-2008 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef _VIEWS_H
-#define _VIEWS_H
-
-#include "baseviews.h"
-
-#include <ggadget.h>
-
-struct gfi_data;
-struct contextchaindlg;
-struct statemachinedlg;
-
-extern struct cvshows {
- int showfore, showback, showgrids, showhhints, showvhints, showdhints;
- int showpoints, showfilled;
- int showrulers;
- int showrounds; /* 0=>no, 1=>auto, 2=>always */
- int showmdx, showmdy; /* minimum distances x,y */
- int showhmetrics, showvmetrics; /* show advance width, baseline, etc. */
- int markextrema;
- int markpoi; /* Points of inflection */
- int showblues, showfamilyblues;
- int showanchor;
- int showcpinfo;
- int showtabs; /* with the names of former glyphs */
- int showsidebearings;
- int showrefnames;
- int snapoutlines;
- int showalmosthvlines;
- int showalmosthvcurves;
- int hvoffset;
-} CVShows;
-
-extern struct bvshows {
- int showfore, showoutline, showgrid;
- int lastpixelsize;
-} BVShows;
-
-enum debug_wins { dw_registers=0x1, dw_stack=0x2, dw_storage=0x4, dw_points=0x8,
- dw_cvt=0x10, dw_raster=0x20, dw_gloss=0x40 };
-
-struct instrinfo {
- int isel_pos;
- int16 lheight,lpos;
- char *scroll, *offset;
- GWindow v;
- GGadget *vsb;
- int16 sbw;
- int16 vheight, vwidth;
- int16 lstopped;
- int16 as, fh;
- struct instrdata *instrdata;
- GFont *gfont;
- unsigned int showaddr: 1;
- unsigned int showhex: 1;
- unsigned int mousedown: 1;
- void *userdata;
- void (*selection_callback)(struct instrinfo *,int ip);
- int (*bpcheck)(struct instrinfo *,int ip);
- int (*handle_char)(struct instrinfo *,GEvent *e);
-};
-
-typedef struct debugview {
- struct debugger_context *dc; /* Local to freetype.c */
- GWindow dv, v;
- /* Windows for twilight points, cvt, registers, stack, storage, stack gloss */
- GWindow regs, stack, storage, points, cvt, raster, gloss; /* order matters */
- GWindow points_v;
- GGadget *cvtsb;
- GGadget *pts_vsb;
- GGadget *glosssb;
- GGadget *storagesb;
- GGadget *regsb;
- GGadget *stacksb;
- struct instrdata id;
- struct instrinfo ii;
- int dwidth, toph;
- struct charview *cv;
- double scalex, scaley;
- int pts_head, cvt_offtop, gloss_offtop, storage_offtop, stack_offtop, reg_offtop;
- int points_offtop;
-
- int codeSize;
- uint8 initialbytes[4];
- struct reflist { RefChar *ref; struct reflist *parent; } *active_refs;
- int last_npoints;
- int layer;
-} DebugView;
-
-enum dv_coderange { cr_none=0, cr_fpgm, cr_prep, cr_glyph }; /* cleverly chosen to match ttobjs.h */
-
-typedef struct charview {
- CharViewBase b;
- uint32 showback[BACK_LAYER_MAX/32];
- unsigned int showfore:1;
- unsigned int showgrids:1;
- unsigned int showhhints:1;
- unsigned int showvhints:1;
- unsigned int showdhints:1;
- unsigned int showpoints:1;
- unsigned int showfilled:1;
- unsigned int showrulers:1;
- unsigned int showrounds:2; /* 0=>no, 1=>auto, 2=>always */
- unsigned int showmdx:1;
- unsigned int showmdy:1;
- unsigned int showhmetrics:1;
- unsigned int showvmetrics:1;
- unsigned int showblues:1; /* 16 */
- unsigned int showfamilyblues:1;
- unsigned int showanchor:1;
- unsigned int showpointnumbers:1;
- unsigned int markextrema:1;
- unsigned int markpoi:1;
- unsigned int needsrasterize:1; /* Rasterization (of fill or fontview) needed on mouse up */
- unsigned int recentchange:1; /* a change happened in the grids or background. don't need to rasterize */
- unsigned int info_within: 1; /* cursor is within main window */
- unsigned int back_img_out_of_date: 1; /* Force redraw of back image pixmap */
- unsigned int cntrldown:1;
- unsigned int joinvalid:1;
- unsigned int widthsel:1;
- unsigned int vwidthsel:1;
- unsigned int icsel:1;
- unsigned int tah_sel:1;
- unsigned int inactive:1; /* When in a search view */
- unsigned int show_ft_results: 1; /* 32 */
- unsigned int coderange: 2; /* For the debugger */
- unsigned int autonomous_ruler_w: 1;
- unsigned int showcpinfo: 1;
- unsigned int showtabs: 1;
- unsigned int showsidebearings: 1;
- unsigned int showing_spiro_pt_menu: 1;
- unsigned int ruler_pressed: 1;
- unsigned int ruler_pressedv: 1;
- unsigned int showrefnames: 1;
- unsigned int snapoutlines: 1;
- unsigned int showalmosthvlines: 1;
- unsigned int showalmosthvcurves: 1;
- int hvoffset; /* for showalmosthvlines */
- int layers_off_top;
- real scale;
- GWindow gw, v;
- GGadget *vsb, *hsb, *mb, *tabs;
- GFont *small, *normal;
- GWindow icon;
- GWindow ruler_w;
- GFont *rfont;
- GTimer *pressed;
- GWindow backimgs;
- GIC *gic;
- GIC *gwgic;
- int width, height;
- int xoff, yoff;
- int mbh, infoh, rulerh;
- int16 sas, sfh, sdh, nas, nfh;
- BasePoint info;
- SplinePoint *info_sp;
- Spline *info_spline;
- real info_t;
- GPoint e; /* mouse location */
- GPoint olde;
- BasePoint last_c;
- BDFChar *filled;
- GImage gi; /* used for fill bitmap only */
- int enc;
- EncMap *map_of_enc; /* Only use for comparison against fontview's map to see if our enc be valid */
- /* Will not be updated when fontview is reencoded */
- SplinePoint *lastselpt;
- /*GWindow tools, layers;*/
- int8 b1_tool, cb1_tool, b2_tool, cb2_tool; /* Button 3 does a popup */
- int8 s1_tool, s2_tool, er_tool; /* Bindings for wacom stylus and eraser */
- int8 showing_tool, pressed_tool, pressed_display, had_control, active_tool;
- SplinePointList *active_spl;
- SplinePoint *active_sp;
- IPoint handscroll_base;
- uint16 rfh, ras;
- BasePoint lastknife;
- struct freehand {
- struct tracedata *head, *last; /* for the freehand tool */
- SplinePointList *current_trace;
- int ignore_wobble; /* Ignore wiggles smaller than this */
- int skip_cnt;
- } freehand;
- enum expandedge { ee_none, ee_nw, ee_up, ee_ne, ee_right, ee_se, ee_down,
- ee_sw, ee_left, ee_max } expandedge;
- BasePoint expandorigin;
- real expandwidth, expandheight;
- SplinePointList *active_shape;
- SplinePoint joinpos;
- SplineChar *template1, *template2;
-#if HANYANG
- struct jamodisplay *jamodisplay;
-#endif
- real oldwidth, oldvwidth;
- int16 oldic, oldtah;
-#if _ModKeysAutoRepeat
- GTimer *autorpt;
- int keysym, oldstate;
- int oldkeyx, oldkeyy;
- GWindow oldkeyw;
-#endif
- PST *lcarets;
- int16 nearcaret;
- /* freetype results display */
- int16 ft_dpi, ft_ppemy, ft_ppemx, ft_depth;
- real ft_pointsizey, ft_pointsizex;
- struct freetype_raster *raster, *oldraster;
- DebugView *dv;
- uint32 mmvisible;
- char *former_names[FORMER_MAX];
- int former_cnt;
- AnchorPoint *apmine, *apmatch;
- SplineChar *apsc;
- int guide_pos;
-} CharView;
-
-typedef struct bitmapview {
- BDFChar *bc;
- BDFFont *bdf;
- struct fontview *fv;
- EncMap *map_of_enc;
- int enc;
- GWindow gw, v;
- GGadget *vsb, *hsb, *mb;
- GGadget *recalc;
- GFont *small;
- int xoff, yoff;
- int width, height;
- int infoh, mbh;
- int scale;
- real scscale;
- struct bitmapview *next;
- unsigned int showfore:1;
- unsigned int showoutline:1;
- unsigned int showgrid:1;
- unsigned int cntrldown:1;
- unsigned int recentchange:1;
- unsigned int clearing:1;
- unsigned int shades_hidden:1;
- unsigned int shades_down:1;
- /*GWindow tools, layers;*/
- int8 b1_tool, cb1_tool, b2_tool, cb2_tool; /* Button 3 does a popup */
- int8 s1_tool, s2_tool, er_tool; /* Bindings for wacom stylus and eraser */
- int8 showing_tool, pressed_tool, pressed_display, had_control, active_tool;
- int pressed_x, pressed_y;
- int info_x, info_y;
- int event_x, event_y;
- int16 sas, sfh;
-#if _ModKeysAutoRepeat
- GTimer *autorpt;
- int keysym, oldstate;
-#endif
- int color; /* for greyscale fonts (between 0,255) */
- int color_under_cursor;
-} BitmapView;
-
-struct aplist { AnchorPoint *ap; int connected_to, selected; struct aplist *next; };
-
-enum mv_grids { mv_hidegrid, mv_showgrid, mv_partialgrid, mv_hidemovinggrid };
-enum mv_type { mv_kernonly, mv_widthonly, mv_kernwidth };
-typedef struct metricsview {
- struct fontview *fv;
- SplineFont *sf;
- int pixelsize;
- BDFFont *bdf; /* We can also see metric info on a bitmap font */
- BDFFont *show; /* Or the rasterized version of the outline font */
- GWindow gw, v;
- GFont *font;
- GGadget *hsb, *vsb, *mb, *text, *script, *features, *subtable_list;
- GGadget *namelab, *widthlab, *lbearinglab, *rbearinglab, *kernlab;
- int16 xstart;
- int16 width, height, dwidth;
- int16 vwidth, vheight;
- int16 mbh,sbh;
- int16 topend; /* y value of the end of the region containing the text field */
- int16 displayend; /* y value of the end of the region showing filled characters */
- int16 fh, as;
- int16 cmax, clen;
- SplineChar **chars; /* Character input stream */
- struct opentype_str *glyphs;/* after going through the various gsub/gpos transformations */
- struct metricchar { /* One for each glyph above */
- int16 dx, dwidth; /* position and width of the displayed char */
- int16 dy, dheight; /* displayed info for vertical metrics */
- int xoff, yoff;
- int16 mx, mwidth; /* position and width of the text underneath */
- int16 kernafter;
- unsigned int selected: 1;
- GGadget *width, *lbearing, *rbearing, *kern, *name;
- } *perchar;
- SplineChar **sstr; /* Character input stream */
- int16 mwidth, mbase;
- int16 glyphcnt, max;
- int16 pressed_x, pressed_y;
- int16 activeoff;
- int xoff, coff, yoff;
- struct metricsview *next;
- unsigned int right_to_left: 1;
- unsigned int pressed: 1;
- unsigned int pressedwidth: 1;
- unsigned int pressedkern: 1;
- unsigned int showgrid: 2;
- unsigned int antialias: 1;
- unsigned int vertical: 1;
- unsigned int type: 2; /* enum mv_type */
- int xp, yp, ap_owner;
- BasePoint ap_start;
- int cursor;
- int scale_index;
- struct lookup_subtable *cur_subtable;
- GTextInfo *scriptlangs;
- int word_index;
- int layer;
- int fake_unicode_base;
- GIC *gwgic;
-} MetricsView;
-
-enum fv_metrics { fvm_baseline=1, fvm_origin=2, fvm_advanceat=4, fvm_advanceto=8 };
-typedef struct fontview {
- FontViewBase b;
- BDFFont *show, *filled;
- GWindow gw, v;
- GFont **fontset;
- GGadget *vsb, *mb;
- GTimer *pressed;
- GTimer *resize;
- GEvent resize_event;
- GIC *gic;
- GIC *gwgic;
- int width, height; /* of v */
- int16 infoh,mbh;
- int16 lab_height, lab_as;
- int16 colcnt, rowcnt; /* of display window */
- int32 rowoff, rowltot; /* Can be really big in full unicode */
- int16 cbw,cbh; /* width/height of a character box */
- int pressed_pos, end_pos;
- unsigned int antialias:1;
- unsigned int bbsized:1; /* displayed bitmap should be scaled by bounding box rather than emsize */
- unsigned int wasonlybitmaps:1;
- /*unsigned int refstate: 3;*/ /* 0x1 => paste orig of all non exist refs, 0x2=>don't, 0x3 => don't warn about non-exist refs with no source font */
- unsigned int touched: 1;
- unsigned int showhmetrics: 4;
- unsigned int showvmetrics: 4;
- unsigned int drag_and_drop: 1;
- unsigned int has_dd_no_cursor: 1;
- unsigned int any_dd_events_sent: 1;
- unsigned int resize_expected: 1;
- /* Some window managers do not honour my resize requests (if window is*/
- /* maximized for example), but we depend on the resize request to */
- /* fix up the window. We do get a configure notify, but the window */
- /* stays the same size, so kludge things */
- unsigned int glyphlabel: 2;
- int16 magnify;
- int16 user_requested_magnify;
- struct searchview *sv;
- SplineChar *sc_near_top;
- int sel_index;
- struct lookup_subtable *cur_subtable;
-} FontView;
-
-typedef struct findsel {
- GEvent *e;
- real fudge; /* One pixel fudge factor */
- real xl,xh, yl, yh; /* One pixel fudge factor */
- real c_xl,c_xh, c_yl, c_yh; /* fudge rectangle for control points, larger than above if alt is depressed */
- unsigned int select_controls: 1; /* notice control points */
- unsigned int seek_controls: 1; /* notice control points before base points */
- unsigned int all_controls: 1; /* notice control points even if the base points aren't selected (in truetype point numbering mode where all cps are visible) */
- real scale;
-} FindSel;
-
-typedef struct searchview {
- struct cvcontainer base;
- FontView dummy_fv;
- SplineFont dummy_sf;
- LayerInfo layerinfo[2];
- SplineChar *chars[2];
- EncMap dummy_map;
- int32 map[2], backmap[2];
- uint8 sel[2];
- CharView cv_srch, cv_rpl;
- CharView *lastcv;
-/* ****** */
- GWindow gw;
- GGadget *mb;
- GFont *plain, *bold;
- int mbh;
- int fh, as;
- int rpl_x, cv_y;
- int cv_width, cv_height;
- short button_height, button_width;
-/* ****** */
- SearchData sd;
- unsigned int showsfindnext: 1;
- unsigned int findenabled: 1;
- unsigned int rplallenabled: 1;
- unsigned int rplenabled: 1;
- unsigned int isvisible: 1;
-} SearchView;
-
-typedef struct mathkernview {
- struct cvcontainer base;
- FontView dummy_fv;
- SplineFont dummy_sf;
- LayerInfo layerinfo[2];
- SplineChar sc_topright, sc_topleft, sc_bottomright, sc_bottomleft;
- SplineChar *chars[4];
- EncMap dummy_map;
- int32 map[4], backmap[4];
- uint8 sel[4];
- CharView cv_topright, cv_topleft, cv_bottomright, cv_bottomleft;
- CharView *lastcv;
-/* ****** */
- GWindow gw;
- GWindow cvparent_w;
- GGadget *mb;
- GFont *plain, *bold;
- int mbh;
- int fh, as;
- int mid_space, cv_y;
- int cv_width, cv_height;
- short button_height, button_width;
-/* ****** */
- SplineChar *cursc;
- int def_layer;
- struct mathkern *orig_mathkern;
- uint8 saved_mathkern; /* Can't just check if orig is non-NULL, because NULL is a perfectly valid initial state */
- uint8 last_aspect;
- uint8 done;
-} MathKernDlg;
-
-# ifdef FONTFORGE_CONFIG_TILEPATH
-
-typedef struct tilepathdlg {
- struct cvcontainer base;
- FontView dummy_fv;
- SplineFont dummy_sf;
- LayerInfo layerinfo[2];
- SplineChar sc_first, sc_medial, sc_final, sc_isolated;
- SplineChar *chars[4];
- EncMap dummy_map;
- int32 map[4], backmap[4];
- uint8 sel[4];
- CharView cv_first, cv_medial, cv_final, cv_isolated;
- CharView *lastcv;
-/* ****** */
- GWindow gw;
- GGadget *mb;
- GFont *plain, *bold;
- int mbh;
- int fh, as;
- int mid_space, cv_y;
- int cv_width, cv_height;
-/* ****** */
- struct tiledata *td;
- SplineFont *base_sf;
- uint8 done, oked;
-} TilePathDlg;
-extern void TPDChar(TilePathDlg *tpd, GEvent *event);
-extern void TPDCharViewInits(TilePathDlg *tpd, int cid);
-extern void PTDChar(TilePathDlg *tpd, GEvent *event);
-extern void PTDCharViewInits(TilePathDlg *tpd, int cid);
-#endif /* Tile Path */
-
-# ifdef FONTFORGE_CONFIG_TYPE3
-
-typedef struct gradientdlg {
- struct cvcontainer base;
- FontView dummy_fv;
- SplineFont dummy_sf;
- LayerInfo layerinfo[2];
- SplineChar sc_grad;
- SplineChar *chars[1];
- EncMap dummy_map;
- int32 map[1], backmap[1];
- uint8 sel[1];
- CharView cv_grad;
-/* ****** */
- GWindow gw;
- GGadget *mb;
- GFont *plain, *bold;
- int mbh;
- int fh, as;
- int mid_space, cv_y;
- int cv_width, cv_height;
-/* ****** */
- uint8 done, oked;
- struct gradient *active;
-} GradientDlg;
-extern void GDDChar(GradientDlg *tpd, GEvent *event);
-extern void GDDCharViewInits(GradientDlg *gdd,int cid);
-#endif /* Tile Path */
-
-struct lkdata {
- int cnt, max;
- int off_top, off_left;
- struct lkinfo {
- OTLookup *lookup;
- unsigned int open: 1;
- unsigned int deleted: 1;
- unsigned int new: 1;
- unsigned int selected: 1;
- unsigned int moved: 1;
- int16 subtable_cnt, subtable_max;
- struct lksubinfo {
- struct lookup_subtable *subtable;
- unsigned int deleted: 1;
- unsigned int new: 1;
- unsigned int selected: 1;
- unsigned int moved: 1;
- } *subtables;
- } *all;
-};
-
-struct gfi_data { /* FontInfo */
- SplineFont *sf;
- int def_layer;
- GWindow gw;
- int tn_active;
- int private_aspect, ttfv_aspect, tn_aspect, tx_aspect, unicode_aspect;
- int old_sel, old_aspect, old_lang, old_strid;
- int ttf_set, names_set, tex_set;
- struct psdict *private;
- int langlocalecode; /* MS code for the current locale */
- unsigned int family_untitled: 1;
- unsigned int human_untitled: 1;
- unsigned int done: 1;
- unsigned int mpdone: 1;
- unsigned int lk_drag_and_drop: 1;
- unsigned int lk_dropablecursor: 1;
- struct anchor_shows { CharView *cv; SplineChar *sc; int restart; } anchor_shows[2];
- struct texdata texdata;
- struct contextchaindlg *ccd;
- struct statemachinedlg *smd;
-/* For GDEF Mark Attachment Class -- used in lookup flags */
-/* As usual, class 0 is unused */
- int mark_class_cnt;
- char **mark_classes; /* glyph name list */
- char **mark_class_names; /* used within ff */
- struct markclassdlg *mcd;
- GFont *font;
- int as, fh;
- struct lkdata tables[2];
- int lkwidth, lkheight;
- int first_sel_lookup, first_sel_subtable;
-};
-
-
-extern void FVMarkHintsOutOfDate(SplineChar *sc);
-extern void FVRefreshChar(FontView *fv,int gid);
-extern int _FVMenuSave(FontView *fv);
-extern int _FVMenuSaveAs(FontView *fv);
-extern int _FVMenuGenerate(FontView *fv,int family);
-extern void _FVCloseWindows(FontView *fv);
-extern char *GetPostscriptFontName(char *defdir,int mult);
-extern void MergeKernInfo(SplineFont *sf,EncMap *map);
-#ifdef FONTFORGE_CONFIG_WRITE_PFM
-extern int WritePfmFile(char *filename,SplineFont *sf, int type0, EncMap *map);
-#endif
-extern int SFGenerateFont(SplineFont *sf,int layer, int family,EncMap *map);
-
-extern void NonLinearDlg(FontView *fv,struct charview *cv);
-extern void FVChangeChar(FontView *fv,int encoding);
-extern void FVMergeFonts(FontView *fv);
-extern void FVInterpolateFonts(FontView *fv);
-
-extern void FVDeselectAll(FontView *fv);
-
-extern void FVAutoKern(FontView *fv);
-extern void FVAutoWidth(FontView *fv);
-
-extern void SC_MarkInstrDlgAsChanged(SplineChar *sc);
-
-extern void PythonUI_Init(void);
-
-extern void SCStroke(SplineChar *sc);
-
-extern void PfaEditSetFallback(void);
-extern void RecentFilesRemember(char *filename);
-
-
-struct debugger_context;
-extern void DebuggerTerminate(struct debugger_context *dc);
-extern void DebuggerReset(struct debugger_context *dc,real pointsizey, real pointsizex,int dpi,int dbg_fpgm, int is_bitmap);
-extern struct debugger_context *DebuggerCreate(SplineChar *sc,int layer,real pointsizey,real pointsizex,int dpi,int dbg_fpgm, int is_bitmap);
-enum debug_gotype { dgt_continue, dgt_step, dgt_next, dgt_stepout };
-extern void DebuggerGo(struct debugger_context *dc,enum debug_gotype,DebugView *dv);
-extern struct TT_ExecContextRec_ *DebuggerGetEContext(struct debugger_context *dc);
-extern void DebuggerToggleBp(struct debugger_context *dc,int range,int ip);
-extern int DebuggerBpCheck(struct debugger_context *dc,int range,int ip);
-extern void DebuggerSetWatches(struct debugger_context *dc,int n, uint8 *w);
-extern uint8 *DebuggerGetWatches(struct debugger_context *dc, int *n);
-extern void DebuggerSetWatchStores(struct debugger_context *dc,int n, uint8 *w);
-extern uint8 *DebuggerGetWatchStores(struct debugger_context *dc, int *n);
-extern int DebuggerIsStorageSet(struct debugger_context *dc, int index);
-extern void DebuggerSetWatchCvts(struct debugger_context *dc,int n, uint8 *w);
-extern uint8 *DebuggerGetWatchCvts(struct debugger_context *dc, int *n);
-extern int DebuggingFpgm(struct debugger_context *dc);
-
-extern void PrintWindowClose(void);
-extern void InsertTextDlg(CharView *cv);
-
-extern char *Kern2Text(SplineChar *other,KernPair *kp,int isv);
-extern char *PST2Text(PST *pst,SplineFont *sf);
-
-
-
-void EmboldenDlg(FontView *fv, CharView *cv);
-void CondenseExtendDlg(FontView *fv, CharView *cv);
-void AddSmallCapsDlg(FontView *fv);
-void AddSubSupDlg(FontView *fv);
-void ObliqueDlg(FontView *fv, CharView *cv);
-void GlyphChangeDlg(FontView *fv, CharView *cv, enum glyphchange_type gc);
-void ItalicDlg(FontView *fv, CharView *cv);
-void ChangeXHeightDlg(FontView *fv,CharView *cv);
-
-extern int FVParseSelectByPST(FontView *fv,struct lookup_subtable *sub,
- int search_type);
-extern void DropChars2Text(GWindow gw, GGadget *glyphs,GEvent *event);
-
-
-extern void FVReplaceOutlineWithReference( FontView *fv, double fudge );
-extern void SVDestroy(struct searchview *sv);
-
-
-
-extern int SLICount(SplineFont *sf);
-extern unichar_t *ClassName(const char *name,uint32 feature_tag,
- uint16 flags, int script_lang_index, int merge_with, int act_type,
- int macfeature,SplineFont *sf);
-extern unichar_t *DecomposeClassName(const unichar_t *clsnm, unichar_t **name,
- uint32 *feature_tag, int *macfeature,
- uint16 *flags, uint16 *script_lang_index,int *merge_with,int *act_type,
- SplineFont *sf);
-extern PST *AddSubs(PST *last,uint32 tag,char *name,uint16 flags,
- uint16 sli,SplineChar *sc);
-
-
-extern void FVScrollToChar(FontView *fv,int i);
-extern void FVRegenChar(FontView *fv,SplineChar *sc);
-extern FontView *FontNew(void);
-extern void _MenuWarnings(GWindow gw,struct gmenuitem *mi,GEvent *e);
-extern void MenuPrefs(GWindow base,struct gmenuitem *mi,GEvent *e);
-extern void MenuSaveAll(GWindow base,struct gmenuitem *mi,GEvent *e);
-extern void MenuExit(GWindow base,struct gmenuitem *mi,GEvent *e);
-extern void MenuOpen(GWindow base,struct gmenuitem *mi,GEvent *e);
-extern void MenuHelp(GWindow base,struct gmenuitem *mi,GEvent *e);
-extern void MenuIndex(GWindow base,struct gmenuitem *mi,GEvent *e);
-extern void MenuAbout(GWindow base,struct gmenuitem *mi,GEvent *e);
-extern void MenuLicense(GWindow base,struct gmenuitem *mi,GEvent *e);
-extern void MenuNew(GWindow gw,struct gmenuitem *mi,GEvent *e);
-extern void WindowMenuBuild(GWindow base,struct gmenuitem *mi,GEvent *);
-extern void MenuRecentBuild(GWindow base,struct gmenuitem *mi,GEvent *);
-extern void MenuScriptsBuild(GWindow base,struct gmenuitem *mi,GEvent *);
-extern void mb2DoGetText(GMenuItem2 *mb);
-extern void mbDoGetText(GMenuItem *mb);
-extern void OFLibBrowse(void);
-extern int RecentFilesAny(void);
-extern void _aplistbuild(struct gmenuitem *mi,SplineFont *sf,
- void (*func)(GWindow,struct gmenuitem *,GEvent *));
-extern int32 *ParseBitmapSizes(GGadget *g,char *msg,int *err);
-extern GTextInfo *AddMacFeatures(GTextInfo *opentype,enum possub_type type,SplineFont *sf);
-extern unichar_t *AskNameTag(char *title,unichar_t *def,uint32 def_tag,uint16 flags,
- int script_lang_index, enum possub_type type, SplineFont *sf, SplineChar *default_script,
- int merge_with,int act_type);
-extern unichar_t *ShowScripts(unichar_t *usedef);
-extern GTextInfo *SFLangList(SplineFont *sf,int addfinal,SplineChar *default_script);
-extern GTextInfo **SFLangArray(SplineFont *sf,int addfinal);
-extern int ScriptLangList(SplineFont *sf,GGadget *list,int sli);
-extern void GListDelSelected(GGadget *list);
-extern void GListMoveSelected(GGadget *list,int offset);
-extern GTextInfo *GListChangeLine(GGadget *list,int pos, const unichar_t *line);
-extern GTextInfo *GListAppendLine(GGadget *list,const unichar_t *line,int select);
-extern GTextInfo *GListChangeLine8(GGadget *list,int pos, const char *line);
-extern GTextInfo *GListAppendLine8(GGadget *list,const char *line,int select);
-extern void CharInfoInit(void);
-extern void SCLigCaretCheck(SplineChar *sc,int clean);
-extern char *DevTab_Dlg(GGadget *g, int r, int c);
-extern int DeviceTableOK(char *dvstr, int *_low, int *_high);
-extern void VRDevTabParse(struct vr *vr,struct matrix_data *md);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
-extern DeviceTable *DeviceTableParse(DeviceTable *dv,char *dvstr);
-extern void DevTabToString(char **str,DeviceTable *adjust);
-extern void ValDevTabToStrings(struct matrix_data *mds,int first_offset,ValDevTab *adjust);
-#endif
-extern void KpMDParse(SplineFont *sf,SplineChar *sc,struct lookup_subtable *sub,
- struct matrix_data *possub,int rows,int cols,int i);
-extern void GFI_LookupEnableButtons(struct gfi_data *gfi, int isgpos);
-extern void GFI_LookupScrollbars(struct gfi_data *gfi, int isgpos, int refresh);
-extern void FontInfo(SplineFont *sf,int layer,int aspect,int sync);
-extern void FontInfoDestroy(SplineFont *sf);
-extern void FontMenuFontInfo(void *fv);
-extern void GFI_CCDEnd(struct gfi_data *d);
-extern struct enc *MakeEncoding(SplineFont *sf, EncMap *map);
-extern void LoadEncodingFile(void);
-extern void RemoveEncoding(void);
-extern void SFPrivateInfo(SplineFont *sf);
-extern void FVDelay(FontView *fv,void (*func)(FontView *));
-extern void GFI_FinishContextNew(struct gfi_data *d,FPST *fpst, int success);
-extern void SCPreparePopup(GWindow gw,SplineChar *sc, struct remap *remap, int enc, int actualuni);
-extern void CVDrawSplineSet(CharView *cv, GWindow pixmap, SplinePointList *set,
- Color fg, int dopoints, DRect *clip );
-extern GWindow CVMakeTools(CharView *cv);
-extern GWindow CVMakeLayers(CharView *cv);
-extern GWindow BVMakeTools(BitmapView *bv);
-extern GWindow BVMakeLayers(BitmapView *bv);
-extern void CVSetLayer(CharView *cv,int layer);
-extern int CVPaletteMnemonicCheck(GEvent *event);
-extern int TrueCharState(GEvent *event);
-extern void CVToolsPopup(CharView *cv, GEvent *event);
-extern void BVToolsPopup(BitmapView *bv, GEvent *event);
-extern real CVRoundRectRadius(void);
-extern int CVRectElipseCenter(void);
-extern void CVRectEllipsePosDlg(CharView *cv);
-extern real CVStarRatio(void);
-extern int CVPolyStarPoints(void);
-extern StrokeInfo *CVFreeHandInfo(void);
-extern void BVToolsSetCursor(BitmapView *bv, int state,char *device);
-extern void CVToolsSetCursor(CharView *cv, int state,char *device);
-extern int CVPaletteIsVisible(CharView *cv,int which);
-extern void CVPaletteSetVisible(CharView *cv,int which,int visible);
-extern void CVPalettesRaise(CharView *cv);
-extern void CVLayersSet(CharView *cv);
-extern void _CVPaletteActivate(CharView *cv,int force);
-extern void CVPaletteActivate(CharView *cv);
-extern void CV_LayerPaletteCheck(SplineFont *sf);
-extern void CVPalettesHideIfMine(CharView *cv);
-extern int BVPaletteIsVisible(BitmapView *bv,int which);
-extern void BVPaletteSetVisible(BitmapView *bv,int which,int visible);
-extern void BVPaletteActivate(BitmapView *bv);
-extern void BVPalettesHideIfMine(BitmapView *bv);
-extern void BVPaletteColorChange(BitmapView *bv);
-extern void BVPaletteColorUnderChange(BitmapView *bv,int color);
-extern void BVPaletteChangedChar(BitmapView *bv);
-extern void CVPaletteDeactivate(void);
-extern void PalettesChangeDocking(void);
-extern int CVPalettesWidth(void);
-extern int BVPalettesWidth(void);
-
-extern void CVDoTransform(CharView *cv, enum cvtools cvt );
-extern void CVTransFunc(CharView *cv,real transform[6],enum fvtrans_flags);
-extern void TransformDlgCreate(void *data,void (*transfunc)(void *,real *,int,BVTFunc *,enum fvtrans_flags),
- int (*getorigin)(void *,BasePoint *,int), int enableback,
- enum cvtools cvt);
-extern void BitmapDlg(FontView *fv,SplineChar *sc, int isavail);
-extern int SimplifyDlg(SplineFont *sf,struct simplifyinfo *smpl);
-extern void CVReviewHints(CharView *cv);
-extern void CVCreateHint(CharView *cv,int ishstem,int preserveundoes);
-extern void SCRemoveSelectedMinimumDistances(SplineChar *sc,int inx);
-extern int CVExport(CharView *cv);
-extern int BVExport(BitmapView *bv);
-
-extern void DrawAnchorPoint(GWindow pixmap,int x, int y,int selected);
-extern void DefaultY(GRect *pos);
-extern void CVDrawRubberRect(GWindow pixmap, CharView *cv);
-extern void CVInfoDraw(CharView *cv, GWindow pixmap );
-extern void CVChar(CharView *cv, GEvent *event );
-extern void PI_ShowHints(SplineChar *sc, GGadget *list, int set);
-extern GTextInfo *SCHintList(SplineChar *sc,HintMask *);
-extern void CVResize(CharView *cv );
-extern CharView *CharViewCreate(SplineChar *sc,FontView *fv,int enc);
-extern void CharViewFree(CharView *cv);
-extern int CVValid(SplineFont *sf, SplineChar *sc, CharView *cv);
-extern void CVSetCharChanged(CharView *cv,int changed);
-extern int CVAnySel(CharView *cv, int *anyp, int *anyr, int *anyi, int *anya);
-extern int CVAnySelPoints(CharView *cv);
-extern void CVSelectPointAt(CharView *cv);
-extern int CVClearSel(CharView *cv);
-extern int CVSetSel(CharView *cv,int mask);
-extern void CVInvertSel(CharView *cv);
-extern int CVAllSelected(CharView *cv);
-extern SplinePointList *CVAnySelPointList(CharView *cv);
-extern int CVOneContourSel(CharView *cv, SplinePointList **_spl,
- RefChar **ref, ImageList **img);
-extern void CVImport(CharView *cv);
-extern void BVImport(BitmapView *bv);
-extern void FVImport(FontView *bv);
-extern void CVFindCenter(CharView *cv, BasePoint *bp, int nosel);
-extern void CVStroke(CharView *cv);
-extern void FVStroke(FontView *fv);
-extern void FreeHandStrokeDlg(StrokeInfo *si);
-extern void OutlineDlg(FontView *fv, CharView *cv,MetricsView *mv,int isinline);
-extern void ShadowDlg(FontView *fv, CharView *cv,MetricsView *mv,int wireframe);
-extern void CVTile(CharView *cv);
-extern void FVTile(FontView *fv);
-extern void CVPatternTile(CharView *cv);
-extern void FVPatternTile(FontView *fv);
-extern void SCCharInfo(SplineChar *sc,int deflayer,EncMap *map,int enc);
-extern void CharInfoDestroy(struct charinfo *ci);
-extern SplineChar *SuffixCheck(SplineChar *sc,char *suffix);
-extern void SCSubtableDefaultSubsCheck(SplineChar *sc, struct lookup_subtable *sub, struct matrix_data *possub, int col_cnt, int r);
-extern GImage *PST_GetImage(GGadget *pstk,SplineFont *sf,int def_layer,
- struct lookup_subtable *sub,int popup_r, SplineChar *sc );
-extern GImage *NameList_GetImage(SplineFont *sf,SplineChar *sc,int def_layer,
- char *namelist, int isliga );
-extern GImage *GV_GetConstructedImage(SplineChar *sc,int def_layer, struct glyphvariants *gv,
- int is_horiz);
-extern GImage *SC_GetLinedImage(SplineChar *sc, int def_layer, int pos, int is_italic_cor);
-extern struct glyphvariants *GV_ParseConstruction(struct glyphvariants *gv,
- struct matrix_data *stuff, int rows, int cols);
-extern void GV_ToMD(GGadget *g, struct glyphvariants *gv);
-extern void CVGetInfo(CharView *cv);
-extern void CVPGetInfo(CharView *cv);
-extern int SCUsedBySubs(SplineChar *sc);
-extern void SCSubBy(SplineChar *sc);
-extern void SCRefBy(SplineChar *sc);
-extern void ApGetInfo(CharView *cv, AnchorPoint *ap);
-extern void CVMakeClipPath(CharView *cv);
-extern void CVAddAnchor(CharView *cv);
-extern AnchorClass *AnchorClassUnused(SplineChar *sc,int *waslig);
-extern void FVSetWidth(FontView *fv,enum widthtype wtype);
-extern void CVSetWidth(CharView *cv,enum widthtype wtype);
-extern void CVChangeSC(CharView *cv, SplineChar *sc );
-extern Undoes *CVPreserveTState(CharView *cv);
-extern void CVRestoreTOriginalState(CharView *cv);
-extern void CVUndoCleanup(CharView *cv);
-
-extern void CVAdjustPoint(CharView *cv, SplinePoint *sp);
-extern void CVMergeSplineSets(CharView *cv, SplinePoint *active, SplineSet *activess,
- SplinePoint *merge, SplineSet *mergess);
-extern void CVAdjustControl(CharView *cv,BasePoint *cp, BasePoint *to);
-extern int CVMoveSelection(CharView *cv, real dx, real dy, uint32 input_state);
-extern int CVTestSelectFromEvent(CharView *cv,GEvent *event);
-extern void CVMouseUpPoint(CharView *cv,GEvent *event);
-extern int CVMouseMovePointer(CharView *cv, GEvent *event);
-extern void CVMouseDownPointer(CharView *cv, FindSel *fs, GEvent *event);
-extern void CVMouseDownRuler(CharView *cv, GEvent *event);
-extern void CVMouseMoveRuler(CharView *cv, GEvent *event);
-extern int CVMouseAtSpline(CharView *cv,GEvent *event);
-extern void CVMouseUpRuler(CharView *cv, GEvent *event);
-extern void CVMouseMoveHand(CharView *cv, GEvent *event);
-extern void CVMouseDownFreeHand(CharView *cv, GEvent *event);
-extern void CVMouseMoveFreeHand(CharView *cv, GEvent *event);
-extern void CVMouseUpFreeHand(CharView *cv, GEvent *event);
-extern void CVMouseDownShape(CharView *cv,GEvent *event);
-extern void CPStartInfo(CharView *cv, GEvent *event);
-extern void CPUpdateInfo(CharView *cv, GEvent *event);
-extern void CPEndInfo(CharView *cv);
-extern void BVChar(BitmapView *cv, GEvent *event );
-extern void CVMouseDownPoint(CharView *cv,GEvent *event);
-extern void CVMouseUpPointer(CharView *cv );
-extern void CVCheckResizeCursors(CharView *cv);
-extern void CVMouseDownHand(CharView *cv);
-extern void CVMouseUpHand(CharView *cv);
-extern void CVMouseDownTransform(CharView *cv);
-extern void CVMouseMoveTransform(CharView *cv);
-extern void CVMouseUpTransform(CharView *cv);
-extern void CVMouseDownKnife(CharView *cv);
-extern void CVMouseUpKnife(CharView *cv,GEvent *event);
-extern void CVMouseMoveShape(CharView *cv);
-extern void CVMouseUpShape(CharView *cv);
-extern void LogoExpose(GWindow pixmap,GEvent *event, GRect *r,enum drawmode dm);
-extern void CVDebugPointPopup(CharView *cv);
-
-extern int GotoChar(SplineFont *sf,EncMap *map);
-
-extern void CVShowPoint(CharView *cv, BasePoint *me);
-
-extern BitmapView *BitmapViewCreate(BDFChar *bc, BDFFont *bdf, FontView *fv,int enc);
-extern BitmapView *BitmapViewCreatePick(int enc, FontView *fv);
-extern void BitmapViewFree(BitmapView *bv);
-extern void BVMenuRotateInvoked(GWindow gw,struct gmenuitem *mi, GEvent *e);
-extern void BVRotateBitmap(BitmapView *bv,enum bvtools type );
-extern int BVColor(BitmapView *bv);
-extern void BCGeneralFunction(BitmapView *bv,
- void (*SetPoint)(BitmapView *,int x, int y, void *data),void *data);
-extern char *BVFlipNames[];
-extern void BVChangeBC(BitmapView *bv, BDFChar *bc, int fitit );
-
-extern void MVSetSCs(MetricsView *mv, SplineChar **scs);
-extern void MVRefreshChar(MetricsView *mv, SplineChar *sc);
-extern void MVRegenChar(MetricsView *mv, SplineChar *sc);
-extern void MVReKern(MetricsView *mv);
-extern MetricsView *MetricsViewCreate(FontView *fv,SplineChar *sc,BDFFont *bdf);
-extern void MetricsViewFree(MetricsView *mv);
-extern void MVRefreshAll(MetricsView *mv);
-extern void MV_FriendlyFeatures(GGadget *g, int pos);
-extern GTextInfo *SLOfFont(SplineFont *sf);
-
-extern void DoPrefs(void);
-extern void GListAddStr(GGadget *list,unichar_t *str, void *ud);
-extern void GListReplaceStr(GGadget *list,int index, unichar_t *str, void *ud);
-extern struct macname *NameGadgetsGetNames( GWindow gw );
-extern void NameGadgetsSetEnabled( GWindow gw, int enable );
-extern int GCDBuildNames(GGadgetCreateData *gcd,GTextInfo *label,int pos,struct macname *names);
-extern void GCDFillMacFeat(GGadgetCreateData *mfgcd,GTextInfo *mflabels, int width,
- MacFeat *all, int fromprefs, GGadgetCreateData *boxes,
- GGadgetCreateData **array);
-extern void Prefs_ReplaceMacFeatures(GGadget *list);
-
-extern unichar_t *FVOpenFont(char *title, const char *defaultfile, int mult);
-
-
-
-
-extern void ShowAboutScreen(void);
-extern void DelayEvent(void (*func)(void *), void *data);
-
-extern void FindProblems(FontView *fv,CharView *cv,SplineChar *sc);
-extern void CVConstrainSelection(CharView *cv,int type);
-extern void CVMakeParallel(CharView *cv);
-
-extern void ScriptDlg(FontView *fv,CharView *cv);
-
-# if HANYANG
-extern void MenuNewComposition(GWindow gw, struct gmenuitem *, GEvent *);
-extern void CVDisplayCompositions(GWindow gw, struct gmenuitem *, GEvent *);
-extern void Disp_DoFinish(struct jamodisplay *d, int cancel);
-extern void Disp_RefreshChar(SplineFont *sf,SplineChar *sc);
-extern void Disp_DefaultTemplate(CharView *cv);
-# endif
-
-extern SearchView *SVCreate(FontView *fv);
-extern void SVCharViewInits(SearchView *sv);
-extern void SV_DoClose(struct cvcontainer *cvc);
-extern void SVChar(SearchView *sv, GEvent *event);
-extern void SVMakeActive(SearchView *sv,CharView *cv);
-extern int SVAttachFV(FontView *fv,int ask_if_difficult);
-extern void SVDetachFV(FontView *fv);
-
-extern void MKDMakeActive(MathKernDlg *mkd,CharView *cv);
-extern void MKDChar(MathKernDlg *mkd, GEvent *event);
-extern void MKD_DoClose(struct cvcontainer *cvc);
-extern void MKDCharViewInits(MathKernDlg *mkd);
-extern void MathKernDialog(SplineChar *sc,int def_layer);
-
-extern void ShowAtt(SplineFont *sf,int def_layer);
-extern void FontCompareDlg(FontView *fv);
-extern void SFShowKernPairs(SplineFont *sf,SplineChar *sc,AnchorClass *ac,int layer);
-extern void SFShowLigatures(SplineFont *sf,SplineChar *sc);
-
-extern void SCEditInstructions(SplineChar *sc);
-extern void SFEditTable(SplineFont *sf, uint32 tag);
-extern void IIScrollTo(struct instrinfo *ii,int ip,int mark_stop);
-extern void IIReinit(struct instrinfo *ii,int ip);
-extern int ii_v_e_h(GWindow gw, GEvent *event);
-extern void instr_scroll(struct instrinfo *ii,struct sbevent *sb);
-
-extern void CVGridFitChar(CharView *cv);
-extern void CVFtPpemDlg(CharView *cv,int debug);
-extern void SCDeGridFit(SplineChar *sc);
-extern void SCReGridFit(SplineChar *sc,int layer);
-
-extern void CVDebugReInit(CharView *cv,int restart_debug,int dbg_fpgm);
-extern void CVDebugFree(DebugView *dv);
-extern int DVChar(DebugView *dv, GEvent *e);
-
-extern void KernClassD(KernClass *kc, SplineFont *sf, int layer, int isv);
-extern void ShowKernClasses(SplineFont *sf,MetricsView *mv,int layer,int isv);
-extern void KCLD_End(struct kernclasslistdlg *kcld);
-extern void KCLD_MvDetach(struct kernclasslistdlg *kcld,MetricsView *mv);
-extern void KernPairD(SplineFont *sf,SplineChar *sc1,SplineChar *sc2,int layer, int isv);
-extern void KCD_DrawGlyph(GWindow pixmap,int x,int baseline,BDFChar *bdfc,int mag);
-extern GTextInfo *BuildFontList(FontView *except);
-extern void TFFree(GTextInfo *tf);
-
-extern void AnchorControl(SplineChar *sc,AnchorPoint *ap,int layer);
-extern void AnchorControlClass(SplineFont *_sf,AnchorClass *ac,int layer);
-
-extern void FVSelectByPST(FontView *fv);
-
-enum hist_type { hist_hstem, hist_vstem, hist_blues };
-struct psdict;
-extern void SFHistogram(SplineFont *sf,int layer, struct psdict *private,uint8 *selected,
- EncMap *map, enum hist_type which);
-
-extern void CCD_Close(struct contextchaindlg *ccd);
-extern int CCD_NameListCheck(SplineFont *sf,const char *ret,int empty_bad,char *title);
-extern struct contextchaindlg *ContextChainEdit(SplineFont *sf,FPST *fpst,
- struct gfi_data *gfi,unichar_t *newname);
-extern int CCD_InvalidClassList(char *ret,GGadget *list,int wasedit);
-extern char *cu_copybetween(const unichar_t *start, const unichar_t *end);
-
-extern struct statemachinedlg *StateMachineEdit(SplineFont *sf,ASM *sm,struct gfi_data *d);
-extern void SMD_Close(struct statemachinedlg *smd);
-extern void GFI_FinishSMNew(struct gfi_data *d,ASM *sm, int success,int isnew);
-extern void GFI_SMDEnd(struct gfi_data *d);
-
-extern void MMChangeBlend(MMSet *mm,FontView *fv,int tonew);
-extern void MMWizard(MMSet *mm);
-
-extern int LayerDialog(Layer *layer,SplineFont *sf);
-extern void CVLayerChange(CharView *cv);
-
-extern int PointOfViewDlg(struct pov_data *pov,SplineFont *sf,int flags);
-
-extern SplineChar *FVMakeChar(FontView *fv,int i);
-
-extern void CVPointOfView(CharView *cv,struct pov_data *);
-
-extern void DVCreateGloss(DebugView *dv);
-extern int CVXPos(DebugView *dv,int offset,int width);
-
-extern GMenuItem *GetEncodingMenu(void (*func)(GWindow,GMenuItem *,GEvent *),
- Encoding *current);
-
-extern GTextInfo *TIFromName(const char *name);
-
-enum subtable_data_flags {
- /* I have flags for each alternative because I want "unspecified" to be */
- /* an option */
- sdf_kernclass = 0x01,
- sdf_kernpair = 0x02,
- sdf_verticalkern = 0x04,
- sdf_horizontalkern = 0x08,
- sdf_dontedit = 0x10
-};
-struct subtable_data {
- int flags;
- SplineChar *sc;
-};
-
-extern GTextInfo **SFLookupListFromType(SplineFont *sf, int lookup_type );
-extern GTextInfo **SFSubtablesOfType(SplineFont *sf, int lookup_type, int kernclass, int add_none);
-extern GTextInfo *SFSubtableListOfType(SplineFont *sf, int lookup_type, int kernclass, int add_none);
-extern struct lookup_subtable *SFNewLookupSubtableOfType(SplineFont *sf, int lookup_type, struct subtable_data *sd, int def_layer );
-extern int EditLookup(OTLookup *otl,int isgpos,SplineFont *sf);
-extern int EditSubtable(struct lookup_subtable *sub,int isgpos,SplineFont *sf,
- struct subtable_data *sd,int def_layer);
-extern void _LookupSubtableContents(SplineFont *sf, struct lookup_subtable *sub,
- struct subtable_data *sd,int def_layer);
-extern unichar_t **SFGlyphNameCompletion(SplineFont *sf,GGadget *t,int from_tab,
- int new_name_after_space);
-extern void AddRmLang(SplineFont *sf, struct lkdata *lk,int add_lang);
-extern void FVMassGlyphRename(FontView *fv);
-
-extern void SFBdfProperties(SplineFont *sf, EncMap *map, BDFFont *thisone);
-
-
-
-extern GMenuItem2 helplist[];
-extern BasePoint last_ruler_offset[];
-
-extern void CVCopyLayerToLayer(CharView *cv);
-extern void FVCopyLayerToLayer(FontView *fv);
-extern void CVCompareLayerToLayer(CharView *cv);
-extern void FVCompareLayerToLayer(FontView *fv);
-
-extern void MathInit(void);
-extern void SFMathDlg(SplineFont *sf,int def_layer);
-
-extern GMenuItem2 *cvpy_menu, *fvpy_menu;
-extern void cvpy_tllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e);
-extern void fvpy_tllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e);
-
-extern void SFValidationWindow(SplineFont *sf,int layer, enum fontformat format);
-extern void ValidationDestroy(SplineFont *sf);
-
-
-
-extern const char *UI_TTFNameIds(int id);
-extern const char *UI_MSLangString(int language);
-extern void FontInfoInit(void);
-extern void LookupUIInit(void);
-extern enum psstrokeflags Ps_StrokeFlagsDlg(void);
-extern struct cidmap *AskUserForCIDMap(void);
-
-extern void DefineGroups(struct fontview *fv);
-extern void DisplayGroups(struct fontview *fv);
-
-extern struct Base *SFBaselines(SplineFont *sf,struct Base *old,int is_vertical);
-
-extern struct hslrgb *SFFontCols(SplineFont *sf,struct hslrgb fontcols[6]);
-#endif /* _VIEWS_H */