57 changes: 0 additions & 57 deletions fontforge/splinefont.h
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,6 @@ enum fontformat { ff_pfa, ff_pfb, ff_pfbmacbin, ff_multiple, ff_mma, ff_mmb,
ff_type42, ff_type42cid,
ff_ttf, ff_ttfsym, ff_ttfmacbin, ff_ttc, ff_ttfdfont, ff_otf, ff_otfdfont,
ff_otfcid, ff_otfciddfont, ff_svg, ff_ufo, ff_woff, ff_none };
extern int CanWoff(void);
extern struct pschars *SplineFont2ChrsSubrs(SplineFont *sf, int iscjk,
struct pschars *subrs,int flags,enum fontformat format,int layer);
struct cidbytes;
Expand All @@ -2085,35 +2084,8 @@ enum bitmapformat { bf_bdf, bf_ttf, bf_sfnt_dfont, bf_sfnt_ms, bf_otb,
bf_nfntmacbin, /*bf_nfntdfont, */bf_fon, bf_fnt, bf_palm,
bf_ptype3,
bf_none };
extern int32 filechecksum(FILE *file);
extern const char *GetAuthor(void);
extern int _WriteWOFFFont(FILE *ttf,SplineFont *sf, enum fontformat format,
int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
extern int WriteWOFFFont(char *fontname,SplineFont *sf, enum fontformat format,
int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
extern int _WriteTTFFont(FILE *ttf,SplineFont *sf, enum fontformat format,
int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
extern int WriteTTFFont(char *fontname,SplineFont *sf, enum fontformat format,
int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
extern int _WriteType42SFNTS(FILE *type42,SplineFont *sf,enum fontformat format,
int flags,EncMap *enc,int layer);
extern int WriteTTC(const char *filename,struct sflist *sfs,enum fontformat format,
enum bitmapformat bf,int flags,int layer,enum ttc_flags ttcflags);
extern int WriteSVGFont(const char *fontname,SplineFont *sf,enum fontformat format,int flags,EncMap *enc,int layer);
extern int _WriteSVGFont(FILE *file,SplineFont *sf,int flags,EncMap *enc,int layer);
extern int WriteUFOFont(const char *fontname, SplineFont *sf, enum fontformat format,int flags, const EncMap *enc,int layer);
extern void DefaultTTFEnglishNames(struct ttflangname *dummy, SplineFont *sf);
extern int AlreadyMSSymbolArea(SplineFont *sf,EncMap *map);
extern void OS2FigureCodePages(SplineFont *sf, uint32 CodePage[2]);
extern void OS2FigureUnicodeRanges(SplineFont *sf, uint32 Ranges[4]);
extern void SFDefaultOS2Info(struct pfminfo *pfminfo,SplineFont *sf,char *fontname);
extern void SFDefaultOS2Simple(struct pfminfo *pfminfo,SplineFont *sf);
extern void SFDefaultOS2SubSuper(struct pfminfo *pfminfo,int emsize,double italicangle);
extern int ScriptIsRightToLeft(uint32 script);
extern void ScriptMainRange(uint32 script, int *start, int *end);
extern uint32 ScriptFromUnicode(uint32 u,SplineFont *sf);
extern uint32 SCScriptFromUnicode(SplineChar *sc);
extern int SCRightToLeft(SplineChar *sc);
extern int SLIContainsR2L(SplineFont *sf,int sli);
extern void SFFindNearTop(SplineFont *);
extern void SFRestoreNearTop(SplineFont *);
Expand Down Expand Up @@ -2162,7 +2134,6 @@ extern SplineChar *SplineCharCreate(int layer_cnt);
extern void SCAddRef(SplineChar *sc,SplineChar *rsc,int layer, real xoff, real yoff);
extern void SplineCharFree(SplineChar *sc);
extern void ScriptLangListFree(struct scriptlanglist *sl);
extern void SFBaseSort(SplineFont *sf);

#if 1
// These relate to experimental support for U. F. O. groups.
Expand All @@ -2171,7 +2142,6 @@ extern void SFBaseSort(SplineFont *sf);
#define GROUP_NAME_VERTICAL 4 // Otherwise horizontal.
#define GROUP_NAME_RIGHT 8 // Otherwise left (or above).
#endif // 1
extern struct otffeatname *findotffeatname(uint32 tag,SplineFont *sf);
extern void MMSetFree(MMSet *mm);
extern void SFRemoveUndoes(SplineFont *sf,uint8 *selected,EncMap *map);
extern void SplineRefigure(Spline *spline);
Expand All @@ -2192,9 +2162,6 @@ extern SplinePointList *SplinePointListTransform(SplinePointList *base, real tra
extern void SCReinstanciateRef(SplineChar *sc,SplineChar *rsc,int layer);
extern SplineChar *MakeDupRef(SplineChar *base, int local_enc, int uni_enc);
extern void BDFClut(BDFFont *bdf, int linear_scale);
extern int FNTFontDump(char *filename,BDFFont *font, EncMap *map, int res);
extern int FONFontDump(char *filename,SplineFont *sf, int32 *sizes,int res,
EncMap *map);
struct xlfd_components {
char foundry[80];
char family[100];
Expand Down Expand Up @@ -2297,26 +2264,16 @@ extern char* DumpSplineFontMetadata( SplineFont *sf );


enum ttfflags { ttf_onlystrikes=1, ttf_onlyonestrike=2, ttf_onlykerns=4, ttf_onlynames=8 };
extern SplineFont *_SFReadWOFF(FILE *woff,int flags,enum openflags openflags,
char *filename,struct fontdict *fd);
extern SplineFont *SFReadSVG(char *filename,int flags);
extern SplineFont *SFReadSVGMem(char *data,int flags);
extern SplineFont *SFReadUFO(char *filename,int flags);
extern SplineFont *SFReadWinFON(char *filename,int toback);
extern SplineFont *LoadSplineFont(const char *filename,enum openflags);
extern SplineFont *_ReadSplineFont(FILE *file, const char *filename, enum openflags openflags);
extern SplineFont *ReadSplineFont(const char *filename,enum openflags); /* Don't use this, use LoadSF instead */
extern void ArchiveCleanup(char *archivedir);
extern char *Unarchive(char *name, char **_archivedir);
extern char *Decompress(char *name, int compression);
extern uint16 MacStyleCode( SplineFont *sf, uint16 *psstyle );
extern char **NamesReadSVG(char *filename);
extern char **NamesReadUFO(char *filename);

extern void SFSetOrder(SplineFont *sf,int order2);
extern void SFLSetOrder(SplineFont *sf, int layerdest, int order2);
extern int SFFindOrder(SplineFont *sf);
extern int SFLFindOrder(SplineFont *sf, int layerdest);

extern const char *UnicodeRange(int unienc);
extern SplineChar *SCBuildDummy(SplineChar *dummy,SplineFont *sf,EncMap *map,int i);
Expand All @@ -2329,7 +2286,6 @@ extern void SCUndoSetLBearingChange(SplineChar *sc,int lb);



extern SplineSet *SplinePointListInterpretSVG(char *filename,char *memory, int memlen, int em_size, int ascent,int stroked);
extern SplineSet *SplinePointListInterpretGlif(SplineFont *sf,char *filename,char *memory, int memlen, int em_size, int ascent,int stroked);
#define UNDEFINED_WIDTH -999999
struct pscontext {
Expand Down Expand Up @@ -2359,11 +2315,6 @@ extern void SCRound2Int(SplineChar *sc,int layer, real factor);

extern void SFFlatten(SplineFont *cidmaster);

void putshort(FILE *file,int sval);
void putlong(FILE *file,int val);
void putfixed(FILE *file,real dval);
int ttfcopyfile(FILE *ttf, FILE *other, int pos, const char *table_name);

extern void SCCopyLayerToLayer(SplineChar *sc, int from, int to,int doclear);

extern int hasFreeType(void);
Expand Down Expand Up @@ -2400,14 +2351,11 @@ extern int SSTtfNumberPoints(SplineSet *ss);
extern int SCNumberPoints(SplineChar *sc,int layer);
extern int SCPointsNumberedProperly(SplineChar *sc,int layer);

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 char *utf8_verify_copy(const char *str);

extern struct macsetting *FindMacSetting(SplineFont *sf, int feat, int set,struct macsetting **secondary);

Expand All @@ -2434,10 +2382,7 @@ extern void SFBuildSyllables(SplineFont *sf);

extern void SFSetModTime(SplineFont *sf);

extern int SFHasInstructions(SplineFont *sf);
extern int RefDepth(RefChar *ref,int layer);

extern SplineChar *SCHasSubs(SplineChar *sc,uint32 tag);

extern struct lookup_subtable *SFFindLookupSubtable(SplineFont *sf,char *name);
extern int FeatureTagInFeatureScriptList(uint32 tag, FeatureScriptLangList *fl);
Expand All @@ -2459,12 +2404,10 @@ extern void RevertedGlyphReferenceFixup(SplineChar *sc, SplineFont *sf);
extern void SFUntickAll(SplineFont *sf);


extern int HasSVG(void);
extern int HasUFO(void);
extern void SCImportPS(SplineChar *sc,int layer,char *path,int doclear, int flags);
extern void SCImportPDF(SplineChar *sc,int layer,char *path,int doclear, int flags);

extern int _ExportSVG(FILE *svg,SplineChar *sc,int layer);
extern int _ExportGlif(FILE *glif,SplineChar *sc,int layer);

extern void SCCopyWidth(SplineChar *sc,enum undotype);
Expand Down
2 changes: 2 additions & 0 deletions fontforge/splinesaveafm.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "mm.h"
#include "namelist.h"
#include "ttf.h" /* For AnchorClassDecompose */
#include "tottf.h"
#include "tottfgpos.h"
#include <stdio.h>
#include "splinefont.h"
#include "splinesave.h"
Expand Down
1 change: 1 addition & 0 deletions fontforge/splineutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "splineorder2.h"
#include "splinerefigure.h"
#include "splineutil2.h"
#include "tottf.h"
#include "ustring.h"
#include "utype.h"
#include "views.h" /* for FindSel structure */
Expand Down
1 change: 1 addition & 0 deletions fontforge/splineutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "psfont.h"
#include "splinefont.h"
#include "ttfinstrs.h"
#include "views.h"

extern AnchorClass *SFFindOrAddAnchorClass(SplineFont *sf, char *name, struct lookup_subtable *sub);
Expand Down
5 changes: 5 additions & 0 deletions fontforge/svg.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "svg.h"

#include "autohint.h"
#include "cvimages.h"
#include "dumppfa.h"
Expand All @@ -39,6 +42,8 @@
#include "splinesaveafm.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottf.h"
#include "tottfgpos.h"
#include <unistd.h>
#include <math.h>
#include <locale.h>
Expand Down
22 changes: 22 additions & 0 deletions fontforge/svg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef FONTFORGE_SVG_H
#define FONTFORGE_SVG_H

#include "sd.h"
#include "splinefont.h"

extern char **NamesReadSVG(char *filename);
extern Entity *EntityInterpretSVG(char *filename, char *memory, int memlen, int em_size, int ascent);
extern int _ExportSVG(FILE *svg, SplineChar *sc, int layer);
extern int HasSVG(void);
extern int SFFindOrder(SplineFont *sf);
extern int SFLFindOrder(SplineFont *sf, int layerdest);
extern int WriteSVGFont(const char *fontname, SplineFont *sf, enum fontformat format, int flags, EncMap *enc, int layer);
extern int _WriteSVGFont(FILE *file, SplineFont *sf, int flags, EncMap *enc, int layer);
extern SplineChar *SCHasSubs(SplineChar *sc, uint32 tag);
extern SplineFont *SFReadSVG(char *filename, int flags);
extern SplineFont *SFReadSVGMem(char *data, int flags);
extern SplineSet *SplinePointListInterpretSVG(char *filename, char *memory, int memlen, int em_size, int ascent, int is_stroked);
extern void SFLSetOrder(SplineFont *sf, int layerdest, int order2);
extern void SFSetOrder(SplineFont *sf, int order2);

#endif /* FONTFORGE_SVG_H */
7 changes: 7 additions & 0 deletions fontforge/tottf.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "tottf.h"

#include "autohint.h"
#include "dumpbdf.h"
#include "dumppfa.h"
Expand All @@ -43,6 +46,10 @@
#include "splinesave.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottfaat.h"
#include "tottfgpos.h"
#include "tottfvar.h"
#include "ttfspecial.h"
#include <math.h>
#include <unistd.h>
#include <time.h>
Expand Down
33 changes: 33 additions & 0 deletions fontforge/tottf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef FONTFORGE_TOTTF_H
#define FONTFORGE_TOTTF_H

#include "splinefont.h"
#include "ttf.h"

extern char *utf8_verify_copy(const char *str);
extern int32 filechecksum(FILE *file);

extern int AlreadyMSSymbolArea(SplineFont *sf, EncMap *map);
extern int RefDepth(RefChar *ref, int layer);
extern int SFFigureDefWidth(SplineFont *sf, int *_nomwid);
extern int SFHasInstructions(SplineFont *sf);
extern int SSAddPoints(SplineSet *ss, int ptcnt, BasePoint *bp, char *flags);
extern int ttfcopyfile(FILE *ttf, FILE *other, int pos, const char *tab_name);
extern int WriteTTC(const char *filename, struct sflist *sfs, enum fontformat format, enum bitmapformat bf, int flags, int layer, enum ttc_flags ttcflags);
extern int WriteTTFFont(char *fontname, SplineFont *sf, enum fontformat format, int32 *bsizes, enum bitmapformat bf, int flags, EncMap *enc, int layer);
extern int _WriteTTFFont(FILE *ttf, SplineFont *sf, enum fontformat format, int32 *bsizes, enum bitmapformat bf, int flags, EncMap *enc, int layer);
extern int _WriteType42SFNTS(FILE *type42, SplineFont *sf, enum fontformat format, int flags, EncMap *enc, int layer);
extern void cvt_unix_to_1904(long long time, int32 result[2]);
extern void DefaultTTFEnglishNames(struct ttflangname *dummy, SplineFont *sf);
extern void OS2FigureCodePages(SplineFont *sf, uint32 CodePage[2]);
extern void OS2FigureUnicodeRanges(SplineFont *sf, uint32 Ranges[4]);
extern void SFDefaultOS2Info(struct pfminfo *pfminfo, SplineFont *sf, char *fontname);
extern void SFDefaultOS2Simple(struct pfminfo *pfminfo, SplineFont *sf);
extern void SFDefaultOS2SubSuper(struct pfminfo *pfminfo, int emsize, double italic_angle);
extern void SFDummyUpCIDs(struct glyphinfo *gi, SplineFont *sf);

extern void putfixed(FILE *file, real dval);
extern void putlong(FILE *file, int val);
extern void putshort(FILE *file, int sval);

#endif /* FONTFORGE_TOTTF_H */
5 changes: 5 additions & 0 deletions fontforge/tottfaat.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "tottfaat.h"

#include "fontforge.h"
#include "fvfonts.h"
#include "macenc.h"
#include "asmfpst.h"
#include "splinesaveafm.h"
#include "splineutil.h"
#include "tottf.h"
#include "tottfgpos.h"
#include <utype.h>

#include "ttf.h"
Expand Down
28 changes: 28 additions & 0 deletions fontforge/tottfaat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef FONTFORGE_TOTTFAAT_H
#define FONTFORGE_TOTTFAAT_H

#include "splinefont.h"
#include "ttf.h"

/* 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 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]);

extern int Macable(SplineFont *sf, OTLookup *otl);

#endif /* FONTFORGE_TOTTFAAT_H */
4 changes: 4 additions & 0 deletions fontforge/tottfgpos.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "tottfgpos.h"

#include "fontforgevw.h"
#include "fvfonts.h"
#include "lookups.h"
Expand All @@ -32,6 +35,7 @@
#include "asmfpst.h"
#include "splinesaveafm.h"
#include "splineutil.h"
#include "tottf.h"
#include <utype.h>
#include <ustring.h>

Expand Down
34 changes: 34 additions & 0 deletions fontforge/tottfgpos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#ifndef FONTFORGE_TOTTFGPOS_H
#define FONTFORGE_TOTTFGPOS_H

#include "splinefont.h"
#include "ttf.h"

/* Open type Advanced Typography Tables */
extern void otf_dumpgpos(struct alltabs *at, SplineFont *sf);
extern void otf_dumpgsub(struct alltabs *at, SplineFont *sf);
extern void otf_dumpgdef(struct alltabs *at, SplineFont *sf);
extern void otf_dumpbase(struct alltabs *at, SplineFont *sf);
extern void otf_dumpjstf(struct alltabs *at, SplineFont *sf);
extern void otf_dump_dummydsig(struct alltabs *at, SplineFont *sf);
extern int gdefclass(SplineChar *sc);

extern int SCRightToLeft(SplineChar *sc);
extern int ScriptIsRightToLeft(uint32 script);
extern SplineChar **EntryExitDecompose(SplineFont *sf, AnchorClass *ac, struct glyphinfo *gi);
extern struct otffeatname *findotffeatname(uint32 tag, SplineFont *sf);
extern uint32 ScriptFromUnicode(uint32 u, SplineFont *sf);
extern uint32 SCScriptFromUnicode(SplineChar *sc);
extern void AnchorClassDecompose(SplineFont *sf, AnchorClass *_ac, int classcnt, int *subcnts, SplineChar ***marks, SplineChar ***base, SplineChar ***lig, SplineChar ***mkmk, struct glyphinfo *gi);
extern void ScriptMainRange(uint32 script, int *start, int *end);
extern void SFBaseSort(SplineFont *sf);

/* Used by both otf and apple */
extern int LigCaretCnt(SplineChar *sc);
extern uint16 *ClassesFromNames(SplineFont *sf, char **classnames, int class_cnt, int numGlyphs, SplineChar ***glyphs, int apple_kc);
extern SplineChar **SFGlyphsFromNames(SplineFont *sf, char *names);

/* The MATH table */
extern void otf_dump_math(struct alltabs *at, SplineFont *sf);

#endif /* FONTFORGE_TOTTFGPOS_H */
4 changes: 4 additions & 0 deletions fontforge/tottfvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "tottfvar.h"

#include "fontforge.h"
#include "mem.h"
#include "ttf.h"
#include "splinesaveafm.h"
#include "tottf.h"
#include <math.h>
#include <ustring.h>

Expand Down
12 changes: 12 additions & 0 deletions fontforge/tottfvar.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef FONTFORGE_TOTTFVAR_H
#define FONTFORGE_TOTTFVAR_H

#include "splinefont.h"

/* 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);

#endif /* FONTFORGE_TOTTFVAR_H */
107 changes: 0 additions & 107 deletions fontforge/ttf.h
Original file line number Diff line number Diff line change
Expand Up @@ -788,38 +788,6 @@ struct contexttree {
extern const char *cffnames[];
extern const int nStdStrings;

/* Open type Advanced Typography Tables */
extern void otf_dumpgpos(struct alltabs *at, SplineFont *sf);
extern void otf_dumpgsub(struct alltabs *at, SplineFont *sf);
extern void otf_dumpgdef(struct alltabs *at, SplineFont *sf);
extern void otf_dumpbase(struct alltabs *at, SplineFont *sf);
extern void otf_dumpjstf(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 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;
Expand All @@ -830,80 +798,5 @@ extern struct macsettingname {
extern struct ttf_table *SFFindTable(SplineFont *sf,uint32 tag);
extern int TTF__getcvtval(SplineFont *sf,int val);
extern int TTF_getcvtval(SplineFont *sf,int val);
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);
extern uint16 *ClassesFromNames(SplineFont *sf,char **classnames,int class_cnt,
int numGlyphs, SplineChar ***glyphs, int apple_kc);
extern SplineChar **SFGlyphsFromNames(SplineFont *sf,char *names);


extern SplineChar **EntryExitDecompose(SplineFont *sf,AnchorClass *ac,
struct glyphinfo *gi);
extern void AnchorClassDecompose(SplineFont *sf,AnchorClass *_ac, int classcnt, int *subcnts,
SplineChar ***marks,SplineChar ***base,
SplineChar ***lig,SplineChar ***mkmk,
struct glyphinfo *gi);

extern void cvt_unix_to_1904( long long time, int32 result[2]);


/* Non-standard tables */
/* My PfEd table for FontForge/PfaEdit specific info */
extern void pfed_dump(struct alltabs *at, SplineFont *sf);
extern void pfed_read(FILE *ttf,struct ttfinfo *info);
/* The TeX table, to contain stuff the TeX people want */
extern void tex_dump(struct alltabs *at, SplineFont *sf);
extern void tex_read(FILE *ttf,struct ttfinfo *info);
/* The BDF table, to contain bdf properties the X people want */
extern int ttf_bdf_dump(SplineFont *sf,struct alltabs *at,int32 *sizes);
extern void ttf_bdf_read(FILE *ttf,struct ttfinfo *info);
/* The FFTM table, to some timestamps I'd like */
extern int ttf_fftm_dump(SplineFont *sf,struct alltabs *at);

/* The MATH table */
extern void otf_dump_math(struct alltabs *at, SplineFont *sf);



/* Known font parameters for 'TeX ' table (fontdims, spacing params, whatever you want to call them) */
/* Used by all fonts */
#define TeX_Slant CHR('S','l','n','t')
#define TeX_Space CHR('S','p','a','c')
#define TeX_Stretch CHR('S','t','r','e')
#define TeX_Shrink CHR('S','h','n','k')
#define TeX_XHeight CHR('X','H','g','t')
#define TeX_Quad CHR('Q','u','a','d')
/* Used by text fonts */
#define TeX_ExtraSp CHR('E','x','S','p')
/* Used by all math fonts */
#define TeX_MathSp CHR('M','t','S','p')
/* Used by math fonts */
#define TeX_Num1 CHR('N','u','m','1')
#define TeX_Num2 CHR('N','u','m','2')
#define TeX_Num3 CHR('N','u','m','3')
#define TeX_Denom1 CHR('D','n','m','1')
#define TeX_Denom2 CHR('D','n','m','2')
#define TeX_Sup1 CHR('S','u','p','1')
#define TeX_Sup2 CHR('S','u','p','2')
#define TeX_Sup3 CHR('S','u','p','3')
#define TeX_Sub1 CHR('S','u','b','1')
#define TeX_Sub2 CHR('S','u','b','2')
#define TeX_SupDrop CHR('S','p','D','p')
#define TeX_SubDrop CHR('S','b','D','p')
#define TeX_Delim1 CHR('D','l','m','1')
#define TeX_Delim2 CHR('D','l','m','2')
#define TeX_AxisHeight CHR('A','x','H','t')
/* Used by math extension fonts */
#define TeX_DefRuleThick CHR('R','l','T','k')
#define TeX_BigOpSpace1 CHR('B','O','S','1')
#define TeX_BigOpSpace2 CHR('B','O','S','2')
#define TeX_BigOpSpace3 CHR('B','O','S','3')
#define TeX_BigOpSpace4 CHR('B','O','S','4')
#define TeX_BigOpSpace5 CHR('B','O','S','5')

extern void SFDummyUpCIDs(struct glyphinfo *gi,SplineFont *sf);

#endif /* FONTFORGE_TTF_H */
4 changes: 3 additions & 1 deletion fontforge/ttfinstrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "ttfinstrs.h"

#include "fontforgevw.h"
#include <ustring.h>
#include <utype.h>
#include "ttf.h"
#include "ttfinstrs.h"

const char *ff_ttf_instrnames[] = {
"SVTCA[y-axis]",
Expand Down
19 changes: 19 additions & 0 deletions fontforge/ttfinstrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#ifndef FONTFORGE_TTFINSTRS_H
#define FONTFORGE_TTFINSTRS_H

#include "splinefont.h"

enum ttf_instructions {
ttf_npushb=0x40, ttf_npushw=0x41, ttf_pushb=0xb0, ttf_pushw=0xb8,
ttf_aa=0x7f, ttf_abs=0x64, ttf_add=0x60, ttf_alignpts=0x27, ttf_alignrp=0x3c,
Expand Down Expand Up @@ -59,6 +61,19 @@ enum ttf_instructions {

extern const char *ff_ttf_instrnames[];

struct instrdata {
uint8 *instrs;
int instr_cnt, max;
uint8 *bts;
unsigned int changed: 1;
unsigned int in_composit: 1;
SplineFont *sf;
SplineChar *sc;
uint32 tag;
struct instrdlg *id; /* FIXME: struct instrdlg is defined in exe/ttfstrsui.c, remove from this struct */
struct instrdata *next;
};

typedef struct instrbase {
unsigned int inedit: 1;
struct instrdata *instrdata;
Expand All @@ -67,6 +82,10 @@ typedef struct instrbase {
char *scroll, *offset;
} InstrBase;

enum byte_types { bt_instr, bt_cnt, bt_byte, bt_wordhi, bt_wordlo, bt_impliedreturn };

extern uint8 *_IVParse(SplineFont *sf, char *text, int *len, void (*IVError)(void *, char *, int), void *iv);
extern char *_IVUnParseInstrs(uint8 *instrs, int instr_cnt);
extern char *__IVUnParseInstrs(InstrBase *iv);
extern int instr_typify(struct instrdata *);

Expand Down
4 changes: 4 additions & 0 deletions fontforge/ttfspecial.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "ttfspecial.h"

#include "fontforge.h"
#include "mem.h"
#include "splinefill.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottf.h"
#include <math.h>
#include <time.h>
#include <utype.h>
Expand Down
61 changes: 61 additions & 0 deletions fontforge/ttfspecial.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#ifndef FONTFORGE_TTFSPECIAL_H
#define FONTFORGE_TTFSPECIAL_H

#include "splinefont.h"
#include "ttf.h"

/* Non-standard tables */

/* My PfEd table for FontForge/PfaEdit specific info */
extern void pfed_dump(struct alltabs *at, SplineFont *sf);
extern void pfed_read(FILE *ttf, struct ttfinfo *info);

/* The TeX table, to contain stuff the TeX people want */
extern void tex_dump(struct alltabs *at, SplineFont *sf);
extern void tex_read(FILE *ttf, struct ttfinfo *info);

/* The BDF table, to contain bdf properties the X people want */
extern int ttf_bdf_dump(SplineFont *sf, struct alltabs *at,int32 *sizes);
extern void ttf_bdf_read(FILE *ttf, struct ttfinfo *info);

/* The FFTM table, to some timestamps I'd like */
extern int ttf_fftm_dump(SplineFont *sf, struct alltabs *at);

/* Known font parameters for 'TeX ' table (fontdims, spacing params, whatever you want to call them) */

/* Used by all fonts */
#define TeX_Slant CHR('S','l','n','t')
#define TeX_Space CHR('S','p','a','c')
#define TeX_Stretch CHR('S','t','r','e')
#define TeX_Shrink CHR('S','h','n','k')
#define TeX_XHeight CHR('X','H','g','t')
#define TeX_Quad CHR('Q','u','a','d')
/* Used by text fonts */
#define TeX_ExtraSp CHR('E','x','S','p')
/* Used by all math fonts */
#define TeX_MathSp CHR('M','t','S','p')
/* Used by math fonts */
#define TeX_Num1 CHR('N','u','m','1')
#define TeX_Num2 CHR('N','u','m','2')
#define TeX_Num3 CHR('N','u','m','3')
#define TeX_Denom1 CHR('D','n','m','1')
#define TeX_Denom2 CHR('D','n','m','2')
#define TeX_Sup1 CHR('S','u','p','1')
#define TeX_Sup2 CHR('S','u','p','2')
#define TeX_Sup3 CHR('S','u','p','3')
#define TeX_Sub1 CHR('S','u','b','1')
#define TeX_Sub2 CHR('S','u','b','2')
#define TeX_SupDrop CHR('S','p','D','p')
#define TeX_SubDrop CHR('S','b','D','p')
#define TeX_Delim1 CHR('D','l','m','1')
#define TeX_Delim2 CHR('D','l','m','2')
#define TeX_AxisHeight CHR('A','x','H','t')
/* Used by math extension fonts */
#define TeX_DefRuleThick CHR('R','l','T','k')
#define TeX_BigOpSpace1 CHR('B','O','S','1')
#define TeX_BigOpSpace2 CHR('B','O','S','2')
#define TeX_BigOpSpace3 CHR('B','O','S','3')
#define TeX_BigOpSpace4 CHR('B','O','S','4')
#define TeX_BigOpSpace5 CHR('B','O','S','5')

#endif /* FONTFORGE_TTFSPECIAL_H */
3 changes: 3 additions & 0 deletions fontforge/ufo.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
#include "splinesaveafm.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "svg.h"
#include "tottf.h"
#include "tottfgpos.h"
#include <unistd.h>
#include <math.h>
#include <time.h>
Expand Down
2 changes: 2 additions & 0 deletions fontforge/views.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <fontforge-config.h>

#include "ttfinstrs.h"

#include "ffglib.h"
#include "baseviews.h"

Expand Down
4 changes: 4 additions & 0 deletions fontforge/winfonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "winfonts.h"

#include "bvedit.h"
#include "encoding.h"
#include "fontforge.h"
#include "mem.h"
#include "splinefill.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottf.h"
#include <stdio.h>
#include <math.h>
#include "splinefont.h"
Expand Down
10 changes: 10 additions & 0 deletions fontforge/winfonts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef FONTFORGE_WINFONTS_H
#define FONTFORGE_WINFONTS_H

#include "splinefont.h"

extern int FNTFontDump(char *filename, BDFFont *font, EncMap *map, int res);
extern int FONFontDump(char *filename, SplineFont *sf, int32 *sizes, int resol, EncMap *map);
extern SplineFont *SFReadWinFON(char *filename, int toback);

#endif /* FONTFORGE_WINFONTS_H */
3 changes: 3 additions & 0 deletions fontforge/woff.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
/* Which are defined here: http://people.mozilla.com/~jkew/woff/woff-2009-09-16.html */
/* Basically sfnts with compressed tables and some more metadata */

#include "woff.h"

#include "fontforge.h"
#include "http.h"
#include "mem.h"
#include "parsettf.h"
#include "tottf.h"
#include <math.h>
#include <ctype.h>

Expand Down
13 changes: 13 additions & 0 deletions fontforge/woff.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef FONTFORGE_WOFF_H
#define FONTFORGE_WOFF_H

#include <stdio.h>

#include "splinefont.h"

extern int CanWoff(void);
extern int WriteWOFFFont(char *fontname, SplineFont *sf, enum fontformat format, int32 *bsizes, enum bitmapformat bf, int flags, EncMap *enc, int layer);
extern int _WriteWOFFFont(FILE *woff, SplineFont *sf, enum fontformat format, int32 *bsizes, enum bitmapformat bf, int flags, EncMap *enc, int layer);
extern SplineFont *_SFReadWOFF(FILE *woff, int flags, enum openflags openflags, char *filename, struct fontdict *fd);

#endif /* FONTFORGE_WOFF_H */
1 change: 1 addition & 0 deletions fontforgeexe/basedlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
#include "fontforgeui.h"
#include "splineutil.h"
#include "tottfgpos.h"
#include <ustring.h>
#include <chardata.h>
#include <utype.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/charinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "namelist.h"
#include "splinefill.h"
#include "splineutil.h"
#include "tottfgpos.h"
#include <ustring.h>
#include <math.h>
#include <utype.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/combinations.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "psfont.h"
#include "splinefill.h"
#include "splineutil.h"
#include "tottfgpos.h"
#include <ustring.h>
#include <gkeysym.h>
#include <utype.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/cvgetinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "splineorder2.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottfgpos.h"
#include <ustring.h>
#include <math.h>
#include <utype.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/displayfonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "sftextfieldP.h"
#include "splinesaveafm.h"
#include "splineutil2.h"
#include "tottfgpos.h"
#include <stdlib.h>
#include <math.h>
#include <time.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/fontinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "splinesaveafm.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottf.h"
#include <ustring.h>
#include <chardata.h>
#include <utype.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/fontview.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "splinesaveafm.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottfgpos.h"
#include <gfile.h>
#include <gio.h>
#include <gresedit.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/kernclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "lookups.h"
#include "splinefill.h"
#include "splineutil.h"
#include "tottfgpos.h"
#include <gkeysym.h>
#include <string.h>
#include <ustring.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/lookupui.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "splinefill.h"
#include "splinesaveafm.h"
#include "splineutil.h"
#include "tottfgpos.h"
#include <chardata.h>
#include <utype.h>
#include <ustring.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/metricsview.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "splineoverlap.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottfgpos.h"
#include <gkeysym.h>
#include <gresource.h>
#include <gresedit.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/mmdlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "splinefill.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottfvar.h"
#include <ustring.h>
#include <math.h>
#include <gkeysym.h>
Expand Down
2 changes: 2 additions & 0 deletions fontforgeexe/problems.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include "splinesaveafm.h"
#include "splineutil.h"
#include "splineutil2.h"
#include "tottf.h"
#include "tottfgpos.h"
#include <gwidget.h>
#include <ustring.h>
#include <math.h>
Expand Down
2 changes: 2 additions & 0 deletions fontforgeexe/savefontdlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "splinefill.h"
#include "splinesaveafm.h"
#include "splineutil.h"
#include "tottf.h"
#include "woff.h"
#include <ustring.h>
#include <locale.h>
#include <gfile.h>
Expand Down
1 change: 1 addition & 0 deletions fontforgeexe/sftextfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "langfreq.h"
#include "splinefill.h"
#include "splineutil.h"
#include "tottfgpos.h"
#include <gkeysym.h>
#include <math.h>

Expand Down
2 changes: 2 additions & 0 deletions fontforgeexe/showatt.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include "splinefill.h"
#include "splinesaveafm.h"
#include "splineutil.h"
#include "tottfaat.h"
#include "tottfgpos.h"
#include <utype.h>
#include <ustring.h>
#include <gkeysym.h>
Expand Down