w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

splinefont.h
Go to the documentation of this file.
1 /* Copyright (C) 2000-2012 by George Williams */
2 /*
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are met:
5 
6  * Redistributions of source code must retain the above copyright notice, this
7  * list of conditions and the following disclaimer.
8 
9  * Redistributions in binary form must reproduce the above copyright notice,
10  * this list of conditions and the following disclaimer in the documentation
11  * and/or other materials provided with the distribution.
12 
13  * The name of the author may not be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15 
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19  * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 #ifndef _SPLINEFONT_H
28 #define _SPLINEFONT_H
29 
30 #ifdef HAVE_CONFIG_H
31 #include <config.h>
32 #endif
33 #include <basics.h>
34 #include <dlist.h>
35 #include "configure-fontforge.h"
36 #include "fflocale.h"
37 #ifdef HAVE_ICONV
38 # include <iconv.h>
39 #else
40 # include <gwwiconv.h>
41 #endif
42 #include <gnetwork.h>
43 
44 #ifdef FONTFORGE_CONFIG_USE_DOUBLE
45 # define real double
46 # define bigreal double
47 #else
48 # define real float
49 # define bigreal double
50 #endif
51 
52 #define extended double
53  /* Solaris wants to define extended to be unsigned [3] unless we do this*/
54 #define _EXTENDED
55 
56 #define CHR(ch1,ch2,ch3,ch4) (((ch1)<<24)|((ch2)<<16)|((ch3)<<8)|(ch4))
57 
58 #define MmMax 16 /* PS says at most this many instances for type1/2 mm fonts */
59 #define AppleMmMax 26 /* Apple sort of has a limit of 4095, but we only support this many */
60 
61 typedef struct ipoint {
62  int x;
63  int y;
65 
66 #define IPOINT_EMPTY { 0, 0 }
67 
68 
69 typedef struct basepoint {
73 
74 #define BASEPOINT_EMPTY { (real)0.0, (real)0.0 }
75 
76 
77 typedef struct dbasepoint {
81 
82 #define DBASEPOINT_EMPTY { (bigreal)0.0, (bigreal)0.0 }
83 
84 
85 typedef struct tpoint {
90 
91 #define TPOINT_EMPTY { (real)0.0, (real)0.0, (real)0.0 }
92 
93 
94 typedef struct dbounds {
98 
99 #define DBOUNDS_EMPTY { (real)0.0, (real)0.0, (real)0.0, (real)0.0 }
100 
101 
102 typedef struct ibounds {
103  int minx, maxx;
104  int miny, maxy;
106 
107 #define IBOUNDS_EMPTY { 0, 0, 0, 0 }
108 
109 
112 
113 typedef struct val {
114  enum val_type type;
115  union {
116  int ival;
118  char *sval;
119  struct val *lval;
120  struct array *aval;
124  } u;
125 } Val; /* Used by scripting */
126 
127 struct psdict {
128  int cnt; /* *key[0..cnt] and *values[0..cnt] currently available */
129  int next; /* **key[0..next] and **values[0..next] currently used */
130  char **keys;
131  char **values;
132 };
133 
134 struct pschars {
135  int cnt, next;
136  char **keys;
138  int *lens;
139  int bias; /* for type2 strings */
140 };
141 
142 enum linejoin {
143  lj_miter, /* Extend lines until they meet */
144  lj_round, /* circle centered at the join of expand radius */
145  lj_bevel, /* Straight line between the ends of next and prev */
147 };
148 enum linecap {
149  lc_butt, /* equiv to lj_bevel, straight line extends from one side to other */
150  lc_round, /* semi-circle */
151  lc_square, /* Extend lines by radius, then join them */
153 };
156 };
157 
158 #define COLOR_INHERITED 0xfffffffe
159 
160 struct grad_stops {
164 };
165 
166 struct gradient {
167  BasePoint start; /* focal of a radial gradient, start of a linear */
168  BasePoint stop; /* center of a radial gradient, end of a linear */
169  real radius; /* 0=>linear gradient, else radius of a radial gradient */
170  enum spreadMethod sm;
171  int stop_cnt;
173 };
174 
175 struct pattern {
176  char *pattern;
177  real width, height; /* Pattern is scaled to be repeated every width/height (in user coordinates) */
179  /* Used during rasterization process */
180  struct bdfchar *pat;
182  int bminx, bminy, bwidth, bheight; /* of the pattern at bdfchar scale */
183 };
184 
185 struct brush {
187  float opacity; /* number between [0,1], only for svg/pdf */
188  struct pattern *pattern; /* A pattern to be tiled */
189  struct gradient *gradient; /* A gradient fill */
190 };
191 #define WIDTH_INHERITED (-1)
192 #define DASH_INHERITED 255 /* if the dashes[0]==0 && dashes[1]==DASH_INHERITED */
193 #define DASH_MAX 8
194 typedef unsigned char DashType;
195 struct pen {
196  struct brush brush;
199  float width;
202 };
203 
204 struct spline;
206 /* If you change this structure you may need to update MakeStrokeDlg */
207 /* and cvpalettes.c both contain statically initialized StrokeInfos */
208 typedef struct strokeinfo {
209  real radius; /* or major axis of pen */
210  enum linejoin join;
211  enum linecap cap;
212  enum si_type stroke_type;
213  unsigned int removeinternal: 1;
214  unsigned int removeexternal: 1;
215  unsigned int leave_users_center: 1; /* Don't move the pen so its center is at the origin */
220 /* For freehand tool */
223 /* End freehand tool */
224  void *data;
225  bigreal (*factor)(void *data,struct spline *spline,real t);
227 
230 
231 
234 
240 
242 
244 /* | | (flat) | | (simple) | | (complex) */
245 /* | | | / | / */
246 /* | | | / | / */
247 /* +----+ |/ \ / */
248 
249 typedef struct italicinfo {
250  double italic_angle;
252  struct hsquash lc, uc, neither;
254 
255  unsigned int transform_bottom_serifs: 1;
256  unsigned int transform_top_xh_serifs: 1; /* Those at x-height */
257  unsigned int transform_top_as_serifs: 1; /* Those at ascender-height */
258  unsigned int transform_diagon_serifs: 1; /* Those at baseline/xheight */
259 
260  unsigned int a_from_d: 1; /* replace the "a" glyph with the variant which looks like a "d" without an ascender */
261  /* When I say "f" I also mean "f_f" ligature, "longs", cyrillic phi and other things shaped like "f" */
262  unsigned int f_long_tail: 1; /* Some Italic fonts have the "f" grow an extension of the main stem below the baseline */
263  unsigned int f_rotate_top: 1; /* Most Italic fonts take the top curve of the "f", rotate it 180 and attach to the bottom */
264  unsigned int pq_deserif: 1; /* Remove a serif from the descender of p or q and replace with a secondary serif as above */
265 
266  /* Unsupported */
267  /* e becomes rounder, cross bar slightly slanted */
268  /* g closed counter at bottom */
269  /* k closed counter at top */
270  /* v-z diagonal stems become more curvatious */
271 
272  unsigned int cyrl_phi: 1; /* Gains an "f" like top, bottom treated like "f" */
273  unsigned int cyrl_i: 1; /* Turns into a latin u */
274  unsigned int cyrl_pi: 1; /* Turns into a latin n */
275  unsigned int cyrl_te: 1; /* Turns into a latin m */
276  unsigned int cyrl_sha: 1; /* Turns into a latin m rotated 180 */
277  unsigned int cyrl_dje: 1; /* Turns into a latin smallcaps T */
278  unsigned int cyrl_dzhe: 1; /* Turns into a latin u */
279  /* Is there a difference between dzhe and i? both look like u to me */
280 
281  /* Unsupported */
282  /* u432 curved B */
283  /* u433 strange gamma */
284  /* u434 normal delta */
285  /* u436 */
286  /* u43b lambda ? */
287  /* u43c */
288  /* u446 */
289  /* u449 */
290  /* u449 */
291  /* u44a */
292 
293 /* This half of the structure gets filled in later - see ITALICINFO_REMAINDER */
294  double tan_ia;
295  double x_height;
296  double pq_depth;
298  double emsize;
299  int order2;
300  struct splinefont *sf;
301  int layer;
303  struct splinepoint *f_start, *f_end; /* start has next pointing into the f head and up */
307 
308 #define ITALICINFO_REMAINDER 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0
309 
310 
311 typedef struct bluedata {
312  real xheight, xheighttop; /* height of "x" and "o" (u,v,w,x,y,z) */
313  real caph, caphtop; /* height of "I" and "O" */
314  real base, basebelow; /* bottom of "I" and "O" */
315  real ascent; /* height of "l" */
316  real descent; /* depth of "p" */
317  real numh, numhtop; /* height of "7" and "8" */ /* numbers with ascenders */
318  int bluecnt; /* If the private dica contains bluevalues... */
319  real blues[12][2]; /* 7 pairs from bluevalues, 5 from otherblues */
321 
322 #define BLUEDATA_EMPTY { \
323  0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, \
324  { { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, \
325  { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 } \
326  } \
327 }
328 
329 
330 typedef struct bdffloat {
333  unsigned int byte_data:1;
337 
338 /* OpenType does not document 'dflt' as a language, but we'll use it anyway. */
339 /* (Adobe uses it too) we'll turn it into a default entry when we output it. */
340 #define DEFAULT_LANG CHR('d','f','l','t')
341 /* The OpenType spec says in one place that the default script is 'dflt' and */
342 /* in another that it is 'DFLT'. 'DFLT' is correct */
343 #define DEFAULT_SCRIPT CHR('D','F','L','T')
344 #define REQUIRED_FEATURE CHR(' ','R','Q','D')
345 
347  ot_undef = 0, /* Not a lookup type */
348  gsub_start = 0x000, /* Not a lookup type */
349  gsub_single = 0x001,
350  gsub_multiple = 0x002,
351  gsub_alternate = 0x003,
352  gsub_ligature = 0x004,
353  gsub_context = 0x005,
355  /* GSUB extension 7 */
357  /* mac state machines */
358  morx_indic = 0x0fd,
359  morx_context = 0x0fe,
360  morx_insert = 0x0ff,
361  /* ********************* */
362  gpos_start = 0x100, /* Not a lookup type */
363 
364  gpos_single = 0x101,
365  gpos_pair = 0x102,
366  gpos_cursive = 0x103,
367  gpos_mark2base = 0x104,
369  gpos_mark2mark = 0x106,
370  gpos_context = 0x107,
372  /* GPOS extension 9 */
373  kern_statemachine = 0x1ff
374 
375  /* otlookup&0xff == lookup type for the appropriate table */
376  /* otlookup>>8: 0=>GSUB, 1=>GPOS */
377 };
378 
380  gsub_single_mask = 0x00001,
384  gsub_context_mask = 0x00010,
387  morx_indic_mask = 0x00080,
388  morx_context_mask = 0x00100,
389  morx_insert_mask = 0x00200,
390  /* ********************* */
391  gpos_single_mask = 0x00400,
392  gpos_pair_mask = 0x00800,
393  gpos_cursive_mask = 0x01000,
397  gpos_context_mask = 0x10000,
399  kern_statemachine_mask = 0x40000
400 };
401 
402 #define MAX_LANG 4 /* If more than this we allocate more_langs in chunks of MAX_LANG */
407  int lang_cnt;
409 };
410 
411 #define OPENTYPE_FEATURE_FRIENDLYNAMES_EMPTY { 0, NULL, NULL, 0 }
412 
413 
414 typedef struct featurescriptlanglist {
418  unsigned int ismac: 1; /* treat the featuretag as a mac feature/setting */
420 
423  pst_markclass=0xff00, pst_markset=0xffff0000 };
424 
427  char *suffix; /* for gsub_single, used to find a default replacement */
428  int16 separation, minkern; /* for gpos_pair, used to guess default kerning values */
429  struct otlookup *lookup;
430  unsigned int unused: 1;
431  unsigned int per_glyph_pst_or_kern: 1;
432  unsigned int anchor_classes: 1;
433  unsigned int vertical_kerning: 1;
434  unsigned int ticked: 1;
435  unsigned int kerning_by_touch: 1; /* for gpos_pair, calculate kerning so that glyphs will touch */
436  unsigned int onlyCloser: 1; /* for kerning classes */
437  unsigned int dontautokern: 1; /* for kerning classes */
438  struct kernclass *kc;
440  struct generic_asm *sm;
441  /* Each time an item is added to a lookup we must place it into a */
442  /* subtable. If it's a kerning class, fpst or state machine it has */
443  /* a subtable all to itself. If it's an anchor class it can share */
444  /* a subtable with other anchor classes (merge with). If it's a glyph */
445  /* PST it may share a subtable with other PSTs */
446  /* Note items may only be placed in lookups in which they fit. Can't */
447  /* put kerning data in a gpos_single lookup, etc. */
451  /* If a kerning subtable has too much stuff in it, we are prepared to */
452  /* break it up into several smaller subtables, each of which has */
453  /* an offset in this list (extra-subtables[0]==subtable_offset) */
454  /* the list is terminated by an entry of -1 */
455 };
456 
457 typedef struct otlookup {
458  struct otlookup *next;
460  uint32 lookup_flags; /* Low order: traditional flags, High order: markset index, only meaningful if pst_usemarkfilteringset set */
461  char *lookup_name;
464  unsigned int unused: 1; /* No subtable is used (call SFFindUnusedLookups before examining) */
465  unsigned int empty: 1; /* No subtable is used, and no anchor classes are used */
466  unsigned int store_in_afm: 1; /* Used for ligatures, some get stored */
467  /* 'liga' generally does, but 'frac' doesn't */
468  unsigned int needs_extension: 1; /* Used during opentype generation */
469  unsigned int temporary_kern: 1; /* Used when decomposing kerning classes into kern pairs for older formats */
470  unsigned int def_lang_checked: 1;
471  unsigned int def_lang_found: 1;
472  unsigned int ticked: 1;
473  unsigned int in_gpos: 1;
474  unsigned int in_jstf: 1;
475  unsigned int only_jstf: 1;
476  int16 subcnt; /* Actual number of subtables we will output */
477  /* Some of our subtables may contain no data */
478  /* Some may be too big and need to be broken up.*/
479  /* So this field may be different than just counting the subtables */
480  int lookup_index; /* used during opentype generation */
483  char *tempname;
485 
486 #define LOOKUP_SUBTABLE_EMPTY { NULL, NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }
487 #define OTLOOKUP_EMPTY { NULL, 0, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL }
488 
489 
490 typedef struct devicetab {
491  uint16 first_pixel_size, last_pixel_size; /* A range of point sizes to which this table applies */
492  int8 *corrections; /* a set of pixel corrections, one for each point size */
494 
495 typedef struct valdev { /* Value records can have four associated device tables */
501 
503 typedef struct anchorclass {
504  char *name; /* in utf8 */
506  uint8 type; /* anchorclass_type */
510  struct anchorclass *next;
512 
514 typedef struct anchorpoint {
518  unsigned int type: 4;
519  unsigned int selected: 1;
520  unsigned int ticked: 1;
521  unsigned int has_ttf_pt: 1;
524  struct anchorpoint *next;
526 
527 typedef struct kernpair {
528  // Note that the left character in the pair has the reference to the kerning pair, which in turn references the right character.
530  struct splinechar *sc;
532  uint16 kcid; /* temporary value */
533  DeviceTable *adjust; /* Only adjustment in one dimen, if more needed use pst */
534  struct kernpair *next;
536 
537 #define FF_KERNCLASS_FLAG_NATIVE 2 // If set, the class goes into groups.plist or kerning.plist.
538 #define FF_KERNCLASS_FLAG_FEATURE 4 // If set, the class or rule goes into the feature file. In the present configuration, this ought to be zero always.
539 #define FF_KERNCLASS_FLAG_NAMETYPE 8 // If unset (default), the class has a standard name, which translates to a U. F. O. name starting in public.kern, which may be illegal in the feature file. If set, it has a name like @MMK_.
540 #define FF_KERNCLASS_FLAG_NAMELEGACY 16 // If set, the class has a U. F. O. name starting in @kc as FontForge liked to do in the past.
541 #define FF_KERNCLASS_FLAG_VIRTUAL 32 // If unset (default), the class is a real character class and does not conflict with same-sided classes. If set, FontForge mostly ignores the class except for U. F. O. input/output.
542 #define FF_KERNCLASS_FLAG_FLATTEN 64 // If unset (default), the class gets exported as a class. If set, it gets exported as its first member (in order to support class-character kerns).
543 #define FF_KERNCLASS_FLAG_SINGLECHAR (FF_KERNCLASS_FLAG_VIRTUAL | FF_KERNCLASS_FLAG_FLATTEN) // We expect to see these used together.
544 
545 typedef struct kernclass {
546  int first_cnt, second_cnt; /* Count of classes for first and second chars */
547  char **firsts; /* list of a space separated list of char names */
548  char **seconds; /* one entry for each class. Entry 0 is null */
549  /* and means everything not specified elsewhere */
550  char **firsts_names; // We need to track the names of the classes in order to round-trip U. F. O. data.
552  int *firsts_flags; // This tracks the storage format of the class in U. F. O. (groups.plist or features.fea) and whether it's a single-character class.
553  int *seconds_flags; // We also track the name format (@MMK or public.kern).
555  uint16 kcid; /* Temporary value, used for many things briefly */
556  int16 *offsets; /* array of first_cnt*second_cnt entries with 0 representing no data */
558  DeviceTable *adjusts; /* array of first_cnt*second_cnt entries representing resolution-specific adjustments */
559  struct kernclass *next; // Note that, in most cases, a typeface needs only one struct kernclass since it can contain all classes.
560  int feature; // This indicates whether the kerning class came from a feature file. This is important during export.
562 
566  pst_lcaret /* must be pst_max-1, see charinfo.c*/,
568  /* These are not psts but are related so it's handly to have values for them */
570  /* And these are fpsts */
573  /* And these are used to specify a kerning pair where the current */
574  /* char is the final glyph rather than the initial one */
575  /* A kludge used when cutting and pasting features */
577  };
578 
579 struct vr {
582 };
583 
584 typedef struct generic_pst {
585  unsigned int ticked: 1;
586  unsigned int temporary: 1; /* Used in afm ligature closure */
587  /* enum possub_type*/ uint8 type;
589  struct generic_pst *next;
590  union {
591  struct vr pos;
592  struct { char *paired; struct vr *vr; } pair;
593  struct { char *variant; } subs;
594  struct { char *components; } mult, alt;
595  struct { char *components; struct splinechar *lig; } lig;
596  struct { int16 *carets; int cnt; } lcaret; /* Ligature caret positions */
597  } u;
598 } PST;
599 
600 typedef struct liglist {
602  struct splinechar *first; /* First component */
603  struct splinecharlist *components; /* Other than the first */
604  struct liglist *next;
605  int ccnt; /* Component count. (includes first component) */
607 
610 
611 struct seqlookup {
612  int seq;
613  struct otlookup *lookup;
614 };
615 
616 struct fpg { char *names, *back, *fore; };
618 struct fpv { int ncnt, bcnt, fcnt; char **ncovers, **bcovers, **fcovers; };
619 struct fpr { int always1, bcnt, fcnt; char **ncovers, **bcovers, **fcovers; char *replacements; };
620 
621 struct fpst_rule {
622  union {
623  /* Note: Items in backtrack area are in reverse order because that's how the OT wants them */
624  /* they need to be reversed again to be displayed to the user */
625  struct fpg glyph;
626  struct fpc class;
627  struct fpv coverage;
628  struct fpr rcoverage;
629  } u;
632 };
633 
634 typedef struct generic_fpst {
635  uint16 /*enum possub_type*/ type;
636  uint16 /*enum fpossub_format*/ format;
641  char **nclass, **bclass, **fclass;
642  struct fpst_rule *rules;
647 
649  asm_kern=0x11 };
650 enum asm_flags { asm_vert=0x8000, asm_descending=0x4000, asm_always=0x2000 };
651 
652 struct asm_state {
655  union {
656  struct {
657  struct otlookup *mark_lookup; /* for contextual glyph subs (tag of a nested lookup) */
658  struct otlookup *cur_lookup; /* for contextual glyph subs */
660  struct {
661  char *mark_ins;
662  char *cur_ins;
664  struct {
666  int kcnt;
667  } kern;
668  } u;
669 };
670 
671 typedef struct generic_asm { /* Apple State Machine */
672  struct generic_asm *next;
673  uint16 /*enum asm_type*/ type;
674  struct lookup_subtable *subtable; /* Lookup contains feature setting info */
675  uint16 flags; /* 0x8000=>vert, 0x4000=>r2l, 0x2000=>hor&vert */
677 
679  char **classes;
680  struct asm_state *state;
681 } ASM;
682 /* State Flags:
683  Indic:
684  0x8000 mark current glyph as first in rearrangement
685  0x4000 don't advance to next glyph
686  0x2000 mark current glyph as last
687  0x000f verb
688  0 = no change 8 = AxCD => CDxA
689  1 = Ax => xA 9 = AxCD => DCxA
690  2 = xD => Dx a = ABxD => DxAB
691  3 = AxD => DxA b = ABxD => DxBA
692  4 = ABx => xAB c = ABxCD => CDxAB
693  5 = ABx => xBA d = ABxCD => CDxBA
694  6 = xCD => CDx e = ABxCD => DCxAB
695  7 = xCD => DCx f = ABxCD => DCxBA
696  Contextual:
697  0x8000 mark current glyph
698  0x4000 don't advance to next glyph
699  Insert:
700  0x8000 mark current glyph
701  0x4000 don't advance to next glyph
702  0x2000 current is Kashida like
703  0x1000 mark is Kashida like
704  0x0800 current insert before
705  0x0400 mark insert before
706  0x03e0 count of chars to be inserted at current (31 max)
707  0x001f count of chars to be inserted at mark (31 max)
708  Kern:
709  0x8000 add current glyph to kerning stack
710  0x4000 don't advance to next glyph
711  0x3fff value offset
712 */
713 
714 struct jstf_prio {
715  OTLookup **enableShrink; /* Points to an array of lookups (GSUB or GPOS)*/
716  OTLookup **disableShrink; /* NULL terminated */
717  OTLookup **maxShrink; /* Array of GPOS like lookups */
721 };
722 
723 struct jstf_lang {
725  struct jstf_lang *next;
726  int cnt;
727  struct jstf_prio *prios;
728 };
729 
730 typedef struct jstf_script {
732  struct jstf_script *next;
733  char *extenders; /* list of glyph names */
734  struct jstf_lang *langs;
736 
737 struct macname {
738  struct macname *next;
739  uint16 enc; /* Platform specific encoding. 0=>mac roman, 1=>sjis, 7=>russian */
740  uint16 lang; /* Mac languages 0=>english, 1=>french, 2=>german */
741  char *name; /* Not a unicode string, uninterpreted mac encoded string */
742 };
743 
744 /* Wow, the GPOS 'size' feature stores a string in the name table just as mac */
745 /* features do */
746 /* And now (OTF 1.6) GSUB 'ss01'-'ss20' do too */
747 struct otfname {
748  struct otfname *next;
749  uint16 lang; /* windows language code */
750  char *name; /* utf8 */
751 };
752 
753 struct otffeatname {
754  uint32 tag; /* Feature tag */
755  struct otfname *names;
756  struct otffeatname *next;
757  uint16 nid; /* temporary value */
758 };
759 
760 struct macsetting {
761  struct macsetting *next;
764  struct macname *setname;
765  unsigned int initially_enabled: 1;
766 };
767 
768 typedef struct macfeat {
769  struct macfeat *next;
772  uint8 default_setting; /* Apple's docs say both that this is a byte and a short. It's a byte */
773  uint16 strid; /* Temporary value, used when reading in */
774  struct macname *featname;
777 
778 typedef struct refbdfc {
779  unsigned int checked: 1;
780  unsigned int selected: 1;
784  struct refbdfc *next;
785  struct bdfchar *bdfc;
787 
788 struct bdfcharlist {
789  struct bdfchar *bc;
790  struct bdfcharlist *next;
791 };
792 
793 typedef struct bdfchar {
794  struct splinechar *sc;
799  struct refbdfc *refs;
800  int orig_pos;
801  int16 pixelsize; /* for undoes */
802  struct bitmapview *views;
803  struct undoes *undoes;
804  struct undoes *redoes;
805  unsigned int changed: 1;
806  unsigned int byte_data: 1; /* for anti-aliased chars entries are grey-scale bytes not bw bits */
807  unsigned int widthgroup: 1; /* for ttf bitmap output */
808  unsigned int isreference: 1; /* for ttf bitmap input, */
809  unsigned int ticked: 1;
810  uint8 depth; /* for ttf bitmap output */
816 
823 
824 #define UNDO_LAYER_UNKNOWN -1
825 
826 
828 {
833  sfut_noop
834 };
835 
836 /**
837  * A spline font level undo stack. undoes are doubly linked using the
838  * 'ln' member and carry some user presentable description of what the
839  * undo relates to in 'msg'.
840  *
841  * The sfdchunk is a pointer to an SFD fragment which will apply the
842  * undo to the current state. For example, it might contain
843  * information about the old value of kerning pairs which can be used
844  * to restore state to how it was. Note that the sfdchunk might only
845  * be partial, containing only enough information to restore the state
846  * which changed when the undo was created.
847  */
848 
849 typedef struct enc {
850  char *enc_name;
851  int char_cnt; /* Size of the next two arrays */
852  int32 *unicode; /* unicode value for each encoding point */
853  char **psnames; /* optional postscript name for each encoding point */
854  struct enc *next;
855  unsigned int builtin: 1;
856  unsigned int hidden: 1;
857  unsigned int only_1byte: 1;
858  unsigned int has_1byte: 1;
859  unsigned int has_2byte: 1;
860  unsigned int is_unicodebmp: 1;
861  unsigned int is_unicodefull: 1;
862  unsigned int is_custom: 1;
863  unsigned int is_original: 1;
864  unsigned int is_compact: 1;
865  unsigned int is_japanese: 1;
866  unsigned int is_korean: 1;
867  unsigned int is_tradchinese: 1;
868  unsigned int is_simplechinese: 1;
872  char *iconv_name; /* For compatibility to old versions we might use a different name from that used by iconv. */
877  unsigned int is_temporary: 1; /* freed when the map gets freed */
878  int char_max; /* Used by temporary encodings */
880 
881 struct renames { char *from; char *to; };
882 
883 typedef struct namelist {
884  struct namelist *basedon;
885  char *title;
886  const char ***unicode[17];
887  struct namelist *next;
888  struct renames *renames;
890  char *a_utf8_name;
892 
895 
897 
898 typedef struct encmap { /* A per-font map of encoding to glyph id */
899  int32 *map; /* Map from encoding to glyphid */
900  int32 *backmap; /* Map from glyphid to encoding */
901  int enccount; /* used size of the map array */
902  /* strictly speaking this might include */
903  /* glyphs that are not encoded, but which */
904  /* are displayed after the proper encoding */
905  int encmax; /* allocated size of the map array */
906  int backmax; /* allocated size of the backmap array */
907  struct remap *remap;
909  unsigned int ticked: 1;
911 
913 
914 typedef struct bdfprops {
915  char *name; /* These include both properties (like SLANT) and non-properties (like FONT) */
916  int type;
917  union {
918  char *str;
919  char *atom;
920  int val;
921  } u;
923 
924 typedef struct bdffont {
925  struct splinefont *sf;
926  int glyphcnt, glyphmax; /* used & allocated sizes of glyphs array */
927  BDFChar **glyphs; /* an array of charcnt entries */
930  int16 layer; /* for piecemeal fonts */
931  unsigned int piecemeal: 1;
932  unsigned int bbsized: 1;
933  unsigned int ticked: 1;
934  unsigned int unhinted_freetype: 1;
935  unsigned int recontext_freetype: 1;
936  struct bdffont *next;
937  struct clut *clut;
938  char *foundry;
939  int res;
941  uint16 truesize; /* for bbsized fonts */
943  int16 prop_max; /* only used within bdfinfo dlg */
945  uint16 ptsize, dpi; /* for piecemeal fonts */
947 
948 #define HntMax 96 /* PS says at most 96 hints */
949 typedef uint8 HintMask[HntMax/8];
950 
952 typedef struct splinepoint {
954  BasePoint nextcp; /* control point */
955  BasePoint prevcp; /* control point */
956  unsigned int nonextcp:1;
957  unsigned int noprevcp:1;
958  unsigned int nextcpdef:1;
959  unsigned int prevcpdef:1;
960  unsigned int selected:1; /* for UI */
961  unsigned int nextcpselected: 2; /* Is the next BCP selected */
962  unsigned int prevcpselected: 2; /* Is the prev BCP selected */
963  unsigned int pointtype:2;
964  unsigned int isintersection: 1;
965  unsigned int flexy: 1; /* When "freetype_markup" is on in charview.c:DrawPoint */
966  unsigned int flexx: 1; /* flexy means select nextcp, and flexx means draw circle around nextcp */
967  unsigned int roundx: 1; /* For true type hinting */
968  unsigned int roundy: 1; /* For true type hinting */
969  unsigned int dontinterpolate: 1; /* in ttf, don't imply point by interpolating between cps */
970  unsigned int ticked: 1;
971  unsigned int watched: 1;
972  /* 1 bits left... */
973  uint16 ptindex; /* Temporary value used by metafont routine */
974  uint16 ttfindex; /* Truetype point index */
975  /* Special values 0xffff => point implied by averaging control points */
976  /* 0xfffe => point created with no real number yet */
977  /* (or perhaps point in context where no number is possible as in a glyph with points & refs) */
978  uint16 nextcpindex; /* Truetype point index */
979  struct spline *next;
980  struct spline *prev;
982  char* name;
984 
986 
987 typedef struct linelist {
989  struct linelist *next;
990  /* The first two fields are constant for the linelist, the next ones */
991  /* refer to a particular screen. If some portion of the line from */
992  /* this point to the next one is on the screen then set cvli_onscreen */
993  /* if this point needs to be clipped then set cvli_clipped */
994  /* asend and asstart are the actual screen locations where this point */
995  /* intersects the clip edge. */
996  enum linelist_flags flags;
999 
1000 typedef struct linearapprox {
1002  unsigned int oneline: 1;
1003  unsigned int onepoint: 1;
1004  unsigned int any: 1; /* refers to a particular screen */
1005  struct linelist *lines;
1008 
1009 typedef struct spline1d {
1010  real a, b, c, d;
1012 
1013 /**
1014  *
1015  * 2013Note: If you are altering from->me.x and y then you will
1016  * probably have to modify splines[] to match your change.
1017  * eg, moving both ends of a spline up/down by changing their
1018  * to/from will also probably need an update to splines[ 0 | 1 ].d to
1019  * match.
1020  */
1021 typedef struct spline {
1022  unsigned int islinear: 1; /* No control points */
1023  unsigned int isquadratic: 1; /* probably read in from ttf */
1024  unsigned int isticked: 1;
1025  unsigned int isneeded: 1; /* Used in remove overlap */
1026  unsigned int isunneeded: 1; /* Used in remove overlap */
1027  unsigned int exclude: 1; /* Used in remove overlap varient: exclude */
1028  unsigned int ishorvert: 1;
1029  unsigned int knowncurved: 1; /* We know that it curves */
1030  unsigned int knownlinear: 1; /* it might have control points, but still traces out a line */
1031  /* If neither knownlinear nor curved then we haven't checked */
1032  unsigned int order2: 1; /* It's a bezier curve with only one cp */
1033  unsigned int touched: 1;
1034  unsigned int leftedge: 1;
1035  unsigned int rightedge: 1;
1036  unsigned int acceptableextrema: 1; /* This spline has extrema, but we don't care */
1039  Spline1D splines[2]; /* splines[0] is the x spline, splines[1] is y */
1041  /* Posible optimizations:
1042  Precalculate bounding box
1043  Precalculate min/max/ points of inflection
1044  */
1046 
1047 #ifndef _NO_LIBSPIRO
1048 # include "spiroentrypoints.h"
1049 #else
1050 # define SPIRO_OPEN_CONTOUR '{'
1051 # define SPIRO_CORNER 'v'
1052 # define SPIRO_G4 'o'
1053 # define SPIRO_G2 'c'
1054 # define SPIRO_LEFT '['
1055 # define SPIRO_RIGHT ']'
1056 # define SPIRO_END 'z'
1057 typedef struct { /* Taken from spiro.h because I want */
1058  double x; /* to be able to compile for spiro */
1059  double y; /* even on a system without it */
1060  char ty;
1061 } spiro_cp;
1062 #endif
1063 #define SPIRO_SELECTED(cp) ((cp)->ty&0x80)
1064 #define SPIRO_DESELECT(cp) ((cp)->ty&=~0x80)
1065 #define SPIRO_SELECT(cp) ((cp)->ty|=0x80)
1066 #define SPIRO_SPL_OPEN(spl) ((spl)->spiro_cnt>1 && ((spl)->spiros[0].ty&0x7f)==SPIRO_OPEN_CONTOUR)
1067 
1068 #define SPIRO_NEXT_CONSTRAINT SPIRO_RIGHT /* The curve is on the next side of the constraint point */
1069 #define SPIRO_PREV_CONSTRAINT SPIRO_LEFT /* The curve is on the prev side of the constraint point */
1070 
1071 typedef struct splinepointlist {
1076  /* These could be bit fields, but bytes are easier to access and we */
1077  /* don't need the space (yet) */
1079  uint8 beziers_need_optimizer; /* If the spiros have changed in spiro mode, then reverting to bezier mode might, someday, run a simplifier */
1080  uint8 is_clip_path; /* In type3/svg fonts */
1081  int start_offset; // This indicates which point is the canonical first for purposes of outputting to U. F. O..
1084 
1085 
1086 struct reflayer {
1087  unsigned int background: 1;
1088  unsigned int order2: 1;
1089  unsigned int anyflexes: 1;
1090  unsigned int dofill: 1;
1091  unsigned int dostroke: 1;
1092  unsigned int fillfirst: 1;
1093  struct brush fill_brush;
1094  struct pen stroke_pen;
1096 };
1097 
1098 typedef struct refchar {
1099  unsigned int checked: 1;
1100  unsigned int selected: 1;
1101  unsigned int point_match: 1; /* match_pt* are point indexes */
1102  /* and need to be converted to a */
1103  /* translation after truetype readin */
1104  unsigned int encoded: 1; /* orig_pos is actually an encoded value, used for old sfd files */
1105  unsigned int justtranslated: 1; /* The transformation matrix specifies a translation (or is identity) */
1106  unsigned int use_my_metrics: 1; /* Retain the ttf "use_my_metrics" info. */
1107  /* important for glyphs with instructions which change the width used */
1108  /* inside composites */
1109  unsigned int round_translation_to_grid: 1; /* Retain the ttf "round_to_grid" info. */
1110  unsigned int point_match_out_of_date: 1; /* Someone has edited a base glyph */
1113  int unicode_enc; /* used by paste */
1114  real transform[6]; /* transformation matrix (first 2 rows of a 3x3 matrix, missing row is 0,0,1) */
1115  struct reflayer *layers;
1117  struct refchar *next;
1119  struct splinechar *sc;
1123 
1124 /* Some stems may appear, disappear, reapear several times */
1125 /* Serif stems on I which appear at 0, disappear, reappear at top */
1126 /* Or the major vertical stems on H which disappear at the cross bar */
1127 typedef struct hintinstance {
1128  real begin; /* location in the non-major direction*/
1129  real end; /* width/height in non-major direction*/
1130  unsigned int closed: 1;
1131  short int counternumber;
1134 
1136 typedef real _MMArray[2][MmMax];
1137 
1138 typedef struct steminfo {
1139  struct steminfo *next;
1140  unsigned int hinttype: 2; /* Only used by undoes */
1141  unsigned int ghost: 1; /* this is a ghost stem hint. As such truetype should ignore it, type2 output should negate it, and type1 should use as is */
1142  /* stored width will be either 20 or 21 */
1143  /* Type2 says: -20 is "width" of top edge, -21 is "width" of bottom edge, type1 accepts either */
1144  unsigned int haspointleft:1;
1145  unsigned int haspointright:1;
1146  unsigned int hasconflicts:1;/* Does this stem have conflicts within its cluster? */
1147  unsigned int used: 1; /* Temporary for counter hints or hint substitution */
1148  unsigned int tobeused: 1; /* Temporary for counter hints or hint substitution */
1149  unsigned int active: 1; /* Currently active hint in Review Hints dlg */
1150  /* displayed differently in char display */
1151  unsigned int enddone: 1; /* Used by ttf instructing, indicates a prev */
1152  /* hint had the same end as this one (so */
1153  /* the points on the end line have been */
1154  /* instructed already */
1155  unsigned int startdone: 1; /* Used by ttf instructing */
1156  /*unsigned int backwards: 1;*/ /* If we think this hint is better done with a negative width */
1157  unsigned int reordered: 1; /* In AutoHinting. Means we changed the start of the hint, need to test for out of order */
1158  unsigned int pendingpt: 1; /* A pending stem creation, not a true stem */
1159  unsigned int linearedges: 1;/* If we have a nice rectangle then we aren't */
1160  /* interested in the orientation which is */
1161  /* wider than long */
1162  int16 hintnumber; /* when dumping out hintmasks we need to know */
1163  /* what bit to set for this hint */
1164  union {
1165  int mask; /* Mask of all references that use this hint */
1166  /* in type2 output */
1167  _MMArray *unblended /*[2][MmMax]*/; /* Used when reading in type1 mm hints */
1168  } u;
1169  real start; /* location at which the stem starts */
1170  real width; /* or height */
1171  HintInstance *where; /* location(s) in the other coord */
1173 
1174 typedef struct dsteminfo {
1175  struct dsteminfo *next; /* First two fields match those in steminfo */
1176  unsigned int hinttype: 2; /* Only used by undoes */
1177  unsigned int used: 1; /* used only by tottf.c:gendinstrs, metafont.c to mark a hint that has been dealt with */
1179  HintInstance *where; /* location(s) along the unit vector */
1181 
1182 typedef struct minimumdistance {
1183  /* If either point is NULL it will be assumed to mean either the origin */
1184  /* or the width point (depending on which is closer). This allows user */
1185  /* to control metrics... */
1187  unsigned int x: 1;
1188  unsigned int done: 1;
1191 
1192 typedef struct layer /* : reflayer */{
1193  unsigned int background: 1;
1194  unsigned int order2: 1;
1195  unsigned int anyflexes: 1;
1196  unsigned int dofill: 1;
1197  unsigned int dostroke: 1;
1198  unsigned int fillfirst: 1;
1199  struct brush fill_brush;
1200  struct pen stroke_pen;
1202  RefChar *refs; /* Only in foreground layer(s) */
1205  void *python_persistent; /* If python this will hold a python object, if not python this will hold a string containing a pickled object. We do nothing with it (if not python) except save it back out unchanged */
1208 
1209 enum layer_type { ly_all=-2, ly_grid= -1, ly_back=0, ly_fore=1,
1210  /* Possibly other foreground layers for type3 things */
1211  /* Possibly other background layers for normal fonts */
1212  ly_none = -3
1213  };
1214 
1215 struct gv_part {
1216  char *component;
1217  unsigned int is_extender: 1; /* This component may be skipped or repeated */
1221 };
1222 
1223 /* For the 'MATH' table (and for TeX) */
1225  char *variants; /* Space separated list of glyph names */
1226 /* Glyph assembly */
1227  int16 italic_correction; /* Of the composed glyph */
1230  struct gv_part *parts;
1231 };
1232 
1237 };
1238 
1239 /* For the 'MATH' table */
1241  int cnt; /* There is one more kern entry than height entry */
1242  /* So the last mkd should have its height ignored */
1243  /* The MATH table stores the height count, I think the kern count */
1244  /* is more useful (and that's what I use here). They differ by 1 */
1246 };
1247 
1248 struct mathkern {
1249  struct mathkernvertex top_right;
1250  struct mathkernvertex top_left;
1252  struct mathkernvertex bottom_left;
1253 };
1254 
1256  pds_odd = 0x1, /* Odd number of entries */
1257  pds_outoforder = 0x2, /* Bluevalues should be listed in order */
1258  pds_toomany = 0x4, /* arrays are of limited sizes */
1259  pds_tooclose = 0x8, /* adjacent zones must not be within 2*bluefuzz+1 (or 3, if bluefuzz omitted) */
1260  pds_notintegral= 0x10, /* Must be integers */
1261  pds_toobig = 0x20, /* within pair difference have some relation to BlueScale but the docs make no sense to me */
1262  pds_shift = 8, /* BlueValues/OtherBlues, unshifted, FamilyBlues/FamilyOtherBlues shifted once */
1263 
1264  pds_missingblue = 0x010000,
1265  pds_badbluefuzz = 0x020000,
1266  pds_badbluescale = 0x040000,
1267  pds_badstdhw = 0x080000,
1268  pds_badstdvw = 0x100000,
1269  pds_badstemsnaph = 0x200000,
1270  pds_badstemsnapv = 0x400000,
1271  pds_stemsnapnostdh = 0x0800000,
1272  pds_stemsnapnostdv = 0x1000000,
1273  pds_badblueshift = 0x2000000
1274 
1275 };
1276 
1278  vs_known=0x01, /* It has been validated */
1282  vs_flippedreferences=0x10, /* special case of wrong direction */
1285  /* Next few are postscript only */
1289  /* Next few are only for fontlint */
1290  /* These are relative to maxp values which ff would fix on generating a font */
1298  /* vs_maxp_prepfpgmtoolong=0x20000, */ /* I think I was wrong about this "error" */
1299  /* Oops, we need another one, two, for the glyphs */
1301  vs_nonintegral = 0x80000, /* This will never be interesting in a real font, but might be in an sfd file */
1302  vs_missinganchor = 0x100000,
1303  vs_dupname = 0x200000,
1304  vs_dupunicode = 0x400000,
1306 
1312  };
1313 
1314 struct splinecharlist { struct splinechar *sc; struct splinecharlist *next;};
1315 
1316 struct altuni { struct altuni *next; int32 unienc, vs; uint32 fid; };
1317  /* vs is the "variation selector" a unicode codepoint which modifieds */
1318  /* the code point before it. If vs is -1 then unienc is just an */
1319  /* alternate encoding (greek Alpha and latin A), but if vs is one */
1320  /* of unicode's variation selectors then this glyph is somehow a */
1321  /* variant shape. The specifics depend on the selector and script */
1322  /* fid is currently unused, but may, someday, be used to do ttcs */
1323  /* NOTE: GlyphInfo displays vs==-1 as vs==0, and fixes things up */
1324 
1325 typedef struct splinechar {
1326  char *name;
1328  int orig_pos; /* Original position in the glyph list */
1330  int16 lsidebearing; /* only used when reading in a type1 font */
1331  /* Or an otf font where it is the subr number of a refered character */
1332  /* or a ttf font without bit 1 of head.flags set */
1333  /* 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 */
1334  /* or when generating morx where it is the mask of tables in which the glyph occurs */
1335  /* Always a temporary value */
1336  int ttf_glyph; /* only used when writing out a ttf or otf font */
1337  Layer *layers; /* layer[0] is background, layer[1] foreground */
1338  /* In type3 fonts 2-n are also foreground, otherwise also background */
1340  StemInfo *hstem; /* hstem hints have a vertical offset but run horizontally */
1341  StemInfo *vstem; /* vstem hints have a horizontal offset but run vertically */
1342  DStemInfo *dstem; /* diagonal hints for ttf */
1344 
1347  unsigned int changed: 1;
1348  unsigned int changedsincelasthinted: 1;
1349  unsigned int manualhints: 1;
1350  unsigned int ticked: 1; /* For reference character processing */
1351  /* And fontview processing */
1352  unsigned int changed_since_autosave: 1;
1353  unsigned int widthset: 1; /* needed so an emspace char doesn't disappear */
1354  unsigned int vconflicts: 1; /* Any hint overlaps in the vstem list? */
1355  unsigned int hconflicts: 1; /* Any hint overlaps in the hstem list? */
1356  unsigned int searcherdummy: 1;
1357  unsigned int changed_since_search: 1;
1358  unsigned int wasopen: 1;
1359  unsigned int namechanged: 1;
1360  unsigned int blended: 1; /* An MM blended character */
1361  unsigned int ticked2: 1;
1362  unsigned int glyph_class: 3; /* 0=> fontforge determines class automagically, else one more than the class value in gdef so 2+1=>lig, 3+1=>mark */
1363  unsigned int numberpointsbackards: 1;
1364  unsigned int instructions_out_of_date: 1;
1365  unsigned int complained_about_ptnums: 1;
1366  unsigned int vs_open: 1;
1367  unsigned int unlink_rm_ovrlp_save_undo: 1;
1368  unsigned int inspiro: 1;
1369  unsigned int lig_caret_cnt_fixed: 1;
1370  unsigned int suspendMetricsViewEventPropagation: 1; /* rect tool might do this while drawing */
1371  /* 5 bits left (one more if we ignore compositionunit below) */
1372 #if HANYANG
1373  unsigned int compositionunit: 1;
1374  int16 jamo, varient;
1375 #endif
1377  /* The dependents list is a list of all characters which refenence*/
1378  /* the current character directly */
1379  KernPair *kerns; // Note that the left character in the pair has the reference to the kerning pair, which in turn references the right character.
1381  PST *possub; /* If we are a ligature then this tells us what */
1382  /* It may also contain a bunch of other stuff now */
1383  LigList *ligofme; /* If this is the first character of a ligature then this gives us the list of possible ones */
1384  /* this field must be regenerated before the font is saved */
1385  char *comment; /* in utf8 */
1386  uint32 /*Color*/ color;
1392  struct altuni *altuni;
1393 /* for TeX */
1395 /* TeX also uses italic_correction and glyph variants below */
1396 /* For the 'MATH' table (and for TeX) */
1397  unsigned int is_extended_shape: 1;
1399  int16 top_accent_horiz; /* MATH table allows you to specific a*/
1400  /* horizontal anchor for accent attachments, vertical */
1401  /* positioning is done elsewhere */
1407 /* End of MATH/TeX fields */
1408 #ifndef _NO_PYTHON
1409  void *python_sc_object;
1410  void *python_temporary;
1411 #endif
1412 #if 0
1413  // Python persistent data is now in the layers.
1414  void *python_persistent; /* If python this will hold a python object, if not python this will hold a string containing a pickled object. We do nothing with it (if not python) except save it back out unchanged */
1415  int python_persistent_has_lists;
1416 #endif // 0
1417  /* If the glyph is used as a tile pattern, then the next two values */
1418  /* determine the amount of white space around the tile. If extra is*/
1419  /* non-zero then we add it to the max components of the bbox and */
1420  /* subtract it from the min components. If extra is 0 then tile_bounds*/
1421  /* will be used. If tile_bounds is all zeros then the glyph's bbox */
1422  /* will be used. */
1423  real tile_margin; /* If the glyph is used as a tile */
1425  char * glif_name; // This stores the base name of the glyph when saved to U. F. O..
1427 
1428 #define TEX_UNDEF 0x7fff
1429 
1436 struct ttflangname {
1437  int lang;
1438  char *names[ttf_namemax]; /* in utf8 */
1439  int frommac[(ttf_namemax+31)/32]; /* Used when parsing the 'name' table */
1441 };
1442 
1443 struct MATH {
1444 /* From the MATH Constants subtable (constants for positioning glyphs. Not PI)*/
1552 /* Global constants from other subtables */
1553  uint16 MinConnectorOverlap; /* in the math variants sub-table */
1554 };
1555 
1567  lvs_bad_sfnt_header = 0x200
1568  };
1569 
1570 typedef struct layerinfo {
1571  char *name;
1572  unsigned int background: 1; /* Layer is to be treated as background: No width, images, not worth outputting */
1573  unsigned int order2: 1; /* Layer's data are order 2 bezier splines (truetype) rather than order 3 (postscript) */
1574  /* In all glyphs in the font */
1575  unsigned int ticked: 1;
1576  char * ufo_path;
1578 
1579 /* Baseline data from the 'BASE' table */
1581  uint32 lang; /* also used for feature tag */
1585 };
1586 
1587 struct basescript {
1589  struct basescript *next;
1590  int def_baseline; /* index [0-baseline_cnt) */
1591  int16 *baseline_pos; /* baseline_cnt of these */
1592  struct baselangextent *langs; /* Language specific extents (may be NULL) */
1593  /* The default one has the tag DEFAULT_LANG */
1594 };
1595 
1596 struct Base {
1599  /* A font does not need to provide info on all baselines, but if one script */
1600  /* talks about a baseline, then all must. So the set of baselines is global*/
1602 };
1603 
1604 struct pfminfo { /* A misnomer now. OS/2 info would be more accurate, but that's stuff in here from all over ttf files */
1605  unsigned int pfmset: 1;
1606  unsigned int winascent_add: 1;
1607  unsigned int windescent_add: 1;
1608  unsigned int hheadascent_add: 1;
1609  unsigned int hheaddescent_add: 1;
1610  unsigned int typoascent_add: 1;
1611  unsigned int typodescent_add: 1;
1612  unsigned int subsuper_set: 1;
1613  unsigned int panose_set: 1;
1614  unsigned int hheadset: 1;
1615  unsigned int vheadset: 1;
1616  unsigned int hascodepages: 1;
1617  unsigned int hasunicoderanges: 1;
1618  unsigned char pfmfamily;
1621  char panose[10];
1622  /* A subset of OS/2 fsSelection, used for style mapping. */
1623  /* Must agree with macStyle per otspec, takes precedence. */
1624  /* Can't use macStyle because it doesn't have a "regular" bit unlike the OS/2 component. */
1627  int16 linegap; /* from hhea */
1628  int16 vlinegap; /* from vhea */
1636  char os2_vendor[4];
1640 };
1641 
1642 struct ttf_table {
1646  struct ttf_table *next;
1647  FILE *temp; /* Temporary storage used during generation */
1648 };
1649 
1651 
1652 struct texdata {
1653  enum texdata_type type;
1654  int32 params[22]; /* param[6] has different meanings in normal and math fonts */
1655 };
1656 
1657 struct gasp {
1660 };
1661 
1663  // This matches struct glyphclasses from featurefile.c for now. We may make the references numeric in the future.
1664  // There may be a matching entry as a class elsewhere. For now, the output driver is responsible for eliminating duplicates.
1665  // In the interest of preserving orderings, we shall output from here, checking for value overrides from kerning classes on each kerning group entry.
1668 };
1669 
1671  // This stores raw offsets as read from kerning.plist.
1672  // FontForge shall output these after native data and shall output only those for which it has not emitted native data.
1673  char *left;
1674  char *right;
1675  int offset;
1677 };
1678 
1679 typedef struct splinefont {
1682  char *copyright;
1683  char *filename; /* sfd name. NULL if we open a font, that's origname */
1685  char *version;
1686  real italicangle, upos, uwidth; /* In font info */
1687  int ascent, descent, invalidem; // If invalidem, then we use the format-specific ascent and descent on export.
1688  int uniqueid; /* Not copied when reading in!!!! */
1689  int glyphcnt, glyphmax; /* allocated size of glyphs array */
1691  unsigned int changed: 1;
1692  unsigned int changed_since_autosave: 1;
1693  unsigned int changed_since_xuidchanged: 1;
1694  unsigned int display_antialias: 1;
1695  unsigned int display_bbsized: 1;
1696  unsigned int dotlesswarn: 1; /* User warned that font doesn't have a dotless i character */
1697  unsigned int serifcheck: 1; /* Have we checked to see if we have serifs? */
1698  unsigned int issans: 1; /* We have no serifs */
1699  unsigned int isserif: 1; /* We have serifs. If neither set then we don't know. */
1700  unsigned int hasvmetrics: 1; /* We've got vertical metric data and should output vhea/vmtx/VORG tables */
1701  unsigned int loading_cid_map: 1;
1702  unsigned int dupnamewarn: 1; /* Warn about duplicate names when loading bdf font */
1703  unsigned int encodingchanged: 1; /* Font's encoding has changed since it was loaded */
1704  unsigned int multilayer: 1; /* only applies if TYPE3 is set, means this font can contain strokes & fills */
1705  /* I leave it in so as to avoid cluttering up code with #ifdefs */
1706  unsigned int strokedfont: 1;
1707  unsigned int new: 1; /* A new and unsaved font */
1708  unsigned int compacted: 1; /* only used when opening a font */
1709  unsigned int backedup: 2; /* 0=>don't know, 1=>no, 2=>yes */
1710  unsigned int use_typo_metrics: 1; /* The standard says to. But MS */
1711  /* seems to feel that isn't good */
1712  /* enough and has created a bit */
1713  /* to mean "really use them" */
1714  unsigned int weight_width_slope_only: 1; /* This bit seems stupid to me */
1715  unsigned int save_to_dir: 1; /* Loaded from an sfdir collection rather than a simple sfd file */
1716  unsigned int head_optimized_for_cleartype: 1;/* Bit in the 'head' flags field, if unset "East Asian fonts in the Windows Presentation Framework (Avalon) will not be hinted" */
1717  unsigned int ticked: 1;
1718  unsigned int internal_temp: 1; /* Internal temporary font to be passed to freetype for rasterizing. Don't complain about oddities. Don't generate GPOS/GSUB tables, etc. */
1719  unsigned int complained_about_spiros: 1;
1720  unsigned int use_xuid: 1; /* Adobe has deprecated these two */
1721  unsigned int use_uniqueid: 1; /* fields. Mostly we don't want to use them */
1722  /* 2 bits left */
1723  struct metricsview *metrics;
1724  enum uni_interp uni_interp;
1726  EncMap *map; /* only used when opening a font to provide original default encoding */
1728  char *origname; /* filename of font file (ie. if not an sfd) */
1730  int display_size; /* a val <0 => Generate our own images from splines, a value >0 => find a bdf font of that size */
1731  struct psdict *private; /* read in from type1 file or provided by user */
1732  char *xuid;
1733  struct pfminfo pfminfo;
1739  struct splinefont *cidmaster; /* Top level cid font */
1740  float cidversion;
1741 #if HANYANG
1742  struct compositionrules *rules;
1743 #endif
1744  char *comments; /* Used to be restricted to ASCII, now utf8 */
1745  char *fontlog;
1747  int top_enc;
1751  /* We copy: fpgm, prep, cvt, maxp (into ttf_tables) user can ask for others, into saved*/
1752  char **cvt_names;
1753  /* The end of this array is marked by a special entry: */
1754 #define END_CVT_NAMES ((char *) (~(intpt) 0))
1755  struct instrdata *instr_dlgs; /* Pointer to all table and character instruction dlgs in this font */
1756  struct shortview *cvt_dlg;
1757  struct kernclasslistdlg *kcld, *vkcld;
1758  struct kernclassdlg *kcd;
1759  struct texdata texdata;
1761  /* Apple morx subtables become gsub, and kern subtables become gpos */
1765  ASM *sm; /* asm is a keyword */
1767  char *chosenname; /* Set for files with multiple fonts in them */
1768  struct mmset *mm; /* If part of a multiple master set */
1770  char *fondname; /* For use in generating mac families */
1771  /* from the GPOS 'size' feature. design_size, etc. are measured in tenths of a point */
1772  /* bottom is exclusive, top is inclusive */
1773  /* if any field is 0, it is undefined. All may be undefined, All may be */
1774  /* defined, or design_size may be defined without any of the others */
1775  /* but we can't define the range without defining the other junk */
1776  /* Name must contain an English language name, may contain others */
1783 /* For GDEF Mark Attachment Class -- used in lookup flags */
1784 /* As usual, class 0 is unused */
1786  char **mark_classes; /* glyph name list */
1787  char **mark_class_names; /* used within ff, utf8 (the name we've given to this class of marks) */
1788 /* For GDEF Mark Attachment Sets -- used in lookup flags */
1789 /* but here, set 0 is meaningful, since pst_usemarkfilteringset tells us */
1791  char **mark_sets; /* glyph name list */
1792  char **mark_set_names; /* used within ff, utf8 (the name we've given to this class of marks) */
1793  struct ff_glyphclasses *groups; // This stores arbitrary named character lists for use in kerning or in the feature file.
1796  long long creationtime; /* seconds since 1970 */
1797  long long modificationtime;
1798  short os2_version; /* 0 means default rather than the real version 0 */
1799  short compression; /* If we opened a compressed sfd file, then save it out compressed too */
1800  short gasp_version; /* 0/1 currently */
1801  short gasp_cnt;
1802  struct gasp *gasp;
1803  struct MATH *MATH;
1804  float sfd_version; /* Used only when reading in an sfd file */
1805  struct gfi_data *fontinfo;
1806  struct val_data *valwin;
1807 #if !defined(_NO_PYTHON)
1808  void *python_temporary;
1809 #endif
1810  void *python_persistent; /* If python this will hold a python object, if not python this will hold a string containing a pickled object. We do nothing with it (if not python) except save it back out unchanged */
1811  int python_persistent_has_lists; // This affects whether arrays exist as tuples or as lists (thus allowing us to use tuples for foreign data).
1818  int extrema_bound; /* Splines do not count for extrema complaints when the distance between the endpoints is less than or equal to this */
1821 #define sfntRevisionUnset 0x44445555
1823 #define woffUnset 0x4455
1826  real ufo_ascent, ufo_descent; /* I don't know what these mean, they don't seem to correspond to any other ascent/descent pair, but retain them so round-trip ufo input/output leaves them unchanged */
1827  /* ufo_descent is negative */
1829  struct sfundoes *undoes;
1831  int preferred_kerning; // 1 for U. F. O. native, 2 for feature file, 0 undefined. Input functions shall flag 2, I think. This is now in S. F. D. in order to round-trip U. F. O. consistently.
1833 
1834 struct axismap {
1835  int points; /* size of the next two arrays */
1836  real *blends; /* between [0,1] ordered so that blend[0]<blend[1]<... */
1837  real *designs; /* between the design ranges for this axis, typically [1,999] or [6,72] */
1838  real min, def, max; /* For mac */
1839  struct macname *axisnames; /* For mac */
1840 };
1841 
1842 struct named_instance { /* For mac */
1843  real *coords; /* array[axis], these are in user units */
1844  struct macname *names;
1845 };
1846 
1847 /* I am going to simplify my life and not encourage intermediate designs */
1848 /* this means I can easily calculate ConvertDesignVector, and don't have */
1849 /* to bother the user with specifying it. */
1850 /* (NormalizeDesignVector is fairly basic and shouldn't need user help ever) */
1851 /* (As long as they want piecewise linear) */
1852 /* I'm not going to support intermediate designs at all for apple var tables */
1853 typedef struct mmset {
1855  char *axes[4];
1859  real *positions; /* array[instance][axis] saying where each instance lies on each axis */
1860  real *defweights; /* array[instance] saying how much of each instance makes the normal font */
1861  /* for adobe */
1862  struct axismap *axismaps; /* array[axis] */
1863  char *cdv, *ndv; /* for adobe */
1866  unsigned int changed: 1;
1867  unsigned int apple: 1;
1869 
1870 /* mac styles. Useful idea we'll just steal it */
1872  sf_shadow = 0x10, sf_condense = 0x20, sf_extend = 0x40 };
1873 
1874 struct sflist {
1877  FILE *tempttf; /* For ttf */
1878  int id; /* For ttf */
1879  int* ids; /* One for each size */
1880  BDFFont **bdfs; /* Ditto */
1882  struct sflist *next;
1884  int len;
1885 };
1886 
1887  /* Used for drawing text with mark to base anchors */
1888 typedef struct anchorpos {
1889  SplineChar *sc; /* This is the mark being positioned */
1890  int x,y; /* Its origin should be shifted this much relative to that of the original base char */
1891  AnchorPoint *apm; /* The anchor point in sc used to position it */
1892  AnchorPoint *apb; /* The anchor point in the base character against which we are positioned */
1893  int base_index; /* Index in this array to the base character (-1=> original base char) */
1894  unsigned int ticked: 1; /* Used as a mark to mark */
1896 
1904  ttf_flag_oldkern=0x200, /* never set in conjunction with applemode */
1910  ttf_native_kern=0x10000, // This applies mostly to U. F. O. right now.
1911  ttf_flag_oldkernmappedonly=0x20000000 // Allow only mapped glyphs in the old-style "kern" table, required for Windows compatibility
1912  };
1916 enum ps_flags { ps_flag_nohintsubs = 0x10000, ps_flag_noflex=0x20000,
1918  ps_flag_afm = 0x100000, ps_flag_pfm = 0x200000,
1919  ps_flag_tfm = 0x400000,
1920  ps_flag_round = 0x800000,
1921 /* CFF fonts are wrapped up in some postscript sugar -- unless they are to */
1922 /* go into a pdf file or an otf font */
1923  ps_flag_nocffsugar = 0x1000000,
1924 /* in type42 cid fonts we sometimes want an identity map from gid to cid */
1927  ps_flag_noseac = 0x8000000,
1931  };
1932 
1933 struct compressors { char *ext, *decomp, *recomp; };
1934 #define COMPRESSORS_EMPTY { NULL, NULL, NULL }
1935 extern struct compressors compressors[];
1936 
1938 
1939 #define ARCHIVERS_EMPTY { NULL, NULL, NULL, NULL, NULL, NULL, 0 }
1940 
1941 struct fontdict;
1942 struct pschars;
1943 struct findsel;
1944 struct charprocs;
1945 struct enc;
1946 
1947 #define chunkalloc(size) calloc(1,size)
1948 #define chunkfree(item,size) free(item)
1949 
1950 extern int SFOneWidth(SplineFont *sf);
1951 extern int CIDOneWidth(SplineFont *sf);
1952 
1958 struct cidbytes;
1959 struct fd2data;
1960 struct ttfinfo;
1961 struct alltabs;
1962 
1963 typedef struct growbuf {
1964  unsigned char *pt;
1965  unsigned char *base;
1966  unsigned char *end;
1968 extern void GrowBuffer(GrowBuf *gb);
1969 
1970 struct glyphdata;
1971 extern int UnitsParallel(BasePoint *u1,BasePoint *u2,int strict);
1972 extern int CvtPsStem3(struct growbuf *gb, SplineChar *scs[MmMax], int instance_count,
1973  int ishstem, int round);
1974 extern struct pschars *SplineFont2ChrsSubrs2(SplineFont *sf, int nomwid,
1975  int defwid, const int *bygid, int cnt, int flags,
1976  struct pschars **_subrs,int layer);
1977 extern struct pschars *CID2ChrsSubrs2(SplineFont *cidmaster,struct fd2data *fds,
1978  int flags, struct pschars **_glbls,int layer);
1980  bf_nfntmacbin, /*bf_nfntdfont, */bf_fon, bf_fnt, bf_palm,
1983 extern int32 filechecksum(FILE *file);
1984 extern int _WriteWOFFFont(FILE *ttf,SplineFont *sf, enum fontformat format,
1985  int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
1986 extern int WriteWOFFFont(char *fontname,SplineFont *sf, enum fontformat format,
1987  int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
1988 extern int _WriteTTFFont(FILE *ttf,SplineFont *sf, enum fontformat format,
1989  int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
1990 extern int WriteTTFFont(char *fontname,SplineFont *sf, enum fontformat format,
1991  int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
1993  int flags,EncMap *enc,int layer);
1995  int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
1996 extern int WriteMacFamily(char *filename,struct sflist *sfs,enum fontformat format,
1997  enum bitmapformat bf,int flags,int layer);
1998 extern int WriteTTC(const char *filename,struct sflist *sfs,enum fontformat format,
1999  enum bitmapformat bf,int flags,int layer,enum ttc_flags ttcflags);
2000 extern long mactime(void);
2001 extern void DefaultTTFEnglishNames(struct ttflangname *dummy, SplineFont *sf);
2003 extern void OS2FigureCodePages(SplineFont *sf, uint32 CodePage[2]);
2004 extern void OS2FigureUnicodeRanges(SplineFont *sf, uint32 Ranges[4]);
2005 extern void SFDefaultOS2Info(struct pfminfo *pfminfo,SplineFont *sf,char *fontname);
2006 extern void SFDefaultOS2Simple(struct pfminfo *pfminfo,SplineFont *sf);
2007 extern void SFDefaultOS2SubSuper(struct pfminfo *pfminfo,int emsize,double italicangle);
2008 extern int ScriptIsRightToLeft(uint32 script);
2011 extern int SCRightToLeft(SplineChar *sc);
2012 extern void SFMatchGlyphs(SplineFont *sf,SplineFont *target,int addempties);
2013 extern void MMMatchGlyphs(MMSet *mm);
2014 extern const char *_GetModifiers(const char *fontname, const char *familyname, const char *weight);
2015 extern const char *SFGetModifiers(const SplineFont *sf);
2016 
2019 extern int RealNear(real a,real b);
2020 extern int RealNearish(real a,real b);
2021 extern int RealApprox(real a,real b);
2022 extern int RealWithin(real a,real b,real fudge);
2023 
2025 extern int MergeDStemInfo(SplineFont *sf,DStemInfo **ds, DStemInfo *test);
2026 
2027 extern void LineListFree(LineList *ll);
2028 extern void LinearApproxFree(LinearApprox *la);
2029 extern void SplineFree(Spline *spline);
2031 extern void SplinePointFree(SplinePoint *sp);
2032 extern void SplinePointsFree(SplinePointList *spl);
2033 extern void SplinePointListFree(SplinePointList *spl);
2035 extern void SplineSetSpirosClear(SplineSet *spl);
2036 extern void RefCharFree(RefChar *ref);
2037 extern void RefCharsFree(RefChar *ref);
2038 extern void StemInfosFree(StemInfo *h);
2039 extern void StemInfoFree(StemInfo *h);
2040 extern void DStemInfosFree(DStemInfo *h);
2041 extern void DStemInfoFree(DStemInfo *h);
2042 extern void KernPairsFree(KernPair *kp);
2043 extern void AnchorPointsFree(AnchorPoint *ap);
2044 extern void AnchorClassesFree(AnchorClass *kp);
2045 extern void TtfTablesFree(struct ttf_table *tab);
2046 extern void ValDevFree(ValDevTab *adjust);
2047 extern void DeviceTableFree(DeviceTable *adjust);
2048 extern void PSTFree(PST *lig);
2049 
2050 struct lookup_cvt { OTLookup *from, *to; int old;};
2051 struct sub_cvt { struct lookup_subtable *from, *to; int old;};
2052 struct ac_cvt { AnchorClass *from, *to; int old;};
2053 
2054 extern void TTFLangNamesFree(struct ttflangname *l);
2055 extern void AltUniFree(struct altuni *altuni);
2056 extern void AltUniFigure(SplineFont *sf,EncMap *map,int check_dups);
2057 extern void AltUniAdd(SplineChar *sc,int uni);
2058 extern void AltUniAdd_DontCheckDups(SplineChar *sc,int uni);
2059 extern void MinimumDistancesFree(MinimumDistance *md);
2060 extern void LayerDefault(Layer *);
2061 extern SplineChar *SplineCharCreate(int layer_cnt);
2063 extern RefChar *RefCharCreate(void);
2064 extern void KernClassFreeContents(KernClass *kc);
2065 extern void KernClassClearSpecialContents(KernClass *kc);
2066 extern void KernClassListFree(KernClass *kc);
2068 extern void OTLookupFree(OTLookup *lookup);
2069 extern void OTLookupListFree(OTLookup *lookup );
2070 extern void FPSTRuleContentsFree(struct fpst_rule *r, enum fpossub_format format);
2071 extern void FPSTClassesFree(FPST *fpst);
2072 extern void FPSTFree(FPST *fpst);
2073 extern void ASMFree(ASM *sm);
2074 extern void MacNameListFree(struct macname *mn);
2075 extern void MacSettingListFree(struct macsetting *ms);
2076 extern void MacFeatListFree(MacFeat *mf);
2077 extern void GlyphVariantsFree(struct glyphvariants *gv);
2078 extern void MathKernVContentsFree(struct mathkernvertex *mk);
2079 extern void MathKernFree(struct mathkern *mk);
2080 extern void SplineCharListsFree(struct splinecharlist *dlist);
2081 extern void LayerFreeContents(SplineChar *sc, int layer);
2082 extern void SplineCharFreeContents(SplineChar *sc);
2083 extern void SplineCharFree(SplineChar *sc);
2084 extern void EncMapFree(EncMap *map);
2086 extern EncMap *EncMapNew(int encmax, int backmax, Encoding *enc);
2087 extern EncMap *EncMap1to1(int enccount);
2088 extern void ScriptLangListFree(struct scriptlanglist *sl);
2090 extern void SFBaseSort(SplineFont *sf);
2091 extern struct baselangextent *BaseLangCopy(struct baselangextent *extent);
2092 extern void BaseLangFree(struct baselangextent *extent);
2093 extern void BaseScriptFree(struct basescript *bs);
2094 extern void BaseFree(struct Base *base);
2095 extern void SplineFontFree(SplineFont *sf);
2096 extern void SplineFontClearSpecial(SplineFont *sf);
2097 
2098 #if 1
2099 // These relate to experimental support for U. F. O. groups.
2100 #define GROUP_NAME_KERNING_UFO 1
2101 #define GROUP_NAME_KERNING_FEATURE 2
2102 #define GROUP_NAME_VERTICAL 4 // Otherwise horizontal.
2103 #define GROUP_NAME_RIGHT 8 // Otherwise left (or above).
2104 
2105 void GlyphGroupFree(struct ff_glyphclasses* group);
2106 void GlyphGroupsFree(struct ff_glyphclasses* root);
2107 void GlyphGroupKernFree(struct ff_rawoffsets* groupkern);
2108 void GlyphGroupKernsFree(struct ff_rawoffsets* root);
2109 #ifdef FF_UTHASH_GLIF_NAMES
2110 struct glif_name_index;
2111 int HashKerningClassNamesFlex(SplineFont *sf, struct glif_name_index * class_name_hash, int capitalize);
2112 int HashKerningClassNames(SplineFont *sf, struct glif_name_index * class_name_hash);
2113 int HashKerningClassNamesCaps(SplineFont *sf, struct glif_name_index * class_name_hash);
2114 #endif
2115 #endif // 1
2116 extern void JstfLangFree(struct jstf_lang *jl);
2117 extern void JustifyFree(Justify *just);
2118 extern void OtfNameListFree(struct otfname *on);
2119 extern void OtfFeatNameListFree(struct otffeatname *fn);
2121 extern void MarkSetFree(int cnt,char **classes,char **names);
2122 extern void MarkClassFree(int cnt,char **classes,char **names);
2123 extern void MMSetFreeContents(MMSet *mm);
2124 extern void MMSetFree(MMSet *mm);
2125 extern void MMSetClearSpecial(MMSet *mm);
2126 extern void SplineRefigure3(Spline *spline);
2127 extern void SplineRefigure(Spline *spline);
2128 extern Spline *SplineMake3(SplinePoint *from, SplinePoint *to);
2129 extern int SplinePointListIsClockwise(const SplineSet *spl);
2130 extern void SplineCharLayerFindBounds(SplineChar *sc,int layer,DBounds *bounds);
2131 extern void SplineCharFindBounds(SplineChar *sc,DBounds *bounds);
2132 extern void SplineFontLayerFindBounds(SplineFont *sf,int layer,DBounds *bounds);
2133 extern void SplineFontFindBounds(SplineFont *sf,DBounds *bounds);
2134 extern void CIDLayerFindBounds(SplineFont *sf,int layer,DBounds *bounds);
2135 extern void SplineSetQuickBounds(SplineSet *ss,DBounds *b);
2136 extern void SplineCharLayerQuickBounds(SplineChar *sc,int layer,DBounds *bounds);
2137 extern void SplineCharQuickBounds(SplineChar *sc, DBounds *b);
2138 extern void SplinePointCategorize(SplinePoint *sp);
2139 extern void SPLCategorizePoints(SplinePointList *spl);
2142 extern void BpTransform(BasePoint *to, BasePoint *from, real transform[6]);
2143 /* The order of the enum elements below doesn't make much sense, but it's done*/
2144 /* this way to preserve binary compatibility */
2146 /*
2147  * As SplinePointListTransform() does a few things, this is a mask to selectively be
2148  * able to disable some of them.
2149  */
2153 };
2156  enum transformPointType tpt, enum transformPointMask tpmask );
2158  SplineChar *basesc,HintMask *hm);
2160  SplineChar *basesc, SplineChar *subsc, BasePoint *trans);
2162  SplineChar *basesc, BasePoint *trans,int layer);
2163 extern void RefCharFindBounds(RefChar *rf);
2164 extern void SCReinstanciateRefChar(SplineChar *sc,RefChar *rf,int layer);
2166 #define STD_BDF_PROPS_EMPTY { NULL, 0, 0 }
2167 
2168 /* Two lines intersect in at most 1 point */
2169 /* Two quadratics intersect in at most 4 points */
2170 /* Two cubics intersect in at most 9 points */ /* Plus an extra space for a trailing -1 */
2171 extern int SplinesIntersect(const Spline *s1, const Spline *s2, BasePoint pts[9],
2172  extended t1s[10], extended t2s[10]);
2173 extern int _CubicSolve(const Spline1D *sp,bigreal sought,extended ts[3]);
2174 extern int CubicSolve(const Spline1D *sp,bigreal sought,extended ts[3]);
2175 /* Uses an iterative approximation */
2176 extern extended IterateSplineSolve(const Spline1D *sp, extended tmin, extended tmax, extended sought_y);
2177 /* Uses an iterative approximation and then tries to fix things up */
2178 extern extended IterateSplineSolveFixup(const Spline1D *sp, extended tmin, extended tmax, extended sought_y);
2179 extern void SplineFindExtrema(const Spline1D *sp, extended *_t1, extended *_t2 );
2180 
2181 #define CURVATURE_ERROR -1e9
2183 
2184 extern double CheckExtremaForSingleBitErrors(const Spline1D *sp, double t, double othert);
2185 extern int Spline2DFindExtrema(const Spline *sp, extended extrema[4] );
2186 extern int Spline2DFindPointsOfInflection(const Spline *sp, extended poi[2] );
2187 extern void SplineRemoveExtremaTooClose(Spline1D *sp, extended *_t1, extended *_t2 );
2188 extern void SCMakeDependent(SplineChar *dependent,SplineChar *base);
2191 extern int SplineIsLinear(Spline *spline);
2192 extern int SPInterpolate(const SplinePoint *sp);
2194 extern int SpIsExtremum(SplinePoint *sp);
2195 extern int Spline1DCantExtremeX(const Spline *s);
2196 extern int Spline1DCantExtremeY(const Spline *s);
2197 extern Spline *SplineAddExtrema(Spline *s,int always,real lenbound,
2198  real offsetbound,DBounds *b);
2199 extern SplineFont *SplineFontEmpty(void);
2200 extern void SFIncrementXUID(SplineFont *sf);
2201 extern SplineSet *SplineSetReverse(SplineSet *spl);
2202 extern void BP_HVForce(BasePoint *vector);
2205 extern void SplineCharTangentNextCP(SplinePoint *sp);
2206 extern void SplineCharTangentPrevCP(SplinePoint *sp);
2207 /**
2208  * This is like SPAdjustControl but you have not wanting to move the
2209  * BCP at all, but you would like the current location of the passed
2210  * BCP to reshape the spline through the splinepoint. For example, if
2211  * you drag the spline between two points then you might like to touch
2212  * the inside BCP between the two splinepoints to reshape the whole
2213  * curve through a curve point.
2214  */
2215 extern void SPTouchControl(SplinePoint *sp,BasePoint *which, int order2);
2216 extern void SPAdjustControl(SplinePoint *sp,BasePoint *cp, BasePoint *to,int order2);
2217 
2218 extern SplineSet *SSttfApprox(SplineSet *ss);
2219 extern SplineSet *SSPSApprox(SplineSet *ss);
2221 extern void SplineRefigure2(Spline *spline);
2222 extern void SplineRefigureFixup(Spline *spline);
2223 extern Spline *SplineMake2(SplinePoint *from, SplinePoint *to);
2224 extern Spline *SplineMake(SplinePoint *from, SplinePoint *to, int order2);
2225 extern void SCConvertToOrder2(SplineChar *sc);
2226 extern void SFConvertToOrder2(SplineFont *sf);
2227 extern int IntersectLines(BasePoint *inter,
2228  BasePoint *line1_1, BasePoint *line1_2,
2229  BasePoint *line2_1, BasePoint *line2_2);
2230 extern int IntersectLinesClip(BasePoint *inter,
2231  BasePoint *line1_1, BasePoint *line1_2,
2232  BasePoint *line2_1, BasePoint *line2_2);
2233 
2234 extern double BlueScaleFigureForced(struct psdict *private_,real bluevalues[], real otherblues[]);
2235 extern double BlueScaleFigure(struct psdict *private_,real bluevalues[], real otherblues[]);
2236 extern void FindBlues( SplineFont *sf, int layer, real blues[14], real otherblues[10]);
2237 extern void QuickBlues(SplineFont *sf, int layer, BlueData *bd);
2238 extern void FindHStems( SplineFont *sf, real snaps[12], real cnt[12]);
2239 extern void FindVStems( SplineFont *sf, real snaps[12], real cnt[12]);
2240 extern void SCGuessHintInstancesList(SplineChar *sc,int layer,StemInfo *hstem,StemInfo *vstem,DStemInfo *dstem,int hvforce,int dforce);
2241 extern real HIlen( StemInfo *stems);
2242 extern real HIoverlap( HintInstance *mhi, HintInstance *thi);
2243 extern int StemListAnyConflicts(StemInfo *stems);
2245 
2246 typedef struct bluezone {
2249  real family_base; /* NaN if none */
2251  real overshoot; /* relative to baseline, NOT to base */
2252  int highest; /* used in autoinstructing for HStem positioning */
2253  int lowest; /* as above */
2255 
2256 typedef struct stdstem {
2257  real width; /* -1 if none */
2259  struct stdstem *snapto;/* NULL means stem isn't snapped to any other */
2260  int stopat; /* at which ppem stop snapping to snapto */
2262 
2263 typedef struct globalinstrct {
2265  int layer;
2267  double fudge;
2268 
2269  /* Did we initialize the tables needed? 'maxp' is skipped because */
2270  /* its initialization always succeeds. */
2274 
2275  /* PS private data with truetype-specific information added */
2276  BlueZone blues[12]; /* like in BlueData */
2277  int bluecnt;
2279  StdStem *stemsnaph; /* StdHW excluded */
2282  StdStem *stemsnapv; /* StdVW excluded */
2285 
2286 extern void InitGlobalInstrCt( GlobalInstrCt *gic,SplineFont *sf,int layer,
2287  BlueData *bd );
2288 extern void FreeGlobalInstrCt( GlobalInstrCt *gic );
2289 extern void NowakowskiSCAutoInstr( GlobalInstrCt *gic,SplineChar *sc );
2290 
2291 extern void SCClearHintMasks(SplineChar *sc,int layer,int counterstoo);
2292 extern void SCFigureHintMasks(SplineChar *sc,int layer);
2293 extern void _SplineCharAutoHint( SplineChar *sc, int layer, BlueData *bd, struct glyphdata *gd2, int gen_undoes );
2294 extern void SplineCharAutoHint( SplineChar *sc,int layer, BlueData *bd);
2295 extern void SFSCAutoHint( SplineChar *sc,int layer,BlueData *bd);
2296 extern void SplineFontAutoHint( SplineFont *sf, int layer);
2297 extern void SplineFontAutoHintRefs( SplineFont *sf, int layer);
2298 extern int SplineFontIsFlexible(SplineFont *sf,int layer, int flags);
2299 extern int SCDrawsSomething(SplineChar *sc);
2300 extern int SCWorthOutputting(SplineChar *sc);
2301 extern void SFLigaturePrepare(SplineFont *sf);
2302 extern void SFLigatureCleanup(SplineFont *sf);
2303 extern void SFKernClassTempDecompose(SplineFont *sf,int isv);
2304 extern void SFKernCleanup(SplineFont *sf,int isv);
2305 
2307 {
2308 
2309  // these indicate if we saw some metadata or not.
2310  // perhaps the caller wants to do something special
2311  // if the metadata was present/missing.
2314 
2315  // state that is mostly interesting to SFD_GetFontMetaData() only
2316  struct Base* last_base;
2327  struct ttf_table* lastttf[2];
2328 
2331 extern bool SFD_GetFontMetaData( FILE *sfd,
2332  char *tok,
2333  SplineFont *sf,
2335 extern const char*FindUnicharName(void);
2336 extern Encoding *_FindOrMakeEncoding(const char *name,int make_it);
2337 extern Encoding *FindOrMakeEncoding(const char *name);
2338 extern MacFeat *SFDParseMacFeatures(FILE *sfd, char *tok);
2339 extern SplineFont *SFDRead(char *filename);
2340 extern SplineFont *_SFDRead(char *filename,FILE *sfd);
2342 extern uint16 _MacStyleCode( const char *styles, SplineFont *sf, uint16 *psstyle );
2343 extern uint16 MacStyleCode( SplineFont *sf, uint16 *psstyle );
2344 
2345 extern int getAdobeEnc(const char *name);
2346 
2347 extern void MatMultiply(real m1[6], real m2[6], real to[6]);
2348 
2349 extern void GlyphHashFree(SplineFont *sf);
2350 extern SplineChar *SFHashName(SplineFont *sf,const char *name);
2351 extern int SFFindGID(SplineFont *sf, int unienc, const char *name );
2352 extern int SFCIDFindCID(SplineFont *sf, int unienc, const char *name );
2353 extern SplineChar *SFGetChar(SplineFont *sf, int unienc, const char *name );
2354 extern int SFFindExistingSlot(SplineFont *sf, int unienc, const char *name );
2355 extern int SFHasCID(SplineFont *sf, int cid);
2356 
2357 extern void PSCharsFree(struct pschars *chrs);
2358 extern void PSDictFree(struct psdict *chrs);
2359 extern char *PSDictHasEntry(struct psdict *dict, const char *key);
2360 extern int PSDictSame(struct psdict *dict1, struct psdict *dict2);
2361 
2362 struct cidmap; /* private structure to encoding.c */
2363 
2364 int getushort(FILE *ttf);
2365 int32 getlong(FILE *ttf);
2366 void putshort(FILE *file,int sval);
2367 void putlong(FILE *file,int val);
2368 void putfixed(FILE *file,real dval);
2369 int ttfcopyfile(FILE *ttf, FILE *other, int pos, const char *table_name);
2370 
2371 extern int UniFromName(const char *name,enum uni_interp interp, Encoding *encname);
2372 extern NameList *DefaultNameListForNewFonts(void);
2373 extern NameList *NameListByName(const char *name);
2374 extern int SSTtfNumberPoints(SplineSet *ss);
2375 extern int SCNumberPoints(SplineChar *sc,int layer);
2376 extern int SCPointsNumberedProperly(SplineChar *sc,int layer);
2377 
2378 int SFFigureDefWidth(SplineFont *sf, int *_nomwid);
2379 
2380 extern int ClassesMatch(int cnt1,char **classes1,int cnt2,char **classes2);
2381 extern FPST *FPSTGlyphToClass(FPST *fpst);
2382 
2384 extern ASM *ASMFromFPST(SplineFont *sf,FPST *fpst,int ordered);
2385 
2386 extern char *utf8_verify_copy(const char *str);
2387 
2388 extern char *Utf8ToMacStr(const char *ustr,int macenc,int maclang);
2389 extern uint8 MacEncFromMacLang(int maclang);
2390 extern uint16 WinLangToMac(int winlang);
2391 extern MacFeat *FindMacFeature(SplineFont *sf, int feat,MacFeat **secondary);
2392 extern struct macsetting *FindMacSetting(SplineFont *sf, int feat, int set,struct macsetting **secondary);
2393 
2394 extern int32 UniFromEnc(int enc, Encoding *encname);
2395 extern int32 EncFromUni(int32 uni, Encoding *encname);
2396 
2397 /* Colinear & between */
2398 
2399 enum psstrokeflags { /* sf_removeoverlap=2,*/ sf_handle_eraser=4,
2401 
2402 extern int MMValid(MMSet *mm,int complain);
2403 
2411  SS_NoMatch = 128,
2420 
2424  BC_NoMatch = 8<<16,
2425  BC_Match = 16<<16,
2426 
2427  SS_RefPtMismatch = 32<<16
2428  };
2429 
2433  fcf_bitmaps=0x80, fcf_names = 0x100, fcf_gpos=0x200, fcf_gsub=0x400,
2435 
2436 # if HANYANG
2437 extern void SFDDumpCompositionRules(FILE *sfd,struct compositionrules *rules);
2438 extern struct compositionrules *SFDReadCompositionRules(FILE *sfd);
2439 extern void SFModifyComposition(SplineFont *sf);
2440 extern void SFBuildSyllables(SplineFont *sf);
2441 # endif
2442 
2443 extern void SFTimesFromFile(SplineFont *sf,FILE *);
2444 
2445 extern int SFHasInstructions(SplineFont *sf);
2446 extern int RefDepth(RefChar *ref,int layer);
2447 
2448 extern uint32 *SFScriptsInLookups(SplineFont *sf,int gpos);
2449 extern uint32 *SFLangsInScript(SplineFont *sf,int gpos,uint32 script);
2453 extern void SFFindUnusedLookups(SplineFont *sf);
2454 extern struct lookup_subtable *SFFindLookupSubtable(SplineFont *sf,char *name);
2456 extern OTLookup *SFFindLookup(SplineFont *sf,char *name);
2457 struct scriptlanglist *SLCopy(struct scriptlanglist *sl);
2458 struct scriptlanglist *SListCopy(struct scriptlanglist *sl);
2460 extern int DefaultLangTagInOneScriptList(struct scriptlanglist *sl);
2461 
2462 extern RefChar *HasUseMyMetrics(SplineChar *sc,int layer);
2463 
2465 
2466 extern void InitSimpleStuff(void);
2467 
2470  int offset;
2473 
2474 #define MATH_CONSTANTS_DESCRIPTOR_EMPTY { NULL, 0, 0}
2475 
2476 extern const char *knownweights[], *realweights[], **noticeweights[];
2477 
2478 struct lang_frequencies;
2479 extern struct gradient *GradientCopy(struct gradient *old,real transform[6]);
2480 extern void GradientFree(struct gradient *grad);
2481 extern struct pattern *PatternCopy(struct pattern *old,real transform[6]);
2482 extern void PatternFree(struct pattern *pat);
2483 extern void BrushCopy(struct brush *into, struct brush *from,real transform[6]);
2484 extern void PenCopy(struct pen *into, struct pen *from,real transform[6]);
2485 
2486 extern bigreal SFCapHeight(SplineFont *sf, int layer, int return_error);
2487 extern bigreal SFXHeight(SplineFont *sf, int layer, int return_error);
2488 
2489 /**
2490  * Visitor for SPLFirstVisitSplines()
2491  */
2492 typedef void (*SPLFirstVisitSplinesVisitor)( SplinePoint* splfirst, Spline* s, void* udata );
2493 
2494 /**
2495  * Visitor Function: print debug information about each spline
2496  */
2497 
2498 /**
2499  * Given a SplinePointList* that you want to visit each spline in the
2500  * iteration is not as simple as it could be, so you can call this
2501  * function passing spl->first as 'splfirst' and a visitor function
2502  * which will see each spline in the splfirst colleciton.
2503  *
2504  * For debug, you can pass SPLFirstVisitorDebug which will print
2505  * information for each item in the splfirst collection.
2506  *
2507  * You can pass any arbitrary data in as udata and SPLFirstVisit()
2508  * will pass that udata to your visitor function without change. If
2509  * you want a return value from your visitor, pass a pointer to a
2510  * struct as udata. eg:
2511  *
2512  * typedef struct SPLFirstVisitorFoundSoughtDataS
2513  * {
2514  * SplinePoint* sought;
2515  * int found;
2516  * } SPLFirstVisitorFoundSoughtData;
2517  *
2518  * // ...
2519  *
2520  * SPLFirstVisitorFoundSoughtData d;
2521  * d.sought = sought;
2522  * d.found = 0;
2523  * SPLFirstVisit( spl->first, SPLFirstVisitorFoundSought, &d );
2524  * if( d.found )
2525  * return 1;
2526  *
2527  */
2528 extern void SPLFirstVisitSplines( SplinePoint* splfirst, SPLFirstVisitSplinesVisitor f, void* udata );
2529 
2530 /**
2531  * Visitor for SPLFirstVisitPoints()
2532  */
2533 typedef void (*SPLFirstVisitPointsVisitor)( SplinePoint* splfirst, Spline* s, SplinePoint* sp, void* udata );
2534 
2535 
2536 /**
2537  * Applies a visitor to the container and returns false if no point in the SPL
2538  * has an x coordinate of 'x'.
2539  */
2541 
2542 
2543 /**
2544  * It is like a == b, but also true if a is within
2545  * tolerence of b.
2546  */
2547 extern bool equalWithTolerence( real a, real b, real tolerence );
2548 
2549 // The following functions are in splineutil.c at present.
2550 char * upper_case(const char * input);
2551 
2552 #include "ustring.h"
2553 
2554 #endif
bp
Definition: action.c:1035
cp
Definition: action.c:1035
WORD extent[256]
Definition: afm2pfm.c:92
const char * fontname
Definition: afm2pl.c:186
float italicangle
Definition: afm2pl.c:209
#define sc
Definition: aptex-macros.h:57
#define adjust(a)
#define dlist
#define name
#define b
Definition: jpegint.h:372
#define ap
static Tfeature feat[21]
Definition: control.c:55
@ hstem
Definition: cscommands.h:12
@ vstem
Definition: cscommands.h:26
int dummy
Definition: dummy.c:29
int h
Definition: dviconv.c:9
double real
Definition: dvips.h:66
const FcChar8 lang[6]
Definition: fcfreetype.c:56
static void
Definition: fpif.c:118
static gabc_style_bits styles
mpz_t * f
Definition: gen-fib.c:34
#define v1
#define v2
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
#define FF_UUID_STRING_SIZE
Definition: gnetwork.h:67
#define a(n)
Definition: gpos-common.c:148
#define d(n)
Definition: gpos-common.c:151
int base
Definition: gsftopk.c:1502
small capitals from c petite p scientific f u
Definition: afcover.h:88
xD9 x84 xD8 xAD xD9 x80 xF0 x90 xAC x9A xE0 xA7 xA6 xE0 xA7 xAA xF0 x91 x84 xA4 xF0 x91 x84 x89 xF0 x91 x84 x9B xF0 x90 x8A xAB xF0 x90 x8B x89 xE2 xB2 x9E xE2 xB2 x9F xD0 xBE xD0 x9E xF0 x90 x90 x84 xF0 x90 x90 xAC xE1 x83 x98 xE1 x83 x94 xE1 x83 x90 xE1 xB2 xBF xE2 xB0 x95 xE2 xB1 x85 xCE xBF xCE x9F xE0 xA8 xA0 xE0 xA8 xB0 xE0 xA9 xA6 Kayah xEA xA4 x8D xEA xA4 x80 Khmer xE1 xA7 xA1 xE1 xA7 xAA xE0 xBB x90 Latin Subscript xE2 x82 x92 xE2 x82 x80 xEA x93 xB3 xF0 x96 xB9 xA1 xF0 x96 xB9 x9B xF0 x96 xB9 xAF xE1 x80 x9D xE1 x80 x84 xE1 x80 x82 no script
Definition: afscript.h:271
kerning y
Definition: ttdriver.c:212
void * iconv_t
Definition: gdkanji.c:21
static int strict
Definition: pngtest.c:145
static unsigned char pat[8]
Definition: pkfont.c:194
static const char * tab[]
Definition: xdirtest.c:23
struct stem stems[128]
Definition: type1.c:298
static struct blues_struct * blues
Definition: type1.c:217
#define root
Definition: ctangleboot.c:69
int mf
Definition: main.c:38
unsigned short uint16
Definition: tiff.h:62
short int16
Definition: tiff.h:61
unsigned long uint32
Definition: tiff.h:68
long int32
Definition: tiff.h:67
unsigned char uint8
Definition: tiff.h:60
char int8
Definition: tiff.h:58
const int * pos
Definition: combiners.h:905
#define target(code, i)
Definition: lpeg.c:1165
@ other
Definition: mtxline.h:22
float x
Definition: cordic.py:15
string fn
Definition: fc-lang.py:335
list names
Definition: fc-lang.py:151
def ref(x)
Definition: pdf-org.py:104
primitive interp
Definition: obx.h:197
static int format
Definition: pbmclean.c:15
#define round(a)
Definition: pbmtopk.c:22
char * filename[256]
Definition: pbmtopk.c:46
char * familyname
Definition: pbmtopk.c:65
static int cnt
Definition: pkout.c:166
real to[600]
Definition: pmxab.c:87
int r
Definition: ppmqvga.c:68
static int offset
Definition: ppmtogif.c:642
int otherblues[10]
Definition: pt1.c:115
int bluevalues[14]
Definition: pt1.c:113
#define map
#define flags
C API: Unicode string handling functions.
SplineFont * SplineFontEmpty(void)
Definition: splineutil2.c:776
struct refbdfc BDFRefChar
int _WriteTTFFont(FILE *ttf, SplineFont *sf, enum fontformat format, int32 *bsizes, enum bitmapformat bf, int flags, EncMap *enc, int layer)
Definition: tottf.c:5921
void NowakowskiSCAutoInstr(GlobalInstrCt *gic, SplineChar *sc)
piecemeal_flags
Definition: splinefont.h:2165
@ pf_antialias
Definition: splinefont.h:2165
@ pf_ft_nohints
Definition: splinefont.h:2165
@ pf_ft_recontext
Definition: splinefont.h:2165
@ pf_bbsized
Definition: splinefont.h:2165
void SFMatchGlyphs(SplineFont *sf, SplineFont *target, int addempties)
Definition: encoding.c:607
struct macsetting * FindMacSetting(SplineFont *sf, int feat, int set, struct macsetting **secondary)
Definition: macenc.c:1041
PolyType
Definition: splinefont.h:228
@ Poly_TooFewPoints
Definition: splinefont.h:229
@ Poly_Concave
Definition: splinefont.h:228
@ Poly_Convex
Definition: splinefont.h:228
@ Poly_PointOnEdge
Definition: splinefont.h:228
@ Poly_Line
Definition: splinefont.h:229
bool SFD_GetFontMetaData(FILE *sfd, char *tok, SplineFont *sf, SFD_GetFontMetaDataData *d)
Definition: sfd.c:3245
val_type
Definition: splinefont.h:110
@ v_int32pt
Definition: splinefont.h:111
@ v_str
Definition: splinefont.h:110
@ v_int
Definition: splinefont.h:110
@ v_arr
Definition: splinefont.h:110
@ v_void
Definition: splinefont.h:111
@ v_int8pt
Definition: splinefont.h:111
@ v_real
Definition: splinefont.h:110
@ v_int16pt
Definition: splinefont.h:111
@ v_arrfree
Definition: splinefont.h:110
@ v_unicode
Definition: splinefont.h:110
@ v_lval
Definition: splinefont.h:110
struct gradient * GradientCopy(struct gradient *old, float transform[6])
Definition: splineutil.c:2752
int SPInterpolate(const SplinePoint *sp)
Definition: splineutil2.c:399
struct enc Encoding
struct baselangextent * BaseLangCopy(struct baselangextent *extent)
Definition: splineutil.c:3125
HintInstance * HICopyTrans(HintInstance *hi, float mul, float offset)
Definition: autohint.c:1134
void _SplineCharAutoHint(SplineChar *sc, int layer, BlueData *bd, struct glyphdata *gd2, int gen_undoes)
Definition: autohint.c:2280
ttf_flags
Definition: splinefont.h:1897
@ ttf_flag_applemode
Definition: splinefont.h:1898
@ ttf_flag_pfed_lookupnames
Definition: splinefont.h:1905
@ ttf_flag_symbol
Definition: splinefont.h:1908
@ ttf_flag_dummyDSIG
Definition: splinefont.h:1909
@ ttf_flag_shortps
Definition: splinefont.h:1897
@ ttf_flag_oldkern
Definition: splinefont.h:1904
@ ttf_flag_pfed_layers
Definition: splinefont.h:1907
@ ttf_flag_TeXtable
Definition: splinefont.h:1902
@ ttf_flag_nohints
Definition: splinefont.h:1897
@ ttf_flag_otmode
Definition: splinefont.h:1900
@ ttf_flag_pfed_colors
Definition: splinefont.h:1899
@ ttf_native_kern
Definition: splinefont.h:1910
@ ttf_flag_oldkernmappedonly
Definition: splinefont.h:1911
@ ttf_flag_ofm
Definition: splinefont.h:1903
@ ttf_flag_pfed_guides
Definition: splinefont.h:1906
@ ttf_flag_pfed_comments
Definition: splinefont.h:1899
@ ttf_flag_glyphmap
Definition: splinefont.h:1901
void SFLigatureCleanup(SplineFont *sf)
Definition: splinesaveafm.c:65
void SFDefaultOS2Simple(struct pfminfo *pfminfo, SplineFont *sf)
Definition: tottf.c:2889
texdata_type
Definition: splinefont.h:1650
@ tex_math
Definition: splinefont.h:1650
@ tex_mathext
Definition: splinefont.h:1650
@ tex_text
Definition: splinefont.h:1650
@ tex_unset
Definition: splinefont.h:1650
NameList * NameListByName(const char *name)
Definition: namelist.c:155
struct refchar RefChar
int ttfcopyfile(FILE *ttf, FILE *other, int pos, const char *table_name)
Definition: tottf.c:652
void SplineCharDefaultNextCP(SplinePoint *base)
Definition: splineutil2.c:928
void SplineFontLayerFindBounds(SplineFont *sf, int layer, DBounds *bounds)
Definition: splineutil.c:453
void SFConvertToOrder2(SplineFont *sf)
SplineChar ** SFGlyphsWithPSTinSubtable(SplineFont *sf, struct lookup_subtable *subtable)
Definition: lookups.c:370
int ClassesMatch(int cnt1, char **classes1, int cnt2, char **classes2)
Definition: asmfpst.c:34
int Within16RoundingErrors(double v1, double v2)
Definition: splineutil2.c:82
ae_type
Definition: splinefont.h:2193
@ ae_only_good
Definition: splinefont.h:2193
@ ae_between_selected
Definition: splinefont.h:2193
@ ae_all
Definition: splinefont.h:2193
@ ae_only_good_rm_later
Definition: splinefont.h:2193
struct otlookup OTLookup
void SCGuessHintInstancesList(SplineChar *sc, int layer, StemInfo *hstem, StemInfo *vstem, DStemInfo *dstem, int hvforce, int dforce)
Definition: autohint.c:1209
linejoin
Definition: splinefont.h:142
@ lj_miter
Definition: splinefont.h:143
@ lj_round
Definition: splinefont.h:144
@ lj_bevel
Definition: splinefont.h:145
@ lj_inherited
Definition: splinefont.h:146
int CvtPsStem3(struct growbuf *gb, SplineChar *scs[16], int instance_count, int ishstem, int round)
Definition: splinesave.c:456
void MatMultiply(float m1[6], float m2[6], float to[6])
Definition: psread.c:55
int SCRightToLeft(SplineChar *sc)
Definition: tottfgpos.c:249
struct lookup_subtable * SFFindLookupSubtableAndFreeName(SplineFont *sf, char *name)
Definition: lookups.c:615
void MMSetFree(MMSet *mm)
Definition: splineutil.c:3461
void KernClassFreeContents(KernClass *kc)
Definition: splineutil.c:2907
int UnitsParallel(BasePoint *u1, BasePoint *u2, int strict)
Definition: stemdb.c:122
int RealWithin(float a, float b, float fudge)
Definition: splineutil2.c:159
int SCPointsNumberedProperly(SplineChar *sc, int layer)
Definition: splinechar.c:254
void BaseScriptFree(struct basescript *bs)
Definition: splineutil.c:3153
void MarkSetFree(int cnt, char **classes, char **names)
Definition: splineutil.c:3114
void SFKernClassTempDecompose(SplineFont *sf, int isv)
int WriteMacTTFFont(char *fontname, SplineFont *sf, enum fontformat format, int32 *bsizes, enum bitmapformat bf, int flags, EncMap *enc, int layer)
void SFDefaultOS2SubSuper(struct pfminfo *pfminfo, int emsize, double italicangle)
Definition: tottf.c:2906
void SplineCharQuickBounds(SplineChar *sc, DBounds *b)
Definition: splineutil.c:578
void SplineCharFree(SplineChar *sc)
Definition: splineutil.c:2835
void EncMapFree(EncMap *map)
Definition: splineutil.c:3091
#define DASH_MAX
Definition: splinefont.h:193
char * PSDictHasEntry(struct psdict *dict, const char *key)
Definition: dumppfa.c:36
void SPLCategorizePoints(SplinePointList *spl)
Definition: splineutil.c:727
#define MmMax
Definition: splinefont.h:58
const char * _GetModifiers(const char *fontname, const char *familyname, const char *weight)
Definition: splinefont.c:45
void GlyphGroupKernFree(struct ff_rawoffsets *groupkern)
Definition: splineutil.c:3385
SplineChar * SFGetChar(SplineFont *sf, int unienc, const char *name)
Definition: fvfonts.c:175
int WriteWOFFFont(char *fontname, SplineFont *sf, enum fontformat format, int32 *bsizes, enum bitmapformat bf, int flags, EncMap *enc, int layer)
Definition: woff.c:302
int ScriptIsRightToLeft(uint32 script)
Definition: tottfgpos.c:149
int RealNear(float a, float b)
Definition: splineutil2.c:112
void PSTFree(PST *lig)
Definition: splineutil.c:2519
uint32 ScriptFromUnicode(uint32 u, SplineFont *sf)
Definition: tottfgpos.c:159
si_type
Definition: splinefont.h:205
@ si_caligraphic
Definition: splinefont.h:205
@ si_poly
Definition: splinefont.h:205
@ si_std
Definition: splinefont.h:205
@ si_centerline
Definition: splinefont.h:205
SplineSet * SSPSApprox(SplineSet *ss)
Definition: splineorder2.c:950
int getAdobeEnc(const char *name)
Definition: cvundoes.c:38
Spline * SplineMake(SplinePoint *from, SplinePoint *to, int order2)
serif_type
Definition: splinefont.h:243
@ srf_simpleslant
Definition: splinefont.h:243
@ srf_complexslant
Definition: splinefont.h:243
@ srf_flat
Definition: splinefont.h:243
void SFDefaultOS2Info(struct pfminfo *pfminfo, SplineFont *sf, char *fontname)
Definition: tottf.c:2918
double SplineCurvature(Spline *s, double t)
Definition: splineutil.c:1704
void OtfFeatNameListFree(struct otffeatname *fn)
Definition: splineutil.c:3045
void StemInfosFree(StemInfo *h)
Definition: splineutil.c:2440
void MacFeatListFree(MacFeat *mf)
Definition: splineutil.c:2998
SplineFont * _SFDRead(char *filename, FILE *sfd)
void SplinePointCategorize(SplinePoint *sp)
Definition: splineutil.c:657
int SCWorthOutputting(SplineChar *sc)
Definition: splinesaveafm.c:55
void MacSettingListFree(struct macsetting *ms)
Definition: splineutil.c:2987
void AltUniAdd(SplineChar *sc, int uni)
Definition: splinechar.c:299
void DStemInfoFree(DStemInfo *h)
Definition: splineutil.c:2454
unsigned char DashType
Definition: splinefont.h:194
int SFFigureDefWidth(SplineFont *sf, int *_nomwid)
Definition: tottf.c:1867
void SCMakeDependent(SplineChar *dependent, SplineChar *base)
Definition: splineutil.c:1235
uint32 SCScriptFromUnicode(SplineChar *sc)
Definition: tottfgpos.c:202
struct stdstem StdStem
int SplineIsLinear(Spline *spline)
Definition: splineutil2.c:199
int RealApprox(float a, float b)
Definition: splineutil2.c:143
double CheckExtremaForSingleBitErrors(const Spline1D *sp, double t, double othert)
Definition: splineutil.c:1630
int IntersectLines(BasePoint *inter, BasePoint *line1_1, BasePoint *line1_2, BasePoint *line2_1, BasePoint *line2_2)
Definition: splineutil.c:1877
void KernClassListFree(KernClass *kc)
Definition: splineutil.c:2955
int RealNearish(float a, float b)
Definition: splineutil2.c:137
uint16 _MacStyleCode(const char *styles, SplineFont *sf, uint16 *psstyle)
Definition: macbinary.c:109
void RefCharFindBounds(RefChar *rf)
Definition: splineutil.c:1278
style_flags
Definition: splinefont.h:1871
@ sf_condense
Definition: splinefont.h:1872
@ sf_extend
Definition: splinefont.h:1872
@ sf_bold
Definition: splinefont.h:1871
@ sf_italic
Definition: splinefont.h:1871
@ sf_underline
Definition: splinefont.h:1871
@ sf_outline
Definition: splinefont.h:1871
@ sf_shadow
Definition: splinefont.h:1872
int SplineFontIsFlexible(SplineFont *sf, int layer, int flags)
Definition: autohint.c:2674
ps_flags
Definition: splinefont.h:1916
@ ps_flag_identitycidmap
Definition: splinefont.h:1925
@ ps_flag_restrict256
Definition: splinefont.h:1917
@ ps_flag_nocffsugar
Definition: splinefont.h:1923
@ ps_flag_nohints
Definition: splinefont.h:1917
@ ps_flag_afm
Definition: splinefont.h:1918
@ ps_flag_outputfontlog
Definition: splinefont.h:1928
@ ps_flag_pfm
Definition: splinefont.h:1918
@ ps_flag_noseac
Definition: splinefont.h:1927
@ ps_flag_tfm
Definition: splinefont.h:1919
@ ps_flag_nohintsubs
Definition: splinefont.h:1916
@ ps_flag_round
Definition: splinefont.h:1920
@ ps_flag_noflex
Definition: splinefont.h:1916
@ ps_flag_afmwithmarks
Definition: splinefont.h:1926
@ ps_flag_mask
Definition: splinefont.h:1929
void SplineCharListsFree(struct splinecharlist *dlist)
Definition: splineutil.c:2722
void SplineCharFreeContents(SplineChar *sc)
Definition: splineutil.c:2799
undotype
Definition: splinefont.h:817
@ ut_none
Definition: splinefont.h:817
@ ut_width
Definition: splinefont.h:820
@ ut_rbearing
Definition: splinefont.h:820
@ ut_possub
Definition: splinefont.h:820
@ ut_layers
Definition: splinefont.h:821
@ ut_lbearing
Definition: splinefont.h:820
@ ut_hints
Definition: splinefont.h:821
@ ut_tstate
Definition: splinefont.h:817
@ ut_multiple
Definition: splinefont.h:821
@ ut_noop
Definition: splinefont.h:822
@ ut_bitmap
Definition: splinefont.h:821
@ ut_composit
Definition: splinefont.h:821
@ ut_statelookup
Definition: splinefont.h:818
@ ut_statehint
Definition: splinefont.h:817
@ ut_statename
Definition: splinefont.h:817
@ ut_state
Definition: splinefont.h:817
@ ut_vwidth
Definition: splinefont.h:820
@ ut_bitmapsel
Definition: splinefont.h:821
@ ut_anchors
Definition: splinefont.h:819
float _MMArray[2][16]
Definition: splinefont.h:1136
anchorclass_type
Definition: splinefont.h:502
@ act_unknown
Definition: splinefont.h:502
@ act_mklg
Definition: splinefont.h:502
@ act_curs
Definition: splinefont.h:502
@ act_mkmk
Definition: splinefont.h:502
@ act_mark
Definition: splinefont.h:502
int WriteMacFamily(char *filename, struct sflist *sfs, enum fontformat format, enum bitmapformat bf, int flags, int layer)
Compare_Ret
Definition: splinefont.h:2404
@ SS_RefMismatch
Definition: splinefont.h:2412
@ SS_DisorderedDirection
Definition: splinefont.h:2408
@ BC_DepthMismatch
Definition: splinefont.h:2421
@ SS_ContourMatch
Definition: splinefont.h:2410
@ SS_HintMaskMismatch
Definition: splinefont.h:2416
@ SS_WidthMismatch
Definition: splinefont.h:2413
@ SS_ContourMismatch
Definition: splinefont.h:2418
@ SS_RefPtMismatch
Definition: splinefont.h:2427
@ SS_DiffContourCount
Definition: splinefont.h:2404
@ SS_MismatchOpenClosed
Definition: splinefont.h:2405
@ SS_HintMismatch
Definition: splinefont.h:2415
@ SS_VWidthMismatch
Definition: splinefont.h:2414
@ SS_DisorderedContours
Definition: splinefont.h:2406
@ SS_PointsMatch
Definition: splinefont.h:2409
@ SS_LayerCntMismatch
Definition: splinefont.h:2417
@ SS_UnlinkRefMatch
Definition: splinefont.h:2419
@ SS_DisorderedStart
Definition: splinefont.h:2407
@ BC_BitmapMismatch
Definition: splinefont.h:2423
@ BC_NoMatch
Definition: splinefont.h:2424
@ BC_BoundingBoxMismatch
Definition: splinefont.h:2422
@ SS_NoMatch
Definition: splinefont.h:2411
@ BC_Match
Definition: splinefont.h:2425
struct valdev ValDevTab
ttfflags
Definition: splinefont.h:2341
@ ttf_onlyonestrike
Definition: splinefont.h:2341
@ ttf_onlynames
Definition: splinefont.h:2341
@ ttf_onlykerns
Definition: splinefont.h:2341
@ ttf_onlystrikes
Definition: splinefont.h:2341
int getushort(FILE *ttf)
Definition: parsettf.c:47
void SPAdjustControl(SplinePoint *sp, BasePoint *cp, BasePoint *to, int order2)
Definition: splineutil2.c:1142
char * Utf8ToMacStr(const char *ustr, int macenc, int maclang)
Definition: macenc.c:942
void ScriptLangListFree(struct scriptlanglist *sl)
Definition: splineutil.c:2862
void SCConvertToOrder2(SplineChar *sc)
char * upper_case(const char *input)
void(* SPLFirstVisitPointsVisitor)(SplinePoint *splfirst, Spline *s, SplinePoint *sp, void *udata)
Definition: splinefont.h:2533
int WriteTTC(const char *filename, struct sflist *sfs, enum fontformat format, enum bitmapformat bf, int flags, int layer, enum ttc_flags ttcflags)
Definition: tottf.c:6672
void AltUniFree(struct altuni *altuni)
Definition: splineutil.c:2633
void JstfLangFree(struct jstf_lang *jl)
Definition: splineutil.c:3175
struct spline1d Spline1D
#define MAX_LANG
Definition: splinefont.h:402
void BpTransform(BasePoint *to, BasePoint *from, float transform[6])
Definition: splineutil.c:815
struct anchorclass AnchorClass
int Within4RoundingErrors(double v1, double v2)
Definition: splineutil2.c:52
linelist_flags
Definition: splinefont.h:985
@ cvli_onscreen
Definition: splinefont.h:985
@ cvli_clipped
Definition: splinefont.h:985
int SCDrawsSomething(SplineChar *sc)
Definition: splinesaveafm.c:38
loadvalidation_state
Definition: splinefont.h:1557
@ lvs_bad_glyph_table
Definition: splinefont.h:1559
@ lvs_bad_gx_table
Definition: splinefont.h:1564
@ lvs_bad_ps_fontname
Definition: splinefont.h:1558
@ lvs_bad_sfnt_header
Definition: splinefont.h:1567
@ lvs_bad_os2_version
Definition: splinefont.h:1566
@ lvs_bad_ot_table
Definition: splinefont.h:1565
@ lvs_bad_cff_table
Definition: splinefont.h:1560
@ lvs_bad_metrics_table
Definition: splinefont.h:1561
@ lvs_bad_cmap_table
Definition: splinefont.h:1562
@ lvs_bad_bitmaps_table
Definition: splinefont.h:1563
const char ** noticeweights[]
Definition: splinefont.h:2476
double BlueScaleFigureForced(struct psdict *private_, float bluevalues[], float otherblues[])
Definition: dumppfa.c:89
void GrowBuffer(GrowBuf *gb)
Definition: splineutil.c:3568
struct dsteminfo DStemInfo
void LayerFreeContents(SplineChar *sc, int layer)
Definition: splineutil.c:2789
SplineChar * SFSplineCharCreate(SplineFont *sf)
Definition: splineutil.c:2673
struct jstf_script Justify
struct splinefont SplineFont
struct kernpair KernPair
simpify_flags
Definition: splinefont.h:235
@ sf_mergelines
Definition: splinefont.h:238
@ sf_cleanup
Definition: splinefont.h:235
@ sf_choosehv
Definition: splinefont.h:236
@ sf_normal
Definition: splinefont.h:235
@ sf_rmsingletonpoints
Definition: splinefont.h:239
@ sf_setstart2extremum
Definition: splinefont.h:238
@ sf_smoothcurves
Definition: splinefont.h:236
@ sf_forcelines
Definition: splinefont.h:237
@ sf_nearlyhvlines
Definition: splinefont.h:237
@ sf_ignoreextremum
Definition: splinefont.h:236
@ sf_ignoreslopes
Definition: splinefont.h:235
possub_type
Definition: splinefont.h:563
@ pst_anchors
Definition: