File: cvdgloss.c

package info (click to toggle)
fontforge 1%3A20161005~dfsg-4%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 69,324 kB
  • ctags: 44,030
  • sloc: ansic: 578,448; python: 5,546; sh: 3,374; makefile: 1,323; perl: 315; cpp: 176; ruby: 95; objc: 92; xml: 90; sed: 9
file content (1588 lines) | stat: -rw-r--r-- 56,803 bytes parent folder | download | duplicates (2)
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
/* Copyright (C) 2005-2012 by George Williams */
/*
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.

 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.

 * The name of the author may not be used to endorse or promote products
 * dercved from this software without specific prior written permission.

 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
#include "fontforgeui.h"
#include <math.h>
#include <gkeysym.h>
#include <ustring.h>
#include <stdarg.h>

extern GBox _ggadget_Default_Box;
#define MAIN_FOREGROUND (_ggadget_Default_Box.main_foreground)

#ifdef FREETYPE_HAS_DEBUGGER

#include <ft2build.h>
#include FT_FREETYPE_H

#include <internal/internal.h>
#include "ttinterp.h"

#define PPEMX(exc)	((exc)->size->root.metrics.x_ppem)
#define PPEMY(exc)	((exc)->size->root.metrics.y_ppem)

struct scr {
    int y, fh;
    int lines;
    GWindow pixmap;
};

static int ttround(int val, TT_ExecContext exc) {
    if ( val<0 )
return( -ttround(-val,exc));

    switch ( exc->GS.round_state ) {
      case TT_Round_To_Grid:
	val = 64*((val+32)/64);
      break;
      case TT_Round_Down_To_Grid:
	val = 64*(val/64);
      break;
      case TT_Round_Up_To_Grid:
	val = 64*((val+63)/64);
      break;
      case TT_Round_To_Half_Grid:
	val = 64*(val/64)+32;
      break;
      case TT_Round_Super:
	val = (val - exc->phase + exc->threshold) & -exc->period;
	val += exc->phase;
      break;
      case TT_Round_Super_45:
	val = ((val - exc->phase + exc->threshold) / exc->period)*exc->period;
	val += exc->phase;
      break;
    }
return(val);
}

static void scrprintf(struct scr *scr, char *format, ... ) {
    va_list ap;
    char buffer[100];

    va_start(ap,format);
    vsnprintf(buffer,sizeof(buffer),format,ap);
    GDrawDrawText8(scr->pixmap,3,scr->y,buffer,-1,MAIN_FOREGROUND);
    scr->y += scr->fh;
    ++scr->lines;
    va_end(ap);
}

static void scrrounding(struct scr *scr, TT_ExecContext exc ) {
    scrprintf(scr, "RndState: %s",
	    exc->GS.round_state==TT_Round_To_Half_Grid? "To Half Grid" :
	    exc->GS.round_state==TT_Round_To_Grid? "To Grid" :
	    exc->GS.round_state==TT_Round_To_Double_Grid? "To Double Grid" :
	    exc->GS.round_state==TT_Round_Down_To_Grid? "Down To Grid" :
	    exc->GS.round_state==TT_Round_Up_To_Grid? "Up To Grid" :
	    exc->GS.round_state==TT_Round_Off? "Off" :
	    exc->GS.round_state==TT_Round_Super? "Super" :
	    exc->GS.round_state==TT_Round_Super_45? "Super45" :
		"Unknown" );
}

static void scrfree(struct scr *scr, TT_ExecContext exc ) {
    scrprintf(scr, "freeVec: %g,%g", (((int)exc->GS.freeVector.x<<16)>>(16+14)) + ((exc->GS.freeVector.x&0x3fff)/16384.0),
	    (((int)exc->GS.freeVector.y<<16)>>(16+14)) + ((exc->GS.freeVector.y&0x3fff)/16384.0) );
}

static void scrproj(struct scr *scr, TT_ExecContext exc ) {
    scrprintf(scr,"projVec: %g,%g", (((int)exc->GS.projVector.x<<16)>>(16+14)) + ((exc->GS.projVector.x&0x3fff)/16384.0),
	    (((int)exc->GS.projVector.y<<16)>>(16+14)) + ((exc->GS.projVector.y&0x3fff)/16384.0) );
}

static int DVGlossExpose(GWindow pixmap,DebugView *dv,GEvent *event) {
    TT_ExecContext exc = DebuggerGetEContext(dv->dc);
    CharView *cv = dv->cv;
    long val1, val2, ret, i, cnt, off, a1, a2, b1, b2;
    int operator;
    BasePoint freedom;
    struct scr scr;
    int base;

    GDrawFillRect(pixmap,&event->u.expose.rect,GDrawGetDefaultBackground(screen_display));
    GDrawSetFont(pixmap,dv->ii.gfont);
    scr.pixmap = pixmap;
    scr.y = 3+dv->ii.as - dv->gloss_offtop*dv->ii.fh;
    scr.lines = 0;
    scr.fh = dv->ii.fh;

    if ( exc==NULL ) {
	scrprintf(&scr,"<not running>");
return(1);
    }
    if ( exc->IP>=exc->codeSize || exc->code==NULL ) {
	scrprintf(&scr,"<at end>");
return(1);
    }

    operator = ((uint8 *) exc->code)[exc->IP];
    if ( operator>=0xc0 && operator <= 0xdf ) {
        scrprintf(&scr," MDRP: Move Direct Relative Point");
	if ( operator&0x10 )
	    scrprintf(&scr,(operator&0x10)?"  Set rp0 to point":"  don't set rp0 to point" );
	scrprintf(&scr,(operator&8)?"  Keep distance>=min dist":"  don't keep distance>=min dist");
	scrprintf(&scr,(operator&4)?"  Round distance":"  don't round distance");
	scrprintf(&scr,(operator&3)==0?"  Grey":(operator&3)==1?"  Black":(operator&3)==2?"  White":"  Undefined Rounding");
	scrprintf(&scr,"Move point so cur distance to rp0 is");
	scrprintf(&scr," the same as the original distance between");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (point (%.2f,%.2f))", val1,
		exc->zp1.cur[val1].x/64.0,exc->zp1.cur[val1].y/64.0 ); 
	scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" ); 
	val2 = exc->GS.rp0;
	scrprintf(&scr,"Reference Point rp0: %d (%.2f,%.2f)", val2,
		exc->zp0.cur[val2].x/64.0,exc->zp0.cur[val2].y/64.0 ); 
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" ); 
	scrprintf(&scr,"Sets rp1: %d (rp0)", val2);
	scrprintf(&scr,"Sets rp2: %d (point)", val1);
	scrprintf(&scr, "MinDist: %.2f", exc->GS.minimum_distance/64.0 );
	scrprintf(&scr, "SingWidVal: %.2f", exc->GS.single_width_value/64.0 );
	scrprintf(&scr, "SingWidCut: %.2f", exc->GS.single_width_cutin/64.0 );
	scrrounding(&scr,exc);
	scrfree(&scr,exc);
	scrproj(&scr,exc);
    } else if ( operator>=0xe0 && operator <= 0xff ) {
        scrprintf(&scr," MIRP: Move Indirect Relative Point");
	if ( operator&0x10 )
	    scrprintf(&scr,(operator&0x10)?"  Set rp0 to point":"  don't set rp0 to point" );
	scrprintf(&scr,(operator&8)?"  Keep distance>=min dist":"  don't keep distance>=min dist");
	scrprintf(&scr,(operator&4)?"  Round distance/use cvt cutin":"  don't round distance nor use cvt cutin");
	scrprintf(&scr,(operator&3)==0?"  Grey":(operator&3)==1?"  Black":(operator&3)==2?"  White":"  Undefined Rounding");
	scrprintf(&scr,"Move point along freedom vector so distance");
	scrprintf(&scr," measured along projection to rp0 is the");
	scrprintf(&scr," value in the cvt table");
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr,"Pops: %d (point (%.2f,%.2f))", val1,
		exc->zp1.cur[val1].x/64.0,exc->zp1.cur[val1].y/64.0 ); 
	scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" ); 
	scrprintf(&scr,"Pop: %d (cvt %.2f)", val2, exc->cvt[val2]/64.0 );
	val2 = exc->GS.rp0;
	scrprintf(&scr,"Reference Point rp0: %d (%.2f,%.2f)", val2,
		exc->zp0.cur[val2].x/64.0,exc->zp0.cur[val2].y/64.0 ); 
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" ); 
	scrprintf(&scr,"Sets rp1: %d (rp0)", val2);
	scrprintf(&scr,"Sets rp2: %d (point)", val1);
	scrprintf(&scr, "MinDist: %.2f", exc->GS.minimum_distance/64.0 );
	scrprintf(&scr, "CvtCutin: %.2f", exc->GS.control_value_cutin/64.0 );
	scrprintf(&scr, "SingWidVal: %.2f", exc->GS.single_width_value/64.0 );
	scrprintf(&scr, "SingWidCut: %.2f", exc->GS.single_width_cutin/64.0 );
	scrprintf(&scr, "AutoFlip: %s", exc->GS.auto_flip?"True": "False" );
	scrrounding(&scr,exc);
	scrfree(&scr,exc);
	scrproj(&scr,exc);
    } else if ( operator>=0xb0 && operator <= 0xb7 ) {
	scrprintf(&scr," Pushes %d byte%s", operator+1-0xb0, operator==0xb0?"":"s" );
    } else if ( operator>=0xb8 && operator <= 0xbf ) {
	scrprintf(&scr," Pushes %d word%s", operator+1-0xb8, operator==0xb8?"":"s" );
    } else switch ( operator ) {
      case 0x0:
        scrprintf(&scr," Set Freedom/Projection vector to y axis");
      break;
      case 0x1:
        scrprintf(&scr," Set Freedom/Projection vector to x axis");
      break;
      case 0x2:
        scrprintf(&scr," Set Projection vector to y axis");
      break;
      case 0x3:
        scrprintf(&scr," Set Projection vector to x axis");
      break;
      case 0x4:
        scrprintf(&scr," Set Freedom vector to y axis");
      break;
      case 0x5:
        scrprintf(&scr," Set Freedom vector to x axis");
      break;
      case 0xb: case 0xa:
        scrprintf(&scr," Set %s vector from stack", operator==0xb?"Freedom":"Projection");
	val1 = exc->stack[exc->top-2];
	val2 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %.4f (x-coord)", val1/16384.0 );
	scrprintf(&scr,"Pops: %.4f (y-coord)", val2/16384.0 );
	scrprintf(&scr,"Sets: %s Vector", operator==0xb?"Freedom":"Projection" );
      break;
      case 0xe:
        scrprintf(&scr," Set Freedom vector to Projection vector");
	scrprintf(&scr,"projVec: %g,%g", (((int)exc->GS.projVector.x<<16)>>(16+14)) + ((exc->GS.projVector.x&0x3fff)/16384.0),
		(((int)exc->GS.projVector.y<<16)>>(16+14)) + ((exc->GS.projVector.y&0x3fff)/16384.0) );
	scrprintf(&scr,"Sets: Freedom Vector" );
      break;
      case 0xc: case 0xd:
        scrprintf(&scr,operator==0xc?" Get Projection Vector":" Get Freedom Vector"); 
	scrprintf(&scr,operator==0xc?"Pushes: Projection Vector":"Pushes: Freedom Vector"); 
	if ( operator==0xd )
	    scrfree(&scr,exc);
	else
	    scrproj(&scr,exc);
      break;
      case 0xf:
        scrprintf(&scr," Moves point to intersection of two lines"); 
	val1 = exc->stack[exc->top-5];
	a1 = exc->stack[exc->top-4];
	a2 = exc->stack[exc->top-3];
	b1 = exc->stack[exc->top-2];
	b2 = exc->stack[exc->top-1];

	scrprintf(&scr,"Pops: %d (point (%.2f,%.2f))", val1,
		exc->zp2.cur[val1].x/64.0,exc->zp2.cur[val1].y/64.0 ); 
	scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" ); 

	scrprintf(&scr,"Pops: %d (line1.s (%.2f,%.2f))", a1,
		exc->zp0.cur[a1].x/64.0,exc->zp0.cur[a1].y/64.0 ); 
	scrprintf(&scr,"Pops: %d (line1.e (%.2f,%.2f))", a2,
		exc->zp0.cur[a2].x/64.0,exc->zp0.cur[a2].y/64.0 ); 
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" ); 

	scrprintf(&scr,"Pops: %d (line2.s (%.2f,%.2f))", b1,
		exc->zp1.cur[b1].x/64.0,exc->zp1.cur[b1].y/64.0 ); 
	scrprintf(&scr,"Pops: %d (line2.e (%.2f,%.2f))", b2,
		exc->zp1.cur[b2].x/64.0,exc->zp1.cur[b2].y/64.0 ); 
	scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" ); 

	scrprintf(&scr,"(ignores freedom vector)"); 
      break;
      case 0x10:
	scrprintf(&scr," Set Reference Point 0");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (point = new rp0)", val1 );
      break;
      case 0x11:
	scrprintf(&scr," Set Reference Point 1");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (point = new rp1)", val1 );
      break;
      case 0x12:
	scrprintf(&scr," Set Reference Point 2");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (point = new rp2)", val1 );
      break;
      case 0x13:
	scrprintf(&scr," Set Zone Pointer 0");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (new zp0 %s)", val1, val1?"Normal":"Twilight" );
      break;
      case 0x14:
	scrprintf(&scr," Set Zone Pointer 1");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (new zp1 %s)", val1, val1?"Normal":"Twilight" );
      break;
      case 0x15:
	scrprintf(&scr," Set Zone Pointer 2");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (new zp2 %s)", val1, val1?"Normal":"Twilight" );
      break;
      case 0x16:
	scrprintf(&scr," Set Zone Pointers");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (new zp0,zp1,zp2 %s)", val1, val1?"Normal":"Twilight" );
      break;
      case 0x17:
	scrprintf(&scr," Set Loop variable");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (new loop count)", val1 );
      break;
      case 0x1A:
	scrprintf(&scr," Set Minimum Distance");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (new minimum distance)", val1/64.0 );
      break;
      case 0x1B: case 0x2D: case 0x59:
	switch( operator ) {
	  case 0x1B:
	    scrprintf(&scr," Else");
	  break;
	  case 0x2D:
	    scrprintf(&scr," End Function Definition (return)");
	  break;
	  case 0x59:
	    scrprintf(&scr," End If");
	  break;
	}
      break;
      case 0x1C:
	scrprintf(&scr," Jump Relative (to here)");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (byte offset)", val1 );
      break;
      case 0x1D:
	scrprintf(&scr," Set Control Value Table Cut-In");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %.2f (new cvt cut-in value)", val1/64.0 );
      break;
      case 0x1E:
	scrprintf(&scr," Set Single Width Cut-In");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %.2f (new single width cut-in value)", val1/64.0 );
      break;
      case 0x1F:
	scrprintf(&scr," Set Single Width");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %.2f (new single width value)", val1/64.0 );
      break;
      case 0x20:
	scrprintf(&scr," Duplicate TOS");
	scrprintf(&scr,"Pushes: %d", exc->stack[exc->top-1] );
      break;
      case 0x21:
	scrprintf(&scr," Pop TOS");
	scrprintf(&scr,"Pops: %d", exc->stack[exc->top-1] );
      break;
      case 0x22:
	scrprintf(&scr," Clear Stack");
	scrprintf(&scr,"Pops everything" );
      break;
      case 0x23:
	scrprintf(&scr," Swap top of stack");
	scrprintf(&scr,"Pops: top two elements" );
	scrprintf(&scr,"Pushs: top two elements in opposite order" );
      break;
      case 0x24:
	scrprintf(&scr," Depth of Stack");
	scrprintf(&scr,"Pushes: %d", exc->top );
      break;
      case 0x25: case 0x26:
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,operator==0x25?" Copy Indexed element to TOS":" Move Indexed element to TOS");
	scrprintf(&scr,"Pops: %d", val1 );
	if ( val1<exc->top ) {
	    val2 = exc->stack[exc->top-1-val1];
	    scrprintf(&scr,"Pushes: %.2f (%d)", val2/64.0, val2 );
	    if ( operator==0x26 )
		scrprintf(&scr,"(and removes it from further down the stack)" );
	} else
	    scrprintf(&scr,"*** Stack underflow ***" );
      break;
      case 0x27:
	scrprintf(&scr," Align Points");
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr,"Pop1: %d (point (%.2f,%.2f))", val1,
		exc->zp1.cur[val1].x/64.0,exc->zp1.cur[val1].y/64.0 );
	scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" );
	scrprintf(&scr,"Pop2: %d (point (%.2f,%.2f))", val2,
		exc->zp0.cur[val2].x/64.0,exc->zp0.cur[val2].y/64.0 );
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x28:
	scrprintf(&scr," Untouch Point");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pop1: %d (point (%.2f,%.2f))", val1,
		exc->zp0.cur[val1].x/64.0,exc->zp0.cur[val1].y/64.0 );
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	scrfree(&scr,exc);
      break;
      case 0x2A:
      case 0x2B:
      case 0x2C:
        switch ( operator ) {
	  case 0x2A:
	    scrprintf(&scr," Loop Call Function");
	  break;
	  case 0x2B:
	    scrprintf(&scr," Call Function");
	  break;
	  case 0x2C:
	    scrprintf(&scr," Function Definition");
	  break;
	}
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (function number)", val1 );
	if ( operator==0x2a ) {
	    val2 = exc->stack[exc->top-2];
	    scrprintf(&scr,"Pops: %d (count)", val2 );
	}
      break;
      case 0x2E: case 0x2F:
	scrprintf(&scr, operator==0x2E?" MDAP (touch point)":" MDAP (round & touch point)");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (point (%.2f,%.2f))", val1,
		exc->zp0.cur[val1].x/64.0,exc->zp0.cur[val1].y/64.0 );
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	scrprintf(&scr,"Sets: rp0,rp1 to %d", val1 );
	if ( operator==0x2F )
	    scrrounding(&scr,exc);
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x30: case 0x31:
        switch ( operator ) {
	  case 0x30:
	    scrprintf(&scr," Interpolate Untouched Points in y");
	  break;
	  case 0x31:
	    scrprintf(&scr," Interpolate Untouched Points in x");
	  break;
	}
	scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" );
      break;
      case 0x32: case 0x33:
        scrprintf(&scr," Shift point by amount ref point shifted");
	if ( operator==0x33 ) {
	    scrprintf(&scr, "Reference point in rp1: %d (point (%.2f,%.2f))", exc->GS.rp2,
		    exc->zp0.cur[exc->GS.rp1].x/64.0,exc->zp0.cur[exc->GS.rp1].y/64.0 );
	    scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	} else {
	    scrprintf(&scr, "Reference point in rp2: %d (point (%.2f,%.2f))", exc->GS.rp2,
		    exc->zp1.cur[exc->GS.rp2].x/64.0,exc->zp1.cur[exc->GS.rp2].y/64.0 );
	    scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" );
	}
	scrprintf(&scr, "loop: %ld", exc->GS.loop );
	for ( val1=1; val1<=exc->GS.loop && val1<exc->top; ++val1 ) {
	    val2 = exc->stack[exc->top-val1];
	    scrprintf(&scr,"Pop%d: %d (point (%.2f,%.2f))", val1, val2,
		    exc->zp2.cur[val2].x/64.0,exc->zp2.cur[val2].y/64.0 );
	}
	scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" );
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x34: case 0x35:
        scrprintf(&scr," Shift contour by amount ref point shifted");
	if ( operator==0x35 ) {
	    scrprintf(&scr, "Reference point in rp1: %d (point (%.2f,%.2f))", exc->GS.rp2,
		    exc->zp0.cur[exc->GS.rp1].x/64.0,exc->zp0.cur[exc->GS.rp1].y/64.0 );
	    scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	} else {
	    scrprintf(&scr, "Reference point in rp2: %d (point (%.2f,%.2f))", exc->GS.rp2,
		    exc->zp1.cur[exc->GS.rp2].x/64.0,exc->zp1.cur[exc->GS.rp2].y/64.0 );
	    scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" );
	}
	scrprintf(&scr, "Pops: %d (contour index)", exc->stack[exc->top-1]);
	scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" );
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x36: case 0x37:
        scrprintf(&scr," Shift zone by amount ref point shifted");
	if ( operator==0x37 ) {
	    scrprintf(&scr, "Reference point in rp1: %d (point (%.2f,%.2f))", exc->GS.rp2,
		    exc->zp0.cur[exc->GS.rp1].x/64.0,exc->zp0.cur[exc->GS.rp1].y/64.0 );
	    scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	} else {
	    scrprintf(&scr, "Reference point in rp2: %d (point (%.2f,%.2f))", exc->GS.rp2,
		    exc->zp1.cur[exc->GS.rp2].x/64.0,exc->zp1.cur[exc->GS.rp2].y/64.0 );
	    scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" );
	}
	scrprintf(&scr, "Pops: %d (%s zone)", exc->stack[exc->top-1],
		exc->stack[exc->top-1]?"Normal":"Twilight" );
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x38:
        scrprintf(&scr," Shift point by pixel amount");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr, "Pops: %.2f (pixel amount)", val1/64.0 );
	scrprintf(&scr, "loop: %ld", exc->GS.loop );
	for ( val1=2; val1<=exc->GS.loop+1 && val1<exc->top; ++val1 ) {
	    val2 = exc->stack[exc->top-val1];
	    scrprintf(&scr,"Pop%d: %d (point (%.2f,%.2f))", val1, val2,
		    exc->zp2.cur[val2].x/64.0,exc->zp2.cur[val2].y/64.0 );
	}
	scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" );
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x39:
	scrprintf(&scr," Interpolated Point");
	scrprintf(&scr, "Reference point in rp1: %d (point (%.2f,%.2f))", exc->GS.rp1,
		exc->zp0.cur[exc->GS.rp1].x/64.0,exc->zp0.cur[exc->GS.rp1].y/64.0 );
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	scrprintf(&scr, "Reference point in rp2: %d (point (%.2f,%.2f))", exc->GS.rp2,
		exc->zp1.cur[exc->GS.rp2].x/64.0,exc->zp1.cur[exc->GS.rp2].y/64.0 );
	scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" );
	scrprintf(&scr, "loop: %ld", exc->GS.loop );
	for ( val1=1; val1<=exc->GS.loop && val1<exc->top; ++val1 ) {
	    val2 = exc->stack[exc->top-val1];
	    scrprintf(&scr,"Pop%d: %d (point (%.2f,%.2f))", val1, val2,
		    exc->zp2.cur[val2].x/64.0,exc->zp2.cur[val2].y/64.0 );
	}
	scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" );
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x3A: case 0x3B:
	scrprintf(&scr," MSIRP Move Stack Indirect Relative Point"); 
	scrprintf(&scr,operator&1?"  set rp0 to point":
		    "  don't set rp0"); 
	scrprintf(&scr,"moves point along freedom vector");
	scrprintf(&scr," until distance from rp0 along");
	scrprintf(&scr," projection vector is value from stack");
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr,"Pop: %d (point (%.2f,%.2f))", val1,
		exc->zp1.cur[val1].x/64.0,exc->zp1.cur[val1].y/64.0 );
	scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" );
	scrprintf(&scr, "Reference point in rp0: %d (point (%.2f,%.2f))", exc->GS.rp0,
		exc->zp0.cur[exc->GS.rp0].x/64.0,exc->zp0.cur[exc->GS.rp0].y/64.0 );
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	scrprintf(&scr,"Pop: %.2f (distance)", val2/64.0 );
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x3C:
	scrprintf(&scr," Align to Reference Point"); 
	scrprintf(&scr, "Reference point in rp0: %d (point (%.2f,%.2f))", exc->GS.rp0,
		exc->zp0.cur[exc->GS.rp0].x/64.0,exc->zp0.cur[exc->GS.rp0].y/64.0 );
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	scrprintf(&scr, "loop: %ld", exc->GS.loop ); 
	for ( val1=1; val1<=exc->GS.loop && val1<exc->top; ++val1 ) {
	    val2 = exc->stack[exc->top-val1];
	    scrprintf(&scr,"Pop%d: %d (point (%.2f,%.2f))", val1, val2,
		    exc->zp1.cur[val2].x/64.0,exc->zp1.cur[val2].y/64.0 );
	}
	scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" );
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x3E: case 0x3F:
	scrprintf(&scr," MIAP Move Indirect Absolute Point"); 
	scrprintf(&scr,operator&1?"  round distance and look at cvt cutin":
		    "  don't round distance and look at cvt cutin"); 
	scrprintf(&scr,"moves point to cvt value along freedom vector"); 
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr,"Pop: %d (point (%.2f,%.2f))", val1,
		exc->zp0.cur[val1].x/64.0,exc->zp0.cur[val1].y/64.0 );
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	scrprintf(&scr,"Pop: %d (cvt %.2f)", val2, exc->cvt[val2]/64.0 );
	scrprintf(&scr,"Sets: rp0 and rp1 to point %d", val1 );
	scrfree(&scr,exc);
	scrproj(&scr,exc);
	scrprintf(&scr, "CvtCutin: %.2f", exc->GS.control_value_cutin/64.0 );
      break;
      case 0x40:
	scrprintf(&scr," Push %d Bytes", ((uint8 *) exc->code)[exc->IP+1]);
      break;
      case 0x41:
	scrprintf(&scr," Push %d Words", ((uint8 *) exc->code)[exc->IP+1]);
      break;
      case 0x42:
        scrprintf(&scr," Write Store" );
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr,"Pops: %d (%.2f)", val2, val2/64.0 );
	scrprintf(&scr,"Pops: %d (store index)", val1 );
      break;
      case 0x43:
	scrprintf(&scr," Read Store" );
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pop: %d (store index)", val1 );
	scrprintf(&scr,"Pushes: %d (%.2f)", exc->storage[val1], exc->storage[val1]/64.0 );
      break;
      case 0x44:
        scrprintf(&scr," Write CVT entry in Pixels" );
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr,"Pops: %.2f", val2/64.0 );
	scrprintf(&scr,"Pops: %d (cvt index)", val1 );
      break;
      case 0x45:
	scrprintf(&scr,"Read Control Value Table entry" ); 
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pop: %d (cvt index)", val1 );
	scrprintf(&scr,"Pushes: %.2f (%d)", exc->cvt[val1]/64.0, exc->cvt[val1] );
      break;
      case 0x46: case 0x47:
	scrprintf(&scr,"Get %s point coord projected on projection vector",
		operator==0x46 ? "current" : "original" ); 
	val1 = exc->stack[exc->top-1];
	if ( operator==0x46 ) {
	    scrprintf(&scr,"Pop: %d (cur point (%.2f,%.2f))", val1,
		    exc->zp2.cur[val1].x/64.0,exc->zp2.cur[val1].y/64.0 ); 
	    scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" ); 
	    scrprintf(&scr, "projVec: %g,%g", (((int)exc->GS.projVector.x<<16)>>(16+14)) + ((exc->GS.projVector.x&0x3fff)/16384.0),
		    (((int)exc->GS.projVector.y<<16)>>(16+14)) + ((exc->GS.projVector.y&0x3fff)/16384.0) );
	} else {
	    scrprintf(&scr,"Pop: %d (orig point (%.2f,%.2f))", val1,
		    exc->zp2.org[val1].x/64.0,exc->zp2.org[val1].y/64.0 ); 
	    scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" ); 
	    scrprintf(&scr,"dualVec: %g,%g", (((int)exc->GS.dualVector.x<<16)>>(16+14)) + ((exc->GS.dualVector.x&0x3fff)/16384.0),
		    (((int)exc->GS.dualVector.y<<16)>>(16+14)) + ((exc->GS.dualVector.y&0x3fff)/16384.0) );
	}
	scrprintf(&scr,"Pushes: projection" ); 
      break;
      case 0x48:
	scrprintf(&scr," Sets coordinate from stack using proj & free vectors" );
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr,"Moves point along freedom vector until its" );
	scrprintf(&scr," projection on the projection vector is the" );
	scrprintf(&scr," desired amount" );
	scrprintf(&scr,"Pop: %d (cur point (%.2f,%.2f))", val1,
		exc->zp2.cur[val1].x/64.0,exc->zp2.cur[val1].y/64.0 ); 
	scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" ); 
	scrfree(&scr,exc);
	scrproj(&scr,exc);
      break;
      case 0x49: case 0x4A:
        switch ( operator ) {
	  case 0x49:
	    scrprintf(&scr," Measure Distance (current)");
	  break;
	  case 0x4A:
	    scrprintf(&scr," Measure Distance (original)");
	  break;
	}

	val1 = exc->stack[exc->top-1];
	val2 = exc->stack[exc->top-2];
	if ( operator==0x49 ) {
	    scrprintf(&scr,"Pop: %d (cur point (%.2f,%.2f))", val1,
		    exc->zp1.cur[val1].x/64.0,exc->zp1.cur[val1].y/64.0 ); 
	    scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" ); 
	    scrprintf(&scr,"Pop: %d (cur point (%.2f,%.2f))", val2,
		    exc->zp0.cur[val2].x/64.0,exc->zp0.cur[val2].y/64.0 ); 
	    scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" ); 
	    scrprintf(&scr, "projVec: %g,%g", (((int)exc->GS.projVector.x<<16)>>(16+14)) + ((exc->GS.projVector.x&0x3fff)/16384.0),
		    (((int)exc->GS.projVector.y<<16)>>(16+14)) + ((exc->GS.projVector.y&0x3fff)/16384.0) );
	} else {
	    scrprintf(&scr,"Pop: %d (orig point (%.2f,%.2f))", val1,
		    exc->zp1.org[val1].x/64.0,exc->zp1.org[val1].y/64.0 ); 
	    scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" ); 
	    scrprintf(&scr,"Pop: %d (orig point (%.2f,%.2f))", val2,
		    exc->zp0.org[val2].x/64.0,exc->zp0.org[val2].y/64.0 ); 
	    scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" ); 
	    scrprintf(&scr, "dualVec: %g,%g", (((int)exc->GS.dualVector.x<<16)>>(16+14)) + ((exc->GS.dualVector.x&0x3fff)/16384.0),
		    (((int)exc->GS.dualVector.y<<16)>>(16+14)) + ((exc->GS.dualVector.y&0x3fff)/16384.0) );
	}
	scrprintf(&scr,"Pushes: distance" ); 
      break;
      case 0x4B:
        scrprintf(&scr," MPPEM Push Pixels Per Em");
	scrprintf(&scr,"Pushes: %d", PPEMY(exc));	/* Actually this depends on the projection vector. But if xppem==yppem it will make no difference */
      break;
      case 0x4C:
        scrprintf(&scr," Push Pointsize");
        scrprintf(&scr,"(one might assume this returns the pointsize, %d", cv->ft_pointsizey);
        scrprintf(&scr," as it is documented to do, but instead it");
        scrprintf(&scr," returns ppem)");
	scrprintf(&scr,"Pushes: %d", PPEMY(exc) );
      break;
      case 0x4D: case 0x4E:
        switch ( operator ) {
	  case 0x4D:
	    scrprintf(&scr," set auto Flip On");
	  break;
	  case 0x4E:
	    scrprintf(&scr," set auto Flip Off");
	  break;
	}
      break;
      case 0x4F:
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr," Debug"); 
	scrprintf(&scr,"Pops: %d (debug hook)", val1 ); 
      break;
      case 0x58:
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr," If"); 
	scrprintf(&scr,"Pops: %d (condition)", val1 ); 
      break;
      case 0x5e:
	scrprintf(&scr," Set Delta Base");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (new delta base)", val1 );
      break;
      case 0x5f:
	scrprintf(&scr," Set Delta Shift");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (new delta shift)", val1 );
      break;
      case 0x8B: case 0x8C:
      case 0x60: case 0x61: case 0x62: case 0x63:
      case 0x5A: case 0x5B:
      case 0x55: case 0x54: case 0x53: case 0x52: case 0x51: case 0x50:
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	switch( operator ) {
	  case 0x50:
	    scrprintf(&scr," Less Than");
	    ret = val1<val2;
	  break;
	  case 0x51:
	    scrprintf(&scr," Less Than Or Equal");
	    ret = val1<=val2;
	  break;
	  case 0x52:
	    scrprintf(&scr," Greater Than");
	    ret = val1>val2;
	  break;
	  case 0x53:
	    scrprintf(&scr," Greater Than or Equal");
	    ret = val1>=val2;
	  break;
	  case 0x54:
	    scrprintf(&scr," Equal");
	    ret = val1==val2;
	  break;
	  case 0x55:
	    scrprintf(&scr," Not Equal");
	    ret = val1!=val2;
	  break;
	  case 0x5A:
	    scrprintf(&scr," And");
	    ret = val1 & val2;
	  break;
	  case 0x5B:
	    scrprintf(&scr," Or");
	    ret = val1 | val2;
	  break;
	  case 0x60:
	    scrprintf(&scr," Add");
	    ret = val1 + val2;
	  break;
	  case 0x61:
	    scrprintf(&scr," Sub");
	    ret = val1 - val2;
	  break;
	  case 0x62:
	    scrprintf(&scr," Divide");
	    if ( val2!=0 )
		ret = val1*64/val2;
	    else
		ret = 0x7fffffff;
	  break;
	  case 0x63:
	    scrprintf(&scr," Multiply");
	    ret = val1*val2/64.0;
	  break;
	  case 0x8B:
	    scrprintf(&scr," Max");
	    ret = val1>val2 ? val1 : val2;
	  break;
	  case 0x8C:
	    scrprintf(&scr," Min");
	    ret = val1<val2 ? val1 : val2;
	  break;
	}
	scrprintf(&scr,"Pop1: %.2f (%d)", val1/64.0, val1 ); 
	scrprintf(&scr,"Pop2: %.2f (%d)", val2/64.0, val2 ); 
	scrprintf(&scr,"Pushes: %.2f (%d)", ret/64.0, ret ); 
      break;
      case 0x64: case 0x65: case 0x66: case 0x67:
      case 0x57: case 0x5C:
	val2 = val1 = exc->stack[exc->top-1];
	switch( operator ) {
	  case 0x64:
	    scrprintf(&scr," Absolute Value");
	    if ( val2<0 ) val2 = -val2;
	  break;
	  case 0x65:
	    scrprintf(&scr," Negate");
	    val2 = -val1;
	  break;
	  case 0x66:
	    scrprintf(&scr," Floor");
	    val2 = 64*(val2/64);
	  break;
	  case 0x67:
	    scrprintf(&scr," Ceiling");
	    val2 = 64*((val2+63)/64);
	  break;
	  case 0x5C:
	    scrprintf(&scr," Not");
	    val2 = !val1;
	  break;
	  case 0x56:
	    scrprintf(&scr," Odd (after rounding)");
	    ret = ttround(val1,exc);
	    if ( ret&64 ) ret = 0; else ret = 1;
	  break;
	  case 0x57:
	    scrprintf(&scr," Even (after rounding)");
	    ret = ttround(val1,exc);
	    if ( ret&64 ) ret = 0; else ret = 1;
	  break;
	}
	scrprintf(&scr,"Pops: %.2f (%d)", val1/64.0, val1 ); 
	scrprintf(&scr,"Pushes: %.2f (%d)", val2/64.0, val2 ); 
      break;
      case 0x68: case 0x69: case 0x6A: case 0x6B:
	scrprintf(&scr," Round & adjust for engine characteristics" ); 
	scrprintf(&scr,(operator&3)==0?"  Grey":(operator&3)==1?"  Black":(operator&3)==2?"  White":"  Undefined Rounding");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %.2f", val1/64.0 );
	val1 = ttround(val1,exc);
	scrprintf(&scr,"Pushes: %.2f", val1/64.0 ); 
      break;
      case 0x6C: case 0x6D: case 0x6E: case 0x6F:
	scrprintf(&scr," Adjust for engine characteristics without rounding" ); 
	scrprintf(&scr,(operator&3)==0?"  Grey":(operator&3)==1?"  Black":(operator&3)==2?"  White":"  Undefined Rounding");
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %.2f", val1/64.0 ); 
	scrprintf(&scr,"Pushes: %.2f", val1/64.0 ); 
      break;
      case 0x5D: case 0x71: case 0x72:
        base = operator==0x5D?1:operator-0x6F;
	scrprintf(&scr," Delta Point%d", base ); 
	freedom.x = (((int)exc->GS.freeVector.x<<16)>>(16+14)) + ((exc->GS.freeVector.x&0x3fff)/16384.0);
	freedom.y = (((int)exc->GS.freeVector.y<<16)>>(16+14)) + ((exc->GS.freeVector.y&0x3fff)/16384.0);
	cnt = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (count)", cnt ); 
	for ( i=0; i<cnt; ++i ) {
	    if ( 2*i+3 > exc->top ) {
		scrprintf(&scr,"*** Stack underflow ***"); 
	break;
	    }
	    val1 = exc->stack[exc->top-2-2*i];
	    val2 = exc->stack[exc->top-3-2*i];
	    if ( (val2&0xf)<=7 )
		off = -8+(val2&0xf);
	    else
		off = -7+(val2&0xf);
	    off *= 64 / (1L << exc->GS.delta_shift);
	    scrprintf(&scr,"Pops: %d (point (%.2f,%.2f))", val1,
		    exc->zp0.cur[val1].x/64.0,exc->zp0.cur[val1].y/64.0 ); 
	    scrprintf(&scr,"Pops: %d => at %d ppem, move (%.2f,%.2f)",
		val2, exc->GS.delta_base+(base-1)*16+((val2>>4)&0xf),
		freedom.x*off/64.0, freedom.y*off/64.0 ); 
	}
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
	scrprintf(&scr, "DeltaBase: %d", exc->GS.delta_base ); 
	scrprintf(&scr, "DeltaShift: %d", exc->GS.delta_shift ); 
	scrprintf(&scr, "freeVec: %g,%g", freedom.x, freedom.y); 
      break;
      case 0x70:
        scrprintf(&scr," Write CVT entry in Funits" );
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr,"Pops: %d (em-units=%.2fpixels)", val2,
		val2*PPEMX(exc)*64.0/
		    (cv->b.sc->parent->ascent+cv->b.sc->parent->descent));
	scrprintf(&scr,"Pops: %d (cvt index)", val1 );
      break;
      case 0x73: case 0x74: case 0x75:
        base = operator-0x72;
	scrprintf(&scr," Delta Point%d", base ); 
	cnt = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (count)", cnt ); 
	for ( i=0; i<cnt; ++i ) {
	    if ( 2*cnt+3 > exc->top ) {
		scrprintf(&scr,"*** Stack underflow ***"); 
	break;
	    }
	    val1 = exc->stack[exc->top-2-2*i];
	    val2 = exc->stack[exc->top-3-2*i];
	    if ( (val2&0xf)<=7 )
		off = -8+(val2&0xf);
	    else
		off = -7+(val2&0xf);
	    off *= 64 / (1L << exc->GS.delta_shift);
	    scrprintf(&scr,"Pops: %d (cvt index (%d,%.2f))", val1,
		    exc->cvt[val1],exc->cvt[val1]/64.0 ); 
	    scrprintf(&scr,"Pops: %d => at %d ppem, change by %.2f",
		val2, exc->GS.delta_base+(base-1)*16+((val2>>4)&0xf),
		off/64.0 ); 
	}
	scrprintf(&scr, "DeltaBase: %d", exc->GS.delta_base ); 
	scrprintf(&scr, "DeltaShift: %d", exc->GS.delta_shift ); 
      break;
      case 0x78: case 0x79:
	scrprintf(&scr,operator==0x78?" Jump Relative (to here) on True":" Jump Relative (to here) on False");
	val1 = exc->stack[exc->top-1];
	val2 = exc->stack[exc->top-2];
	scrprintf(&scr,"Pops: %d (condition)", val1 ); 
	scrprintf(&scr,"Pops: %d (byte offset)", val2 ); 
      break;
      case 0x18: case 0x19:
      case 0x3D:
      case 0x76: case 0x77: case 0x7a: case 0x7c: case 0x7d:
	scrprintf(&scr, operator==0x7a?" set Rounding off":
			operator==0x7c?" set Rounding up to grid":
			operator==0x77?" set Rounding to Super 45":
			operator==0x7d?" set Rounding down to grid":
			operator==0x18?" set Rounding to grid":
			operator==0x3D?" set Rounding to double grid":
			operator==0x19?" set Rounding to half grid":
			  " set Rounding to Super");
	scrprintf(&scr,"Sets: Rounding state");
      break;
      case 0x7e:
	scrprintf(&scr," Set Angle Weight (obsolete)"); 
	scrprintf(&scr,"Pops: an ignored value"); 
      break;
      case 0x7f:
	scrprintf(&scr," Adjust Angle"); 
	scrprintf(&scr,"Pops: %d (point)", exc->stack[exc->top-1]); 
      break;
      case 0x80:
	scrprintf(&scr," Flip Points"); 
	scrprintf(&scr, "loop: %ld", exc->GS.loop ); 
	for ( val1=1; val1<=exc->GS.loop && val1<exc->top; ++val1 ) {
	    val2 = exc->stack[exc->top-val1];
	    scrprintf(&scr,"Pop%d: %d (point (%.2f,%.2f))", val1, val2,
		    exc->zp0.cur[val2].x/64.0,exc->zp0.cur[val2].y/64.0 ); 
	    scrprintf(&scr," was %s-curve, becomes %s-curve",
		    exc->pts.tags[val2] & FT_CURVE_TAG_ON ? "on" : "off",
		    exc->pts.tags[val2] & FT_CURVE_TAG_ON ? "off" : "on" ); 
	}
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
      break;
      case 0x81: case 0x82:
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr,operator==0x81?" Flip point range On":" Flip point range Off");

	for ( i=val2; i<=val2; ++i ) {
	    scrprintf(&scr," change point %d (%.2f,%.2f)", i,
		    exc->zp0.cur[i].x/64.0,exc->zp0.cur[i].y/64.0 ); 
	    scrprintf(&scr," was %s-curve, becomes %s-curve",
		    exc->pts.tags[val2] & FT_CURVE_TAG_ON ? "on" : "off",
		    operator==0x82 ? "off" : "on" ); 
	}
	scrprintf(&scr," (in zone from zp0: %s)", exc->GS.gep0?"Normal":"Twilight" );
      break;
      case 0x85:
	scrprintf(&scr," SCANCTRL Set dropout control" );
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (flags)",val1 );
	if ( val1==0 )
	    scrprintf(&scr,"Turn off dropout control");
	else {
	    if ( val1&0x100 ) {
		if ( (val1&0xff)==0xff )
		    scrprintf(&scr,"set dropout control for all ppem");
		else
		    scrprintf(&scr,"set dropout control for ppem <= %d", (val1&0xff));
	    }
	    if ( val1&0x800 ) {
		if ( (val1&0xff)==0xff )
		    scrprintf(&scr,"<I can't figure this combination out>");
		else
		    scrprintf(&scr,"unset dropout control unless ppem <= %d", (val1&0xff));
	    }
	    if ( val1&0x200 )
		scrprintf(&scr,"set dropout control if glyph rotated");
	    if ( val1&0x1000 )
		scrprintf(&scr,"unset dropout control unless glyph rotated");
	    if ( val1&0x400 )
		scrprintf(&scr,"set dropout control if glyph stretched");
	    if ( val1&0x2000 )
		scrprintf(&scr,"unset dropout control unless glyph stretched");
	}
      break;
      case 0x06: case 0x07:
      case 0x08: case 0x09:
      case 0x86: case 0x87:
	scrprintf(&scr,operator<0x8?" Sets projection vector from line":
			operator<0x86?" Sets freedom vector from line":
			" Set dual projection vector from line");
	scrprintf(&scr,(operator&1)?"orthogonal to line":"parallel to line");
	val1 = exc->stack[exc->top-2];
	val2 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (point (%.2f,%.2f))", val1,
		exc->zp1.cur[val1].x/64.0,exc->zp1.cur[val1].y/64.0 ); 
	scrprintf(&scr," (in zone from zp1: %s)", exc->GS.gep1?"Normal":"Twilight" );
	scrprintf(&scr,"Pops: %d (point (%.2f,%.2f))", val2,
		exc->zp2.cur[val2].x/64.0,exc->zp2.cur[val2].y/64.0 ); 
	scrprintf(&scr," (in zone from zp2: %s)", exc->GS.gep2?"Normal":"Twilight" );
	if ( operator>=0x86 ) {
	    scrprintf(&scr,"Sets: Project vector based on current positions" );
	    scrprintf(&scr,"Sets: Dual proj vector based on original positions" );
	} else
	    scrprintf(&scr,"Sets: %s vector", operator<8?"Projection":"Freedom" );
      break;
      case 0x88:
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr," Get Information"); 
	scrprintf(&scr, "Pops: %d %s%s%s%s%s%s%s%s%s%s", val1,
		val1&(1<<0) ? "version (result in bits 0-7) " : "",
		val1&(1<<1) ? "rotated (result in bit 8)" : "",
		val1&(1<<2) ? "stretched (result in bit 9)" : "",
		val1&(1<<3) ? "Undocumented Apple ?variations? (result in bit 10)" : "",
		val1&(1<<4) ? "Undocumented Apple ?vertical metrics? (result in bit 11)" : "",
		val1&(1<<5) ? "greyscale (result in bit 12)" : "", 
		val1&(1<<6) ? "ClearType (result in bit 13)" : "", 
		val1&(1<<7) ? "CT widths compat (result in bit 14)" : "", 
		val1&(1<<8) ? "CT symetrical smoothing (result in bit 15)" : "",
		val1&(1<<9) ? "CT processes in BGR(1) or RGB(0) (result in bit 16)" : "");
	if ( val1&1 ) {
	    scrprintf(&scr, "  Versions: 1 => Mac OS 6" );
	    scrprintf(&scr, "            2 => Mac OS 7" );
	    scrprintf(&scr, "            3 => Win 3.1" );
	    scrprintf(&scr, "            33=> Win rasterizer 1.5" );
	    scrprintf(&scr, "            34=> Win rasterizer 1.6" );
	    scrprintf(&scr, "            35=> Win rasterizer 1.7" );
	    scrprintf(&scr, "            37=> Win rasterizer 1.8" );
	    scrprintf(&scr, "            38=> Win rasterizer 1.9" );
	}
	scrprintf(&scr,"Pushes: result"); 
	scrprintf(&scr,"FreeType returns: %s%s%s%s",
	    (val1&1) ? "(Win 1.7) | ": "",
	    (val1&2) ? exc->tt_metrics.rotated ? "(rotated) | ": "(not rotated) | " : "",
	    (val1&4) ? exc->tt_metrics.stretched ? "(stretched) | ": "(not stretched) | " : "",
	    (val1&32) ? exc->grayscale ? "(grey scale)": "(black/white)" : ""
	); 
      break;
      case 0x89:
	scrprintf(&scr," Instruction Definition"); 
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (opcode)", val1 ); 
      break;
      case 0x8a:
	scrprintf(&scr," Roll top three stack elements"); 
      break;
      case 0x8D:
	scrprintf(&scr," SCANTYPE Set dropout control" );
	val1 = exc->stack[exc->top-1];
	scrprintf(&scr,"Pops: %d (mode)",val1 );
	if ( val1==0 )
	    scrprintf(&scr,"simple dropout control scan conversion including stubs (rules 1,2,3)");
	else if ( val1==1 )
	    scrprintf(&scr,"simple dropout control scan conversion excluding stubs (rules 1,2,4)");
	else if ( val1==2 || val1==3 || val1==6 || val1==7 )
	    scrprintf(&scr,"fast scan conversion; dropout control turned off (rule 1,2)");
	else if ( val1==4 )
	    scrprintf(&scr,"smart dropout control scan conversion including stubs (rule 1,2,5)");
	else if ( val1==5 )
	    scrprintf(&scr,"smart dropout control scan conversion excluding stubs (rule 1,2,6)");
	else
	    scrprintf(&scr,"*** Unknown mode ***");
      break;
      case 0x8E:
	val2 = exc->stack[exc->top-1];
	val1 = exc->stack[exc->top-2];
	scrprintf(&scr," Instruction Control"); 
	scrprintf(&scr,"Pops: %d (selector)", val1 ); 
	scrprintf(&scr,"Pops: %d (value)", val1 ); 
	if ( val1==1 )
	    scrprintf(&scr, " => grid fitting %s", val2 ? "inhibited" : "normal" );
	else if ( val1==2 )
	    scrprintf(&scr, " => cvt parameters %s", val2 ? "ignored" : "normal" );
	else
	    scrprintf(&scr, "Unknown selector");
      break;
    }
return( scr.lines );
}

static void dvgloss_scroll(DebugView *dv,struct sbevent *sb) {
    int newpos = dv->cvt_offtop;
    GRect size;
    int min, max, page;
    extern int _GScrollBar_Width;

    GScrollBarGetBounds(dv->glosssb,&min,&max,&page);
    GDrawGetSize(dv->gloss,&size);
    switch( sb->type ) {
      case et_sb_top:
        newpos = 0;
      break;
      case et_sb_uppage:
        newpos -= size.height/dv->ii.fh;
      break;
      case et_sb_up:
        --newpos;
      break;
      case et_sb_down:
        ++newpos;
      break;
      case et_sb_downpage:
        newpos += size.height/dv->ii.fh;
      break;
      case et_sb_bottom:
        newpos = max-size.height/dv->ii.fh;
      break;
      case et_sb_thumb:
      case et_sb_thumbrelease:
        newpos = sb->pos;
      break;
    }
    if ( newpos>max-size.height/dv->ii.fh )
        newpos = max-size.height/dv->ii.fh;
    if ( newpos<0 ) newpos =0;
    if ( newpos!=dv->gloss_offtop ) {
	int diff = newpos-dv->gloss_offtop;
	dv->gloss_offtop = newpos;
	GScrollBarSetPos(dv->glosssb,dv->gloss_offtop);
	size.x = size.y = 0;
	size.width -= GDrawPointsToPixels(dv->gloss,_GScrollBar_Width);
	GDrawScroll(dv->gloss,&size,0,diff*dv->ii.fh);
    }
}

static void DVGlossExposeSize(GWindow gw,DebugView *dv,GEvent *event) {
    int len = DVGlossExpose(gw,dv,event);
    GRect size;
    int min, max, page, offtop;

    GScrollBarGetBounds(dv->glosssb,&min,&max,&page);
    GGadgetGetSize(dv->glosssb,&size);
    size.height /= dv->ii.fh;

    if ( len!=max || page!=size.height ) {
	GScrollBarSetBounds(dv->glosssb,0,len,size.height);
	offtop = dv->gloss_offtop;
	if ( offtop+size.height > len )
	    offtop = len-size.height;
	if ( offtop < 0 )
	    offtop = 0;
	if ( offtop!=dv->gloss_offtop ) {
	    dv->gloss_offtop = offtop;
	    GScrollBarSetPos(dv->glosssb,dv->gloss_offtop);
	    DVGlossExpose(gw,dv,event);
	}
    }
}

static int dvgloss_e_h(GWindow gw, GEvent *event) {
    DebugView *dv = (DebugView *) GDrawGetUserData(gw);
    GRect r,g;
    extern int debug_wins;

    if ( dv==NULL )
return( true );

    switch ( event->type ) {
      case et_expose:
	DVGlossExposeSize(gw,dv,event);
      break;
      case et_char:
return( DVChar(dv,event));
      break;
      case et_controlevent:
	switch ( event->u.control.subtype ) {
	  case et_scrollbarchange:
	    dvgloss_scroll(dv,&event->u.control.u.sb);
	  break;
	}
      break;
      case et_resize:
	GDrawGetSize(gw,&r);
	GGadgetGetSize(dv->glosssb,&g);
	GGadgetMove(dv->glosssb,r.width-g.width,0);
	GGadgetResize(dv->glosssb,g.width,r.height);
	GDrawRequestExpose(dv->gloss,NULL,false);
      break;
      case et_close:
	GDrawDestroyWindow(dv->gloss);
	debug_wins &= ~dw_gloss;
      break;
      case et_destroy:
	dv->gloss = NULL;
      break;
      case et_mouseup: case et_mousedown:
      case et_mousemove:
	GGadgetEndPopup();
      break;
    }
return( true );
}

void DVCreateGloss(DebugView *dv) {
    GWindowAttrs wattrs;
    GRect pos;
    GGadgetData gd;
    extern int _GScrollBar_Width;

    memset(&wattrs,0,sizeof(wattrs));
    wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle;
    wattrs.event_masks = -1;
    wattrs.cursor = ct_mypointer;
    wattrs.utf8_window_title = _("Instruction Gloss (TrueType)");
    pos.width = GGadgetScale(GDrawPointsToPixels(NULL,230)); pos.height = 169;
    pos.x = CVXPos(dv,143,pos.width); pos.y = 302;
    dv->gloss = GDrawCreateTopWindow(NULL,&pos,dvgloss_e_h,dv,&wattrs);

    memset(&gd,0,sizeof(gd));

    gd.pos.y = 0; gd.pos.height = pos.height;
    gd.pos.width = GDrawPointsToPixels(dv->gloss,_GScrollBar_Width);
    gd.pos.x = pos.width-gd.pos.width;
    gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels|gg_sb_vert;
    dv->glosssb = GScrollBarCreate(dv->gloss,&gd,dv);

    GDrawSetVisible(dv->gloss,true);
}

/* ************************************************************************** */
/*  Variant of the gloss window: Mark the points to show what the next        */
/*  instruction will do to them. (Change (usually move) them, or use them     */
/*  or ignore them                                                            */
/* ************************************************************************** */

static SplinePoint *FindPoint(SplineSet *ss,int ptnum) {
    SplineSet *spl;
    SplinePoint *sp;

    for ( spl=ss; spl!=NULL ; spl=spl->next ) {
	for ( sp = spl->first; ; ) {
	    if ( sp->ttfindex==ptnum || sp->nextcpindex==ptnum )
return( sp );
	    if ( sp->next==NULL )
	break;
	    sp = sp->next->to;
	    if ( sp==spl->first )
	break;
	}
    }
return( NULL );
}

static void SetBasisPoint(SplineSet *ss, int ptnum) {
    SplinePoint *sp = FindPoint(ss,ptnum);
    if ( sp==NULL )
return;
    /* A roundx point or flexx nextcp means this is the reference */
    /*  point, etc. */
    if ( sp->ttfindex==ptnum )
	sp->roundx = true;
    else
	sp->flexx = true;
}

static void SetChangingPoint(SplineSet *ss, int ptnum) {
    SplinePoint *sp = FindPoint(ss,ptnum);
    if ( sp==NULL )
return;
    /* I reuse these flags. A "selected" point is one which will be */
    /*  moved by the instruction. A "flexy"ed point means its nextcp */
    /*  will be moved by the next instruction */
    if ( sp->ttfindex==ptnum )
	sp->selected = true;
    else
	sp->flexy = true;
}

void DVMarkPts(DebugView *dv,SplineSet *ss) {
    TT_ExecContext exc = DebuggerGetEContext(dv->dc);
    long changing_point, basis_point;
    int i,cnt,top;
    int operator;
    SplineSet *spl;
    SplinePoint *sp;

    for ( spl=ss; spl!=NULL ; spl=spl->next ) {
	for ( sp = spl->first; ; ) {
	    sp->selected = false;
	    sp->roundx = sp->roundy = false;
	    sp->flexx = sp->flexy = false;
	    /* I reuse these flags. A "selected" point is one which will be */
	    /*  moved by the instruction. A "flexy"ed point means its nextcp */
	    /*  will be moved by the next instruction */
	    /* A roundx point or flexx nextcp means this is the reference */
	    /*  point, etc. */
	    if ( sp->next==NULL )
	break;
	    sp = sp->next->to;
	    if ( sp==spl->first )
	break;
	}
    }

    if ( exc==NULL )
return;		/* Not running */
    if ( exc->IP>=exc->codeSize || exc->code==NULL )
return;		/* At end */

    operator = ((uint8 *) exc->code)[exc->IP];
    changing_point = -1;
    basis_point = -1;

    if ( operator>=0xc0 && operator <= 0xdf ) {
        /* MDRP */
	if ( exc->GS.gep1 )	/* No good way to mark twilight points, so only mark normal ones */
	    changing_point = exc->stack[exc->top-1];
	if ( exc->GS.gep0 )
	    basis_point = exc->GS.rp0;
    } else if ( operator>=0xe0 && operator <= 0xff ) {
        /* MIRP */
	if ( exc->GS.gep1 )	/* No good way to mark twilight points, so only mark normal ones */
	    changing_point = exc->stack[exc->top-2];
	if ( exc->GS.gep0 )
	    basis_point = exc->GS.rp0;
    } else if ( operator>=0xb0 && operator <= 0xbf ) {
	/* Push */
    } else switch ( operator ) {
      case 0xf:
        /* Moves point to intersection of two lines */
	if ( exc->GS.gep2 )	/* No good way to mark twilight points, so only mark normal ones */
	    changing_point = exc->stack[exc->top-5];
	if ( exc->GS.gep0 ) {
	    SetBasisPoint(ss,exc->stack[exc->top-4]);
	    SetBasisPoint(ss,exc->stack[exc->top-3]);
	}
	if ( exc->GS.gep1 ) {
	    SetBasisPoint(ss,exc->stack[exc->top-2]);
	    SetBasisPoint(ss,exc->stack[exc->top-1]);
	}
      break;
      case 0x10: case 0x11: case 0x12:
	/* Set Reference Point ? */
	basis_point = exc->stack[exc->top-1];
      break;
      case 0x27:
	/* Align Points */
	if ( exc->GS.gep0 )
	    SetChangingPoint(ss,exc->stack[exc->top-1]);
	if ( exc->GS.gep1 )
	    SetChangingPoint(ss,exc->stack[exc->top-2]);
      break;
      case 0x28:
	/* Untouch point */
	if ( exc->GS.gep0 )
	    changing_point = exc->stack[exc->top-1];
      break;
      case 0x2E:
	/* Touch point */
	if ( exc->GS.gep0 )
	    changing_point = exc->stack[exc->top-1];
      break;
      case 0x2F:
	/* Round and Touch point */
	if ( exc->GS.gep0 )
	    changing_point = exc->stack[exc->top-1];
      break;
      case 0x30:
	/* Interpolate Untouched Points in y */
	if ( exc->GS.gep2 ) {
	    TT_GlyphZoneRec *r = &exc->pts;
	    for ( spl=ss; spl!=NULL ; spl=spl->next ) {
		for ( sp = spl->first; ; ) {
		    if ( sp->ttfindex<r->n_points &&
			    !(r->tags[sp->ttfindex]&FT_Curve_Tag_Touch_Y) )
			sp->selected = true;
		    if ( sp->nextcpindex<r->n_points &&
			    !(r->tags[sp->nextcpindex]&FT_Curve_Tag_Touch_Y) )
			sp->flexy = true;
		    /* I reuse these flags. A "selected" point is one which will be */
		    /*  moved by the instruction. A "flexy"ed point means its nextcp */
		    /*  will be moved by the next instruction */
		    if ( sp->next==NULL )
		break;
		    sp = sp->next->to;
		    if ( sp==spl->first )
		break;
		}
	    }
	}
      break;
      case 0x31:
	/* Interpolate Untouched Points in x */
	if ( exc->GS.gep2 ) {
	    TT_GlyphZoneRec *r = &exc->pts;
	    for ( spl=ss; spl!=NULL ; spl=spl->next ) {
		for ( sp = spl->first; ; ) {
		    if ( sp->ttfindex<r->n_points &&
			    !(r->tags[sp->ttfindex]&FT_Curve_Tag_Touch_X) )
			sp->selected = true;
		    if ( sp->nextcpindex<r->n_points &&
			    !(r->tags[sp->nextcpindex]&FT_Curve_Tag_Touch_X) )
			sp->flexy = true;
		    /* I reuse these flags. A "selected" point is one which will be */
		    /*  moved by the instruction. A "flexy"ed point means its nextcp */
		    /*  will be moved by the next instruction */
		    if ( sp->next==NULL )
		break;
		    sp = sp->next->to;
		    if ( sp==spl->first )
		break;
		}
	    }
	}
      break;
      case 0x32: case 0x33:
        /* Shift point by amount ref point shifted */
	if ( operator==0x33 ) {
	    if ( exc->GS.gep0 )
		basis_point = exc->GS.rp1;
	} else {
	    if ( exc->GS.gep1 )
		basis_point = exc->GS.rp2;
	}
	if ( exc->GS.gep2 )
	    for ( i=1; i<=exc->GS.loop && i<exc->top; ++i ) {
		SetChangingPoint(ss,exc->stack[exc->top-i]);
	    }
      break;
      case 0x34: case 0x35:
        /* Shift contour by amount ref point shifted */
	if ( operator==0x35 ) {
	    if ( exc->GS.gep0 )
		basis_point = exc->stack[exc->GS.rp1];
	} else {
	    if ( exc->GS.gep1 )
		basis_point = exc->stack[exc->GS.rp2];
	}
	if ( exc->GS.gep2 ) {
	    for ( spl=ss, i=exc->stack[exc->top-1]; i>0 && spl!=NULL; --i, spl=spl->next );
	    if ( spl!=NULL ) {
		for ( sp = spl->first; ; ) {
		    if ( sp->ttfindex<0xfff0 )
			sp->selected = true;
		    if ( sp->nextcpindex<0xfff0 )
			sp->flexy = true;
		    /* I reuse these flags. A "selected" point is one which will be */
		    /*  moved by the instruction. A "flexy"ed point means its nextcp */
		    /*  will be moved by the next instruction */
		    if ( sp->next==NULL )
		break;
		    sp = sp->next->to;
		    if ( sp==spl->first )
		break;
		}
	    }
	}
      break;
      case 0x36: case 0x37:
	if ( operator==0x37 ) {
	    if ( exc->GS.gep0 )
		basis_point = exc->stack[exc->GS.rp1];
	} else {
	    if ( exc->GS.gep1 )
		basis_point = exc->stack[exc->GS.rp2];
	}
	if ( exc->stack[exc->top-1] ) {
	    for ( spl=ss; spl!=NULL; spl=spl->next ) {
		for ( sp = spl->first; ; ) {
		    if ( sp->ttfindex<0xfff0 )
			sp->selected = true;
		    if ( sp->nextcpindex<0xfff0 )
			sp->flexy = true;
		    /* I reuse these flags. A "selected" point is one which will be */
		    /*  moved by the instruction. A "flexy"ed point means its nextcp */
		    /*  will be moved by the next instruction */
		    if ( sp->next==NULL )
		break;
		    sp = sp->next->to;
		    if ( sp==spl->first )
		break;
		}
	    }
	}
      break;
      case 0x38:
        /* Shift point by pixel amount */
	if ( exc->GS.gep2 ) {
	    for ( i=2; i<=exc->GS.loop+1 && i<exc->top; ++i )
		SetChangingPoint(ss,exc->stack[exc->top-i]);
	}
      break;
      case 0x39:
	/* Interpolated Point */
	if ( exc->GS.gep0 )
	    SetBasisPoint(ss,exc->GS.rp1);
	if ( exc->GS.gep1 )
	    SetBasisPoint(ss,exc->GS.rp2);
	if ( exc->GS.gep2 ) {
	    for ( i=1; i<=exc->GS.loop+1 && i<exc->top; ++i )
		SetChangingPoint(ss,exc->stack[exc->top-i]);
	}
      break;
      case 0x3A: case 0x3B:
	/* MSIRP Move Stack Indirect Relative Point */
	if ( exc->GS.gep1 )
	    changing_point = exc->stack[exc->top-2];
	if ( exc->GS.gep0 )
	    basis_point = exc->GS.rp0;
      break;
      case 0x3C:
	/* Align to Reference Point */
	if ( exc->GS.gep0 )
		basis_point = exc->GS.rp0;
	if ( exc->GS.gep1 )
	    for ( i=1; i<=exc->GS.loop && i<exc->top; ++i ) {
		SetChangingPoint(ss,exc->stack[exc->top-i]);
	    }
      break;
      case 0x3E: case 0x3F:
	/* MIAP Move Indirect Absolute Point */
	if ( exc->GS.gep0 )
	    changing_point = exc->stack[exc->top-2];
      break;
      case 0x46: case 0x47:
	/* Get current/original point coord projected on projection vector */
	if ( exc->GS.gep2 )
	    basis_point = exc->stack[exc->top-1];
      break;
      case 0x48:
	/* Sets coordinate from stack using proj & free vectors */
	if ( exc->GS.gep2 )
	    changing_point = exc->stack[exc->top-2];
      break;
      case 0x49: case 0x4A:
	/* Measure Distance */
	if ( exc->GS.gep0 )
	    SetBasisPoint( ss, exc->stack[exc->top-1] );
	if ( exc->GS.gep1 )
	    SetBasisPoint( ss, exc->stack[exc->top-2] );
      break;
      case 0x5D: case 0x71: case 0x72:
      case 0x73: case 0x74: case 0x75:
        /* Delta Point */
	cnt = exc->stack[exc->top-1];
	for ( i=0; i<cnt; ++i ) {
	    if ( 2*i+3 > exc->top )
	break;
	    if ( exc->GS.gep0 )
		SetChangingPoint(ss, exc->stack[exc->top-2-2*i]);
	}
      break;
      case 0x80:
	/* Flip Points */
	if ( exc->GS.gep0 )
	    for ( i=1; i<=exc->GS.loop && i<exc->top; ++i ) {
		SetChangingPoint(ss,exc->stack[exc->top-i]);
	    }
      break;
      case 0x81: case 0x82:
	i = exc->stack[exc->top-1];
	top = exc->stack[exc->top-2];
	if ( exc->GS.gep0 )
	    for ( ; i<=top; ++i ) {
		SetChangingPoint(ss,exc->stack[exc->top-i]);
	    }
      break;
      case 0x06: case 0x07:
      case 0x08: case 0x09:
      case 0x86: case 0x87:
        /* Sets vector from line */
	if ( exc->GS.gep1 )
	    SetBasisPoint(ss,exc->stack[exc->top-2]);
	if ( exc->GS.gep2 )
	    SetBasisPoint(ss,exc->stack[exc->top-1]);
      break;
      default:
	/* Many instructions don't refer to points */
      break;
    }
    if ( changing_point!=-1 )
	SetChangingPoint(ss,changing_point);
    if ( basis_point!=-1 )
	SetBasisPoint(ss,basis_point);
}

#else
void DVCreateGloss(DebugView *dv) {
}

void DVMarkPts(DebugView *dv,SplineSet *ss) {
}
#endif /* Has Debugger */