|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1984, 1985, 1986 Xerox Corp. ! 3: * ! 4: * Print out a table of contents (toc) ! 5: * ! 6: * HISTORY ! 7: * 15-Apr-86 Lee Moore (lee) at Xerox Webster Research Center ! 8: * Created from troff.c ! 9: * ! 10: * Nov, 1985 Lee Moore, Xerox Webster Research Center ! 11: * Created. ! 12: */ ! 13: ! 14: #include <stdio.h> ! 15: #include <math.h> ! 16: #include "stack.h" ! 17: #include "token.h" ! 18: #include "config.h" ! 19: #include "ipmetrics.h" ! 20: ! 21: #define TRUE 1 ! 22: #define FALSE 0 ! 23: ! 24: ! 25: #define public ! 26: #define private static ! 27: ! 28: public char *malloc(); ! 29: ! 30: public char *DeviceName, ! 31: *LibraryDirectory; ! 32: ! 33: public ! 34: InitTOC() { ! 35: putchar('\n'); ! 36: } ! 37: ! 38: ! 39: /* ! 40: * called once per font on the stack ! 41: */ ! 42: ! 43: public ! 44: PerTOCFont(configChain, fontDescVec) ! 45: struct FontConfig *configChain; ! 46: unsigned char *fontDescVec; { ! 47: unsigned char *charMetricsProperty, ! 48: *metricsProperty, ! 49: *width, ! 50: *charMetric; ! 51: char iSender[MAXTOKENSIZE], ! 52: iCharName[MAXTOKENSIZE], ! 53: fileType[MAXTOKENSIZE], ! 54: *fontName[3], ! 55: iCharSet[MAXTOKENSIZE], ! 56: iCharCode[MAXTOKENSIZE]; ! 57: FILE *descFile, ! 58: *modelFile; ! 59: struct FontConfig *p; ! 60: struct TokenState *ts; ! 61: int charSet, ! 62: charNumber, ! 63: charIndex, ! 64: xWidth; ! 65: ! 66: if( !GetFontNameProperty(fontDescVec, fontName) ) { ! 67: fprintf(stderr, "ipmetrics: can't get font name\n"); ! 68: return; ! 69: } ! 70: ! 71: printf("font name is: %s/%s/%s\n", fontName[0], fontName[1], fontName[2]); ! 72: ! 73: ! 74: if( (charMetricsProperty = GetStringProp("characterMetrics", fontDescVec)) ! 75: == NULL ) { ! 76: printf("ipmetrics: can't find 'characterMetrics' property\n"); ! 77: return; } ! 78: ! 79: if( (metricsProperty = GetStringProp("metrics", fontDescVec)) ! 80: != NULL ) { ! 81: unsigned char *easyProperty; ! 82: ! 83: if( (easyProperty = GetStringProp("easy", metricsProperty)) ! 84: != NULL ) ! 85: printf("\thas easy metrics\n"); ! 86: } ! 87: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.