Commit d16a4b8111c42699e352cf2e758454c9a1189bab

David Turner 2000-02-15T12:56:44

removed obsolete hinter source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
diff --git a/src/type1z/t1hinter.c b/src/type1z/t1hinter.c
deleted file mode 100644
index dc59441..0000000
--- a/src/type1z/t1hinter.c
+++ /dev/null
@@ -1,1269 +0,0 @@
-/*******************************************************************
- *
- *  t1hinter.c                                                 1.2
- *
- *    Type1 hinter.         
- *
- *  Copyright 1996-1999 by
- *  David Turner, Robert Wilhelm, and Werner Lemberg.
- *
- *  This file is part of the FreeType project, and may only be used
- *  modified and distributed under the terms of the FreeType project
- *  license, LICENSE.TXT.  By continuing to use, modify, or distribute
- *  this file you indicate that you have read the license and
- *  understand and accept it fully.
- *
- *
- *  The Hinter is in charge of fitting th scaled outline to the
- *  pixel grid in order to considerably improve the quality of
- *  the Type 1 font driver's output..
- *
- ******************************************************************/
-
-#include <ftdebug.h>
-#include <t1objs.h>
-#include <t1hinter.h>
-
-#undef  FT_COMPONENT
-#define FT_COMPONENT  trace_t1hint    /* for debugging/tracing */
-
-
-#undef  ONE_PIXEL
-#define ONE_PIXEL  64
-
-#undef  ROUND
-#define ROUND(x)   (( x + ONE_PIXEL/2 ) & -ONE_PIXEL)
-
-#undef  SCALE
-#define SCALE(val)   FT_MulFix( val, scale )
-
-/* various constants used to describe the alignment of a horizontal */
-/* stem with regards to the blue zones                              */
-#define T1_ALIGN_NONE    0
-#define T1_ALIGN_BOTTOM  1
-#define T1_ALIGN_TOP     2
-#define T1_ALIGN_BOTH    3
-
-
-/************************************************************************
- *
- * <Function>
- *    t1_set_blue_zones
- *
- * <Description>
- *    Set a size object's blue zones during reset. This will compute
- *    the "snap" zone corresponding to each blue zone.
- *
- * <Input>
- *    size  :: handle to target size object
- *
- * <Return>
- *    Error code. 0 means success
- *
- * <Note>
- *    This functions does the following :
- *
- *      1. It extracts the bottom and top blue zones from the
- *         face object.
- *
- *      2. Each zone is then grown by  BlueFuzz, overlapping 
- *         is eliminated by adjusting the zone edges appropriately
- *
- *      3. For each zone, we keep its original font units position, its
- *         original scaled position, as well as its grown/adjusted
- *         edges.
- *
- ************************************************************************/
-
-      /* ultra simple bubble sort (not a lot of elements, mostly */
-      /* pre-sorted, no need for quicksort)                      */
-      static
-      void  t1_sort_blues( T1_Int*  blues,
-                           T1_Int   count )
-      {
-        T1_Int  i, swap;
-        T1_Int* cur;
-    
-        for ( i = 2; i < count; i += 2 )
-        {
-          cur = blues + i;
-          do
-          {
-            if ( cur[-1] < cur[0] )
-              break;
-    
-            swap = cur[-2]; cur[-2] = cur[0]; cur[0] = swap;
-            swap = cur[-1]; cur[-1] = cur[1]; cur[1] = swap;
-            cur -= 2;
-          }
-          while ( cur > blues );
-        }
-      }
-
-
-  static
-  T1_Error  t1_set_blue_zones( T1_Size  size )
-  {
-    T1_Face          face = (T1_Face)size->root.face;
-    T1_Font*         priv = &face->type1;
-    T1_Int           n;
-    T1_Int           blues[24];
-    T1_Int           num_bottom;
-    T1_Int           num_top;
-    T1_Int           num_blues;
-    T1_Size_Hints*   hints = size->hints;
-    T1_Snap_Zone*    zone;
-    T1_Pos           pix, orus;
-    T1_Pos           min, max, threshold;
-    T1_Fixed         scale;
-    T1_Bool          is_bottom;
-
-    /**********************************************************************/
-    /*                                                                    */
-    /*  COPY BOTTOM AND TOP BLUE ZONES IN LOCAL ARRAYS                    */
-    /*                                                                    */
-    /*                                                                    */
-
-    /* First of all, check the sizes of the /BlueValues and /OtherBlues */
-    /* tables. They all must contain an even number of arguments        */
-    if ( priv->num_other_blues & 1 ||
-         priv->num_blues       & 1 )
-    {
-      FT_ERROR(( "T1.Copy_Blues : odd number of blue values\n" ));
-      return T1_Err_Syntax_Error;
-    }
-
-    /* copy the bottom blue zones from /OtherBlues           */
-    num_top    = 0;
-    num_bottom = priv->num_other_blues;
-
-    for ( n = 0; n < num_bottom; n ++ )
-      blues[n] = priv->other_blues[n];
-
-    /* Add the first blue zone in /BlueValues to the table */
-    num_top = priv->num_blues - 2;
-    if ( num_top >= 0 )
-    {
-      blues[ num_bottom ] = priv->blue_values[0];
-      blues[num_bottom+1] = priv->blue_values[1];
-
-      num_bottom += 2;
-    }
-
-    /* sort the bottom blue zones */
-    t1_sort_blues( blues, num_bottom );
-
-    hints->num_bottom_zones = num_bottom >> 1;
-
-    /* now copy the /BlueValues to the top of the blues array */
-    if ( num_top > 0 )
-    {
-      for ( n = 0; n < num_top; n++ )
-        blues[ num_bottom+n ] = priv->blue_values[n+2];
-
-      /* sort the top blue zones */
-      t1_sort_blues( blues + num_bottom, num_top );
-    }
-    else
-      num_top = 0;
-
-    num_blues             = num_top + num_bottom;
-    hints->num_blue_zones = ( num_blues ) >> 1;
-
-    /**********************************************************************/
-    /*                                                                    */
-    /*    BUILD BLUE SNAP ZONES FROM THE LOCAL BLUES ARRAYS               */
-    /*                                                                    */
-    /*                                                                    */
-
-    scale     = size->root.metrics.y_scale;
-    zone      = hints->blue_zones;
-    threshold = ONE_PIXEL/4;   /* 0.25 pixels */
-
-    for ( n = 0; n < num_blues; n += 2, zone ++ )
-    {
-      is_bottom = ( n < num_bottom ? 1 : 0 );
-
-      orus = blues[n+is_bottom];  /* get alignement coordinate */
-      pix  = SCALE( orus );       /* scale it                  */
-
-      min  = SCALE( blues[ n ] - priv->blue_fuzz );
-      max  = SCALE( blues[n+1] + priv->blue_fuzz );
-
-      if ( min > pix - threshold ) min = pix - threshold;
-      if ( max < pix + threshold ) max = pix + threshold;
-
-      zone->orus = orus;
-      zone->pix  = pix;
-      zone->min  = min;
-      zone->max  = max;
-    }
-
-    /* adjust edges in case of overlap */
-    zone = hints->blue_zones;
-    for ( n = 0; n < num_blues-2; n += 2, zone ++ )
-    {
-      if ( n != num_bottom-2         &&
-           zone[0].max > zone[1].min )
-      {
-        zone[0].max = zone[1].min = (zone[0].pix+zone[1].pix)/2;
-      }
-    }
-
-    
-    /* Compare the current pixel size with the BlueScale value */
-    /* to know wether to supress overshoots..                  */
-    
-    hints->supress_overshoots = 
-      ( size->root.metrics.y_ppem < FT_MulFix(1000,priv->blue_scale) );
-
-    /* Now print the new blue values in tracing mode */
-#ifdef FT_DEBUG_LEVEL_TRACE
-    
-    FT_TRACE2(( "Blue Zones for size object at $%08lx :\n", (long)size ));
-    FT_TRACE2(( "   orus    pix    min   max\n" ));
-    FT_TRACE2(( "-------------------------------\n" ));
-    
-    zone = hints->blue_zones;
-    for ( n = 0; n < hints->num_blue_zones; n++ )
-    {
-      FT_TRACE2(( "    %3d   %.2f   %.2f  %.2f\n",
-                zone->orus, 
-                zone->pix/64.0,
-                zone->min/64.0, 
-                zone->max/64.0 ));
-      zone++;
-    }
-    FT_TRACE2(( "\nOver shoots are %s\n\n",
-              hints->supress_overshoots ? "supressed" : "active" ));
-
-#endif /* DEBUG_LEVEL_TRACE */
-                               
-    return T1_Err_Ok;
-  }
-
-
-
-/************************************************************************
- *
- * <Function>
- *    t1_set_snap_zones
- *
- * <Description>
- *    This function set a size object's stem snap zones.
- *
- * <Input>
- *    size :: handle to target size object
- *
- * <Return>
- *    Error code. 0 means success
- *
- * <Note>
- *    This function performs the following :
- *
- *      1. It reads and scales the stem snap widths from the parent face
- *     
- *      2. A "snap zone" is computed for each snap width, by "growing"
- *         it with a threshold of a 1/2 pixel. Overlapping is avoided
- *         through proper edge adjustment.
- *
- *      3. Each width whose zone contain the scaled standard set width
- *         is removed from the table
- *
- *      4. Finally, the standard set width is scaled, and its correponding
- *         "snap zone" is inserted into the sorted snap zones table
- *
- ************************************************************************/
-
-  static
-  T1_Error  t1_set_snap_zones( T1_Size  size )
-  {
-    T1_Int         n, direction, n_zones, num_zones;
-    T1_Snap_Zone*  zone;
-    T1_Snap_Zone*  base_zone;
-    T1_Short*      orgs;
-    T1_Pos         standard_width;
-    T1_Fixed       scale;
-
-    T1_Face          face = (T1_Face)size->root.face;
-    T1_Font*         priv = &face->type1;
-    T1_Size_Hints*  hints = size->hints;
-
-    /* start with horizontal snap zones */
-    direction      = 0;
-    standard_width = priv->standard_width;
-    n_zones        = priv->num_snap_widths;
-    base_zone      = hints->snap_widths;
-    orgs           = priv->stem_snap_widths;
-    scale          = size->root.metrics.x_scale;
-    
-    while (direction < 2)
-    {
-      /*****************************************************************/
-      /*                                                               */
-      /*  Read and scale stem snap widths table from the physical      */
-      /*  font record.                                                 */
-      /*                                                               */
-      T1_Pos  prev, orus, pix, min, max, threshold;
-      
-      threshold = ONE_PIXEL/4;
-      zone      = base_zone;
-
-      if ( n_zones > 0 )
-      {
-        orus = *orgs++;
-        pix  = SCALE( orus );
-        min  = pix-threshold;
-        max  = pix+threshold;
-
-        zone->orus = orus;
-        zone->pix  = pix;
-        zone->min  = min;
-        prev       = pix;
-
-        for ( n = 1; n < n_zones; n++ )
-        {
-          orus = *orgs++;
-          pix  = SCALE( orus );
-
-          if ( pix-prev < 2*threshold )
-          {
-            min = max = (pix+prev)/2;
-          }
-          else
-            min = pix-threshold;
-
-          zone->max = max;
-          zone++;
-          zone->orus = orus;
-          zone->pix  = pix;
-          zone->min  = min;
-
-          max  = pix+threshold;
-          prev = pix;
-        }
-        zone->max = max;
-      }
-
-      /* print the scaled stem snap values in tracing modes */
-#ifdef FT_DEBUG_LEVEL_TRACE
-      
-      FT_TRACE2(( "Set_Snap_Zones : first %s pass\n", 
-                direction ? "vertical" : "horizontal" ));
-                
-      FT_TRACE2(( "Scaled original stem snap zones :\n" ));
-      FT_TRACE2(( "   orus   pix   min   max\n" ));
-      FT_TRACE2(( "-----------------------------\n" ));
-      
-      zone = base_zone;
-      for ( n = 0; n < n_zones; n++, zone++ )
-        FT_TRACE2(( "  %3d  %.2f  %.2f  %.2f\n",
-                  zone->orus,
-                  zone->pix/64.0,
-                  zone->min/64.0,
-                  zone->max/64.0 ));
-      FT_TRACE2(( "\n" ));
-      
-      FT_TRACE2(( "Standard width = %d\n", standard_width ));
-#endif
-
-      /*****************************************************************/
-      /*                                                               */
-      /*  Now, each snap width which is in the range of the standard   */
-      /*  set width will be removed from the list..                    */
-      /*                                                               */
-
-      if ( standard_width > 0 )
-      {
-        T1_Snap_Zone*  parent;
-        T1_Pos         std_pix, std_min, std_max;
-
-        std_pix = SCALE( standard_width );        
-
-        std_min = std_pix-threshold;
-        std_max = std_pix+threshold;
-
-        num_zones = 0;
-        zone      = base_zone;
-        parent    = base_zone;
-
-        for ( n = 0; n < n_zones; n++ )
-        {
-          if ( zone->pix >= std_min && zone->pix <= std_max )
-          {
-            /* this zone must be removed from the list */
-            if ( std_min > zone->min ) std_min = zone->min;
-            if ( std_max < zone->max ) std_max = zone->max;
-          }
-          else
-          {
-            *parent++ = *zone;
-            num_zones++;
-          }
-          zone++;
-        }
-        
-        /**********************************************/
-        /*  Now, insert the standard width zone       */
-        
-        zone = base_zone+num_zones;
-        while ( zone > base_zone && zone[-1].pix > std_max )
-        {
-          zone[0] = zone[-1];
-          zone --;
-        }
-        
-        /* check border zones */
-        if ( zone > base_zone && zone[-1].max > std_min )
-          zone[-1].max = std_min;
-          
-        if ( zone < base_zone+num_zones && zone[1].min < std_max )
-          zone[1].min = std_max;
-        
-        zone->orus = standard_width;
-        zone->pix  = std_pix;
-        zone->min  = std_min;
-        zone->max  = std_max;
-        
-        num_zones++;
-      }
-      else
-        num_zones = n_zones;
-
-      /* save total number of stem snaps now */
-      if (direction) hints->num_snap_heights = num_zones;
-                else hints->num_snap_widths  = num_zones;
-
-      /* print the scaled stem snap values in tracing modes */
-#ifdef FT_DEBUG_LEVEL_TRACE
-      
-      FT_TRACE2(( "Set_Snap_Zones : second %s pass\n", 
-                direction ? "vertical" : "horizontal" ));
-                
-      FT_TRACE2(( "Scaled clipped stem snap zones :\n" ));
-      FT_TRACE2(( "   orus   pix   min   max\n" ));
-      FT_TRACE2(( "-----------------------------\n" ));
-      
-      zone = base_zone;
-      for ( n = 0; n < num_zones; n++, zone++ )
-        FT_TRACE2(( "  %3d  %.2f  %.2f  %.2f\n",
-                  zone->orus,
-                  zone->pix/64.0,
-                  zone->min/64.0,
-                  zone->max/64.0 ));
-      FT_TRACE2(( "\n" ));
-      
-      FT_TRACE2(( "Standard width = %d\n", standard_width ));
-#endif
-     
-      /* continue with vertical snap zone */
-      direction++;
-      standard_width = priv->standard_height;
-      n_zones        = priv->num_snap_heights;
-      base_zone      = hints->snap_heights;
-      orgs           = priv->stem_snap_heights;
-      scale          = size->root.metrics.y_scale;
-    }
-
-    return T1_Err_Ok;
-  }
-  
-
-/************************************************************************
- *
- * <Function>
- *    T1_New_Size_Hinter
- *
- * <Description>
- *    Allocates a new hinter structure for a given size object
- *
- * <Input>
- *    size :: handle to target size object
- *
- * <Return>
- *    Error code. 0 means success
- *
- ************************************************************************/
-
-  LOCAL_FUNC
-  T1_Error  T1_New_Size_Hinter( T1_Size  size )
-  {
-    FT_Memory  memory = size->root.face->memory;
-    
-    return MEM_Alloc( size->hints, sizeof(*size->hints) );
-  }
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_Done_Size_Hinter
- *
- * <Description>
- *    Releases a given size object's hinter structure
- *
- * <Input>
- *    size :: handle to target size object
- *
- ************************************************************************/
-
-  LOCAL_FUNC
-  void      T1_Done_Size_Hinter( T1_Size  size )
-  {
-    FT_Memory  memory = size->root.face->memory;
-
-    FREE( size->hints );
-  }
-
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_Reset_Size_Hinter
- *
- * <Description>
- *    Recomputes hinting information when a given size object has
- *    changed its resolutions/char sizes/pixel sizes
- *
- * <Input>
- *    size :: handle to size object
- *
- * <Return>
- *    Error code. 0 means success
- *
- ************************************************************************/
-
-  LOCAL_FUNC
-  T1_Error  T1_Reset_Size_Hinter( T1_Size  size )
-  {
-    return t1_set_blue_zones(size) || t1_set_snap_zones(size);
-  }
-
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_New_Glyph_Hinter
- *
- * <Description>
- *    Allocates a new hinter structure for a given glyph slot
- *
- * <Input>
- *    glyph :: handle to target glyph slot
- *
- * <Return>
- *    Error code. 0 means success
- *
- ************************************************************************/
-
-  LOCAL_FUNC
-  T1_Error  T1_New_Glyph_Hinter( T1_GlyphSlot  glyph )
-  {
-    FT_Memory  memory = glyph->root.face->memory;
-    
-    return MEM_Alloc( glyph->hints, sizeof(*glyph->hints) );
-  }
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_Done_Glyph_Hinter
- *
- * <Description>
- *    Releases a given glyph slot's hinter structure
- *
- * <Input>
- *    glyph :: handle to glyph slot
- *
- ************************************************************************/
-
-  LOCAL_FUNC
-  void  T1_Done_Glyph_Hinter( T1_GlyphSlot  glyph )
-  {
-    FT_Memory  memory = glyph->root.face->memory;
-
-    FREE( glyph->hints );
-  }
-
-
-
-  /**********************************************************************/
-  /**********************************************************************/
-  /**********************************************************************/
-  /**********                                                   *********/
-  /**********                                                   *********/
-  /**********              HINTED GLYPH LOADER                  *********/
-  /**********                                                   *********/
-  /**********   The following code is in charge of the first    *********/
-  /**********   and second pass when loading a single outline   *********/
-  /**********                                                   *********/
-  /**********************************************************************/
-  /**********************************************************************/
-  /**********************************************************************/
-
-  static
-  T1_Error   t1_hinter_ignore( void )
-  {
-    /* do nothing, used for "dotsection" which is unsupported for now */
-    return 0;
-  }
-
-  static
-  T1_Error   t1_hinter_stem( T1_Builder*  builder,
-                             T1_Pos       pos,
-                             T1_Int       width,
-                             T1_Bool      vertical )
-  {
-    T1_Stem_Table*   stem_table;
-    T1_Stem_Hint*    stems;
-    T1_Stem_Hint*    cur_stem;
-    T1_Int           min, max, n, num_stems;
-    T1_Bool          new_stem;
-    T1_Glyph_Hints*  hinter = builder->glyph->hints;
-
-    /* select the appropriate stem array */
-    stem_table = vertical ? &hinter->vert_stems : &hinter->hori_stems;
-    stems      = stem_table->stems;
-    num_stems  = stem_table->num_stems;
-
-    /* Compute minimum and maximum orus for the stem */
-    min = pos + ( vertical
-                ? builder->left_bearing.x
-                : builder->left_bearing.y );
-
-    if ( width >= 0 )
-      max = min + width;
-    else
-    {
-      /* a negative width indicates a ghost stem */
-      if ( width == -21 )
-        min += width;
-
-      max = min;
-    }
-
-    /* now scan the array. If we find a stem with the same borders */
-    /* simply activate it..                                        */
-    cur_stem = stems;
-    new_stem = 1;
-
-    for ( n = 0; n < num_stems; n++, cur_stem++ )
-    {
-      if ( cur_stem->min_edge.orus == min &&
-           cur_stem->max_edge.orus == max )
-      {
-        /* This stem is already in the table, simply activate it */
-        if ( (cur_stem->hint_flags & T1_HINT_FLAG_ACTIVE) == 0)
-        {
-          cur_stem->hint_flags  |= T1_HINT_FLAG_ACTIVE;
-          stem_table->num_active ++;
-        }
-        new_stem = 0;
-        break;
-      }
-    }
-
-    /* add a new stem to the array when necessary */
-    if (new_stem)
-    {
-      if (cur_stem >= stems + T1_HINTER_MAX_EDGES)
-      {
-        FT_ERROR(( "T1.Hinter : too many stems in glyph charstring\n" ));
-        return T1_Err_Syntax_Error;
-      }
-
-      /* on the first pass, we record the stem, otherwise, this is */
-      /* a bug in the glyph loader !!                              */
-      if ( builder->pass == 0 )
-      {
-        cur_stem->min_edge.orus = min;
-        cur_stem->max_edge.orus = max;
-        cur_stem->hint_flags    = T1_HINT_FLAG_ACTIVE;
-
-        stem_table->num_stems++;
-        stem_table->num_active++;
-      }
-      else
-      {
-        FT_ERROR(( "T1.Hinter : fatal glyph loader bug - pass2-stem\n" ));
-        return T1_Err_Syntax_Error;
-      }
-    }
-
-    return T1_Err_Ok;
-  }
-
-
-  static
-  T1_Error   t1_hinter_stem3( T1_Builder*  builder,
-                              T1_Pos       pos0,
-                              T1_Int       width0,
-                              T1_Pos       pos1,
-                              T1_Int       width1,
-                              T1_Pos       pos2,
-                              T1_Int       width2,
-                              T1_Bool      vertical )
-  {
-    /* For now, don't be elitist and simply call "stem" 3 times */
-    return t1_hinter_stem( builder, pos0, width0, vertical ) ||
-           t1_hinter_stem( builder, pos1, width1, vertical ) ||
-           t1_hinter_stem( builder, pos2, width2, vertical );
-  }
-
-
-  static
-  T1_Error  t1_hinter_changehints( T1_Builder*  builder )
-  {
-    T1_Int           dimension;
-    T1_Stem_Table*   stem_table;
-    T1_Glyph_Hints*  hinter = builder->glyph->hints;
-
-    /* if we're in the second pass of glyph hinting, we must    */
-    /* call the function T1_Hint_Points on the builder in order */
-    /* to force the fit the latest points to the pixel grid     */
-    if ( builder->pass == 1 )
-      T1_Hint_Points( builder );
-
-    /* Simply de-activate all hints in all arrays */
-    stem_table = &hinter->hori_stems;
-
-    for ( dimension = 2; dimension > 0; dimension-- )
-    {
-      T1_Stem_Hint*  cur   = stem_table->stems;
-      T1_Stem_Hint*  limit = cur + stem_table->num_stems;
-
-      for ( ; cur < limit; cur++ )
-        cur->hint_flags &= ~T1_HINT_FLAG_ACTIVE;
-
-      stem_table->num_active = 0;
-      stem_table = &hinter->vert_stems;
-    }
-
-    return T1_Err_Ok;
-  }
-
-
-  LOCAL_FUNC
-  const T1_Hinter_Funcs  t1_hinter_funcs =
-  {
-    (T1_Hinter_ChangeHints)  t1_hinter_changehints,
-    (T1_Hinter_DotSection)   t1_hinter_ignore,
-    (T1_Hinter_Stem)         t1_hinter_stem,
-    (T1_Hinter_Stem3)        t1_hinter_stem3
-  };
-
-
-  /**********************************************************************/
-  /**********************************************************************/
-  /**********************************************************************/
-  /**********                                                   *********/
-  /**********                                                   *********/
-  /**********              STEM HINTS MANAGEMENT                *********/
-  /**********                                                   *********/
-  /**********   The following code is in charge of computing    *********/
-  /**********   the placement of each scaled stem hint..        *********/
-  /**********                                                   *********/
-  /**********************************************************************/
-  /**********************************************************************/
-  /**********************************************************************/
-
-/************************************************************************
- *
- * <Function>
- *    t1_sort_hints
- *
- * <Description>
- *    Sort the list of active stems in increasing order, through
- *    the "sort" indexing table
- *
- * <Input>
- *    table  :: a stem hints table
- *
- ************************************************************************/
-
-  static
-  void  t1_sort_hints( T1_Stem_Table*  table )
-  {
-    T1_Int         num_stems   = table->num_stems;
-    T1_Int         num_active  = 0;
-    T1_Int*        sort        = table->sort;
-    T1_Stem_Hint*  stems       = table->stems;
-    T1_Int         n;
-
-    /* record active stems in sort table */
-    for ( n = 0; n < num_stems; n++ )
-    {
-      if ( stems[n].hint_flags & T1_HINT_FLAG_ACTIVE )
-        sort[num_active++] = n;
-    }
-
-    /* now sort the indices. There are usually very few stems, */
-    /* and they are pre-sorted in 90% cases, so we choose a    */
-    /* simple bubble sort (quicksort would be slower)..        */
-    for ( n = 1; n < num_active; n++ )
-    {
-      T1_Int        p   = n-1;
-      T1_Stem_Hint* cur = stems + sort[n];
-
-      do
-      {
-        T1_Int         swap;
-        T1_Stem_Hint*  prev = stems + sort[p];
-
-        /* note that by definition, the active stems cannot overlap    */
-        /* so we simply compare their "min" to sort them..             */
-        /* (we could compare their max, this wouldn't change anything) */
-        if ( prev->min_edge.orus <= cur->min_edge.orus )
-          break;
-
-        /* swap elements */
-        swap      = sort[ p ];
-        sort[ p ] = sort[p+1];
-        sort[p+1] = swap;
-        p--;
-      }
-      while ( p >= 0 );
-    }
-
-    table->num_active = num_active;
-  }
-
-
-/************************************************************************
- *
- * <Function>
- *    t1_hint_horizontal_stems
- *
- * <Description>
- *    Compute the location of each scaled horizontal stem hint.
- *    This takes care of the blue zones and the horizontal stem
- *    snap table
- *
- * <Input>
- *    table     :: the horizontal stem hints table
- *    hints     :: the current size's hint structure
- *    blueShift :: the value of the /BlueShift as taken from the
- *                 face object.                               
- *    scale     :: the 16.16 scale used to convert outline
- *                 units to 26.6 pixels
- *
- * <Note>
- *    For now, all stems are hinted independently from each other.
- *    It might be necessary, for better performance, to introduce
- *    the notion of "controlled" hints describing things like
- *    counter-stems, stem3 as well as overlapping stems control.
- *
- ************************************************************************/
-
-  static
-  void  t1_hint_horizontal_stems( T1_Stem_Table*  table,
-                                  T1_Size_Hints*  hints,
-                                  T1_Pos          blueShift,
-                                  T1_Fixed        scale )
-  {
-    T1_Stem_Hint*  stem      = table->stems;
-    T1_Stem_Hint*  limit     = stem + table->num_stems;
-
-    /* first of all, scale the blueShift */
-    blueShift = SCALE(blueShift);
-
-    /* then scan the horizontal stem table */
-    for ( ; stem < limit; stem++ )
-    {
-      T1_Pos  bottom_orus = stem->min_edge.orus;
-      T1_Pos  top_orus    = stem->max_edge.orus;
-
-      T1_Pos  top_pix     = SCALE( top_orus );
-      T1_Pos  bottom_pix  = SCALE( bottom_orus );
-      T1_Pos  width_pix   = top_pix - bottom_pix;
-
-      T1_Pos  bottom      = bottom_pix;
-      T1_Pos  top         = top_pix;
-      T1_Int  align       = T1_ALIGN_NONE;
-
-      /******************************************************************/
-      /* Snap pixel width if in stem snap range                         */
-      {
-        T1_Snap_Zone*  zone       = hints->snap_heights;
-        T1_Snap_Zone*  zone_limit = zone + hints->num_snap_heights;
-
-        for ( ; zone < zone_limit; zone++ )
-        {
-          if ( width_pix < zone->min )
-            break;
-
-          if ( width_pix <= zone->max )
-          {
-            width_pix = zone->pix;
-            break;
-          }
-        }
-      }
-
-      /******************************************************************/
-      /* round width - minimum 1 pixel if this isn't a ghost stem       */
-      if ( width_pix > 0 )
-        width_pix = ( width_pix < ONE_PIXEL ? ONE_PIXEL : ROUND(width_pix) );
-
-
-      /******************************************************************/
-      /* Now check for bottom blue zones alignement                     */
-      {
-        T1_Int         num_blues  = hints->num_bottom_zones;
-        T1_Snap_Zone*  blue       = hints->blue_zones;
-        T1_Snap_Zone*  blue_limit = blue + num_blues;
-
-        for ( ; blue < blue_limit; blue++ )
-        {
-          if ( bottom_pix < blue->min )
-            break;
-
-          if ( bottom_pix <= blue->max )
-          {
-            align  = T1_ALIGN_BOTTOM;
-            bottom = ROUND( blue->pix );
-
-            /* implements blue shift */
-            if (!hints->supress_overshoots)
-            {
-              T1_Pos  delta = blue->pix - bottom_pix;
-              
-              delta   = ( delta < blueShift ? 0 : ROUND( delta ) );
-              bottom -= delta;
-            }
-          }
-        }
-      }
-
-
-      /******************************************************************/
-      /* Check for top blue zones alignement */
-      {
-        T1_Int         num_blues  = hints->num_blue_zones - 
-                                    hints->num_bottom_zones;
-
-        T1_Snap_Zone*  blue       = hints->blue_zones +
-                                    hints->num_bottom_zones;
-
-        T1_Snap_Zone*  blue_limit = blue + num_blues;
-
-        for ( ; blue < blue_limit; blue++ )
-        {
-          if ( top_pix < blue->min )
-            break;
-
-          if ( top_pix <= blue->max )
-          {
-            align  |= T1_ALIGN_TOP;
-            top     = ROUND( blue->pix );
-
-            /* implements blue shift */
-            if (!hints->supress_overshoots)
-            {
-              T1_Pos  delta = top - blue->pix;
-              
-              delta  = ( delta < blueShift ? 0 : ROUND( delta ) );
-              top   += delta;
-            }
-          }
-        }
-      }
-
-
-      /******************************************************************/
-      /* compute the hinted stem position, according to its alignment   */
-      switch (align)
-      {
-        case T1_ALIGN_BOTTOM:  /* bottom zone alignement */
-          bottom_pix = bottom;
-          top_pix    = bottom + width_pix;
-          break;
-          
-        case T1_ALIGN_TOP:  /* top zone alignement */
-          top_pix    = top;
-          bottom_pix = top - width_pix;
-          
-          break;
-          
-        case T1_ALIGN_BOTH:  /* bottom+top zone alignement */
-          bottom_pix = bottom;
-          top_pix    = top;
-          break;
-          
-        default:  /* no alignement */
-
-          /* XXXX : TODO : Add management of controlled stems */        
-          bottom = ( SCALE(bottom_orus+top_orus) - width_pix )/2;
-        
-          bottom_pix = ROUND(bottom);
-          top_pix    = bottom_pix + width_pix;
-      }
-      
-      stem->min_edge.pix = bottom_pix;
-      stem->max_edge.pix = top_pix;
-    }
-  }
-
-
-
-
-/************************************************************************
- *
- * <Function>
- *    t1_hint_vertical_stems
- *
- * <Description>
- *    Compute the location of each scaled vertical stem hint.
- *    This takes care of the vertical stem snap table
- *
- * <Input>
- *    table     :: the vertical stem hints table
- *    hints     :: the current size's hint structure
- *    scale     :: the 16.16 scale used to convert outline
- *                 units to 26.6 pixels
- *
- * <Note>
- *    For now, all stems are hinted independently from each other.
- *    It might be necessary, for better performance, to introduce
- *    the notion of "controlled" hints describing things like
- *    counter-stems, stem3 as well as overlapping stems control.
- *
- ************************************************************************/
-
-  /* compute the location of each scaled vertical stem hint. */
-  /* Take care of blue zones and stem snap table             */
-  static
-  void  t1_hint_vertical_stems( T1_Stem_Table*  table,
-                                T1_Size_Hints*  hints,
-                                T1_Fixed        scale )
-  {
-    T1_Stem_Hint*  stem  = table->stems;
-    T1_Stem_Hint*  limit = stem + table->num_stems;
-
-    for ( ; stem < limit; stem++ )
-    {
-      T1_Pos  stem_left  = stem->min_edge.orus;
-      T1_Pos  stem_right = stem->max_edge.orus;
-      T1_Pos  width_pix, left;
-
-      width_pix = SCALE( stem_right - stem_left );
-
-      /* Snap pixel width if in stem snap range */
-      {
-        T1_Snap_Zone*  zone       = hints->snap_widths;
-        T1_Snap_Zone*  zone_limit = zone + hints->num_snap_widths;
-
-        for ( ; zone < zone_limit; zone++ )
-        {
-          if ( width_pix < zone->min )
-            break;
-
-          if ( width_pix <= zone->max )
-          {
-            width_pix = zone->pix;
-            break;
-          }
-        }
-      }
-   
-      /* round width - minimum 1 pixel if this isn't a ghost stem */
-      if ( width_pix > 0 )
-        width_pix = ( width_pix < ONE_PIXEL ? ONE_PIXEL :
-                                              ROUND( width_pix ) );
-
-      /* now place the snapped and rounded stem   */
-
-      /* XXXX : TODO : implement controlled stems for the overlapping */
-      /*               cases..                                        */
-
-      left = ( SCALE(stem_left+stem_right) - width_pix )/2;
-
-      stem->min_edge.pix = ROUND(left);
-      stem->max_edge.pix = stem->min_edge.pix + width_pix;
-    }
-  }
-
-
-
-
-/************************************************************************
- *
- * <Function>
- *    t1_hint_point
- *
- * <Description>
- *    Grid-fit a coordinate with regards to a given stem hints table
- *
- * <Input>
- *    table  :: the source stem hints table
- *    coord  :: original coordinate, expressed in font units
- *    scale  :: the 16.16 scale used to convert font units into
- *              26.6 pixels
- *
- * <Return>
- *    the hinted/scaled value in 26.6 pixels
- *
- * <Note>
- *    For now, all stems are hinted independently from each other.
- *    It might be necessary, for better performance, to introduce
- *    the notion of "controlled" hints describing things like
- *    counter-stems, stem3 as well as overlapping stems control.
- *
- ************************************************************************/
-
-  static
-  T1_Pos  t1_hint_point( T1_Stem_Table*  table,
-                         T1_Pos          coord,
-                         T1_Fixed        scale )
-  {
-    T1_Int         num_active = table->num_active;
-    T1_Int         n;
-    T1_Stem_Hint*  prev = 0;
-    T1_Stem_Hint*  cur  = 0;
-    T1_Edge*       min;
-    T1_Edge*       max;
-    T1_Pos         delta;
-
-    /* only hint when there is at least one stem defined */
-    if (num_active <= 0)
-      return SCALE(coord);
-
-    /* scan the stem table to determine placement of coordinate */
-    /* relative to the list of sorted and stems                 */
-    for ( n = 0; n < num_active; n++, prev = cur )
-    {
-      cur = table->stems + table->sort[n];
-
-      /* is it on the left of the current edge ? */
-      delta = cur->min_edge.orus - coord;
-      if ( delta == 0 ) return cur->min_edge.pix;
-
-      if (delta > 0)
-      {
-        /* if this is the left of the first edge, simply shift */
-        if (!prev) return cur->min_edge.pix - SCALE(delta);
-
-        /* otherwise, interpolate between the maximum of the */
-        /* previous stem, and the minimum of the current one */
-        min = &prev->max_edge;
-        max = &cur->min_edge;
-        goto Interpolate;
-      }
-
-      /* is it within the current edge ? */
-      delta = cur->max_edge.orus - coord;
-      if ( delta == 0 ) return cur->max_edge.pix;
-
-      if (delta > 0)
-      {
-        /* interpolate within the stem */
-        min = &cur->min_edge;
-        max = &cur->max_edge;
-        goto Interpolate;
-      }
-    }
-
-    /* apparently, this coordinate is on the right of the last stem */
-    delta = coord - cur->max_edge.orus;
-    return cur->max_edge.pix + SCALE(delta);
-
-  Interpolate:
-    return min->pix +
-            FT_MulDiv( coord     - min->orus,
-                       max->pix  - min->pix,
-                       max->orus - min->orus );
-  }
-
-
-
-
-
-
-#if 1
-
-/************************************************************************
- *
- * <Function>
- *   T1_Hint_Points
- *
- * <Description>
- *   this function grid-fits several points in a given Type 1 builder
- *   at once. 
- *
- * <Input>
- *   builder  :: handle to target Type 1 builder
- *   first    :: first point to hint in builder's current outline
- *   last     :: last point to hint in builder's current outline
- *
- ************************************************************************/
-
-  LOCAL_FUNC
-  void  T1_Hint_Points( T1_Builder*  builder )
-  {
-    T1_Int    first   = builder->hint_point;
-    T1_Int    last    = builder->current.n_points-1;
-
-    T1_Size   size    = builder->size;
-    T1_Fixed  scale_x = size->root.metrics.x_scale;
-    T1_Fixed  scale_y = size->root.metrics.y_scale;
-
-    T1_Glyph_Hints*  hints      = builder->glyph->hints;
-    T1_Stem_Table*   hori_stems = &hints->hori_stems;
-    T1_Stem_Table*   vert_stems = &hints->vert_stems;
-
-    T1_Vector*  cur   = builder->current.points + first;
-    T1_Vector*  limit = cur + last - first + 1;
-
-    /* first of all, sort the active stem hints */
-    t1_sort_hints( hori_stems );
-    t1_sort_hints( vert_stems );
-
-    for ( ; cur < limit; cur++ )
-    {
-      cur->x = t1_hint_point( vert_stems, cur->x, scale_x );
-      cur->y = t1_hint_point( hori_stems, cur->y, scale_y );
-    }
-
-    builder->hint_point = builder->current.n_points;
-  }
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_Hint_Stems
- *
- * <Description>
- *    This function is used to compute the location of each stem hint
- *    between the first and second passes of the glyph loader on the
- *    charstring.
- *
- * <Input>
- *    builder :: handle to target builder
- *
- ************************************************************************/
-
-  LOCAL_FUNC
-  void  T1_Hint_Stems( T1_Builder*  builder )
-  {
-    T1_Glyph_Hints*  hints = builder->glyph->hints;
-    T1_Font*         priv  = &builder->face->type1;
-
-    T1_Size   size    = builder->size;
-    T1_Fixed  scale_x = size->root.metrics.x_scale;
-    T1_Fixed  scale_y = size->root.metrics.y_scale;
-
-    t1_hint_horizontal_stems( &hints->hori_stems,
-                              builder->size->hints,
-                              priv->blue_shift,
-                              scale_y );
-
-    t1_hint_vertical_stems( &hints->vert_stems,
-                            builder->size->hints,
-                            scale_x );
-  }
-
-#endif
diff --git a/src/type1z/t1hinter.h b/src/type1z/t1hinter.h
deleted file mode 100644
index 4bf753a..0000000
--- a/src/type1z/t1hinter.h
+++ /dev/null
@@ -1,380 +0,0 @@
-/*******************************************************************
- *
- *  t1hinter.h                                                 1.2
- *
- *    Type1 hinter.         
- *
- *  Copyright 1996-1999 by
- *  David Turner, Robert Wilhelm, and Werner Lemberg.
- *
- *  This file is part of the FreeType project, and may only be used
- *  modified and distributed under the terms of the FreeType project
- *  license, LICENSE.TXT.  By continuing to use, modify, or distribute
- *  this file you indicate that you have read the license and
- *  understand and accept it fully.
- *
- *
- *  The Hinter is in charge of fitting th scaled outline to the
- *  pixel grid in order to considerably improve the quality of
- *  the Type 1 font driver's output..
- *
- ******************************************************************/
-
-#ifndef T1HINTER_H
-#define T1HINTER_H
-
-#include <t1objs.h>
-#include <t1gload.h>
-
-#ifdef __cplusplus
-  extern "C" {
-#endif
-
-
-/************************************************************************
- *
- * <Struct>
- *   T1_Snap_Zone
- *
- * <Description>
- *   A "snap zone" is used to model either a blue zone or a stem width
- *   at a given character size. It is made of a minimum and maximum
- *   edge, defined in 26.6 pixels, as well as one "original" and
- *   "scaled" position.
- *
- *   the position corresponds to the stem width (for stem snap zones)
- *   or to the blue position (for blue zones)
- *
- * <Fields>
- *   orus  :: original position in font units
- *   pix   :: current position in sub-pixel units
- *   min   :: minimum boundary in sub-pixel units
- *   max   :: maximim boundary in sub-pixel units
- *
- ************************************************************************/
-
-  typedef struct T1_Snap_Zone_
-  {
-    T1_Pos  orus;
-    T1_Pos  pix; 
-    T1_Pos  min; 
-    T1_Pos  max;  
-  
-  } T1_Snap_Zone;
-
-
-/************************************************************************
- *
- * <Struct>
- *   T1_Edge
- *
- * <Description>
- *   A very simply structure used to model an stem edge
- *
- * <Fields>
- *   orus  :: original edge position in font units
- *   pix   :: scaled edge position in sub-pixel units
- *
- ************************************************************************/
-
-  typedef struct T1_Edge_
-  {
-    T1_Pos  orus;
-    T1_Pos  pix;  
-  
-  } T1_Edge;
-
-
-/************************************************************************
- *
- * <Struct>
- *    T1_Stem_Hint
- *
- * <Description>
- *    A simple structure used to model a stem hint
- *
- * <Fields>
- *    min_edge   :: the hint's minimum edge
- *    max_edge   :: the hint's maximum edge
- *    hint_flags :: some flags describing the stem properties
- *
- * <Note>
- *    the min and max edges of a ghost stem have the same position,
- *    even if they're coded in a weird way in the charstrings
- *
- ************************************************************************/
-
-  typedef struct T1_Stem_Hint_
-  {
-    T1_Edge  min_edge;
-    T1_Edge  max_edge;
-    T1_Int   hint_flags;
-
-  } T1_Stem_Hint;
-
-
-#define T1_HINT_FLAG_ACTIVE      1    /* indicates an active stem */
-#define T1_HINT_FLAG_MIN_BORDER  2    /* unused for now..         */
-#define T1_HINT_FLAG_MAX_BORDER  4    /* unused for now..         */
-
-
-/* hinter's configuration constants */
-#define T1_HINTER_MAX_BLUES    24    /* maximum number of blue zones      */
-#define T1_HINTER_MAX_SNAPS    16    /* maximum number of stem snap zones */
-#define T1_HINTER_MAX_EDGES    64    /* maximum number of stem hints      */
-
-
-/************************************************************************
- *
- * <Struct>
- *   T1_Size_Hints
- *
- * <Description>
- *   A structure used to model the hinting information related to
- *   a size object
- *
- * <Fields>
- *   supress_overshoots :: a boolean flag to tell when overshoot
- *                         supression should occur.
- *
- *   num_blue_zones     :: the total number of blue zones (top+bottom)
- *   num_bottom_zones   :: the number of bottom zones
- *
- *   blue_zones         :: the blue zones table. bottom zones are
- *                         stored first in the table, followed by
- *                         all top zones
- *
- *   num_stem_snapH     :: number of horizontal stem snap zones
- *   stem_snapH         :: horizontal stem snap zones
- *
- *   num_stem_snapV     :: number of vertical stem snap zones
- *   stem_snapV         :: vertical stem snap zones
- *
- ************************************************************************/
-
-  struct T1_Size_Hints_
-  {
-    T1_Bool       supress_overshoots;
-
-    T1_Int        num_blue_zones;
-    T1_Int        num_bottom_zones;
-    T1_Snap_Zone  blue_zones[ T1_HINTER_MAX_BLUES ];
-
-    T1_Int        num_snap_widths;
-    T1_Snap_Zone  snap_widths[ T1_HINTER_MAX_SNAPS ];
-
-    T1_Int        num_snap_heights;
-    T1_Snap_Zone  snap_heights[ T1_HINTER_MAX_SNAPS ];
-  };
-
-
-
-/************************************************************************
- *
- * <Struct>
- *    T1_Stem_Table
- *
- * <Description>
- *    A simple structure used to model a set of stem hints in a
- *    single direction during the loading of a given glyph outline.
- *    Not all stem hints are active at a time. Moreover, stems must
- *    be sorted regularly
- *
- * <Fields>
- *    num_stems   :: total number of stems in table
- *    num_active  :: number of active stems in table
- *
- *    stems       :: the table of all stems
- *    sort        :: a table of indices into the stems table, used
- *                   to keep a sorted list of the active stems
- *
- ************************************************************************/
-
-  typedef struct T1_Stem_Table_
-  {
-    T1_Int        num_stems;
-    T1_Int        num_active;
-
-    T1_Stem_Hint  stems[ T1_HINTER_MAX_EDGES ];
-    T1_Int        sort [ T1_HINTER_MAX_EDGES ];
-
-  } T1_Stem_Table;
-
-
-
-/************************************************************************
- *
- * <Struct>
- *   T1_Glyph_Hints
- *
- * <Description>
- *   A structure used to model the stem hints of a given glyph outline
- *   during glyph loading. 
- *
- * <Fields>
- *   hori_stems  :: horizontal stem hints table
- *   vert_stems  :: vertical stem hints table
- *
- ************************************************************************/
-
-  struct T1_Glyph_Hints_
-  {
-    T1_Stem_Table  hori_stems;
-    T1_Stem_Table  vert_stems;
-  };
-
-
-
-/************************************************************************
- *
- * <Data>
- *    t1_hinter_funcs
- *
- * <Description>
- *    A table containing the address of various functions used during
- *    the loading of an hinted scaled outline
- *
- ************************************************************************/
-
-  LOCAL_DEF
-  const T1_Hinter_Funcs  t1_hinter_funcs;
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_New_Size_Hinter
- *
- * <Description>
- *    Allocates a new hinter structure for a given size object
- *
- * <Input>
- *    size :: handle to target size object
- *
- * <Return>
- *    Error code. 0 means success
- *
- ************************************************************************/
-
-  LOCAL_DEF
-  T1_Error  T1_New_Size_Hinter( T1_Size  size );
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_Done_Size_Hinter
- *
- * <Description>
- *    Releases a given size object's hinter structure
- *
- * <Input>
- *    size :: handle to target size object
- *
- ************************************************************************/
-
-  LOCAL_DEF
-  void      T1_Done_Size_Hinter( T1_Size  size );
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_Reset_Size_Hinter
- *
- * <Description>
- *    Recomputes hinting information when a given size object has
- *    changed its resolutions/char sizes/pixel sizes
- *
- * <Input>
- *    size :: handle to size object
- *
- * <Return>
- *    Error code. 0 means success
- *
- ************************************************************************/
-
-  LOCAL_DEF
-  T1_Error  T1_Reset_Size_Hinter( T1_Size  size );
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_New_Glyph_Hinter
- *
- * <Description>
- *    Allocates a new hinter structure for a given glyph slot
- *
- * <Input>
- *    glyph :: handle to target glyph slot
- *
- * <Return>
- *    Error code. 0 means success
- *
- ************************************************************************/
-
-  LOCAL_DEF
-  T1_Error  T1_New_Glyph_Hinter( T1_GlyphSlot  glyph );
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_Done_Glyph_Hinter
- *
- * <Description>
- *    Releases a given glyph slot's hinter structure
- *
- * <Input>
- *    glyph :: handle to glyph slot
- *
- ************************************************************************/
-
-  LOCAL_DEF
-  void      T1_Done_Glyph_Hinter( T1_GlyphSlot  glyph );
-
-
-
-
-/************************************************************************
- *
- * <Function>
- *   T1_Hint_Points
- *
- * <Description>
- *   this function grid-fits several points in a given Type 1 builder
- *   at once. 
- *
- * <Input>
- *   builder  :: handle to target Type 1 builder
- *
- ************************************************************************/
-
-  LOCAL_DEF
-  void  T1_Hint_Points( T1_Builder*  builder );
-
-
-/************************************************************************
- *
- * <Function>
- *    T1_Hint_Stems
- *
- * <Description>
- *    This function is used to compute the location of each stem hint
- *    between the first and second passes of the glyph loader on the
- *    charstring.
- *
- * <Input>
- *    builder :: handle to target builder
- *
- ************************************************************************/
-
-  LOCAL_DEF
-  void  T1_Hint_Stems( T1_Builder*  builder );
-
-#ifdef __cplusplus
-  }
-#endif
-
-#endif /* T1HINTER_H */