Lines Matching refs:fi

813 static int parseCharMetrics( FileInputStream* fp, register FontInfo* fi)  in parseCharMetrics()  argument
817 register CharMetricInfo *temp = fi->cmi; in parseCharMetrics()
834 if (!(count < fi->numOfChars)) in parseCharMetrics()
836 reallocFontMetrics( (void**)&(fi->cmi), in parseCharMetrics()
837 &(fi->numOfChars), enlargeCount(fi->numOfChars), in parseCharMetrics()
839 temp = &(fi->cmi[ count - 1 ]); in parseCharMetrics()
841 if (count < fi->numOfChars) in parseCharMetrics()
847 if (fi->gfi && fi->gfi->charwidth) in parseCharMetrics()
848 temp->wx = fi->gfi->charwidth; in parseCharMetrics()
858 if (!(count < fi->numOfChars )) in parseCharMetrics()
860 reallocFontMetrics( (void**)&(fi->cmi), in parseCharMetrics()
861 &(fi->numOfChars), enlargeCount(fi->numOfChars), in parseCharMetrics()
863 temp = &(fi->cmi[ count - 1 ]); in parseCharMetrics()
865 if (count < fi->numOfChars) { in parseCharMetrics()
872 if (fi->gfi && fi->gfi->charwidth) in parseCharMetrics()
873 temp->wx = fi->gfi->charwidth; in parseCharMetrics()
944 if ((error == ok) && (count != fi->numOfChars)) in parseCharMetrics()
945 error = reallocFontMetrics( (void**)&(fi->cmi), &(fi->numOfChars), in parseCharMetrics()
948 if ((error == ok) && (count != fi->numOfChars)) in parseCharMetrics()
972 static int parseTrackKernData( FileInputStream* fp, register FontInfo* fi) in parseTrackKernData() argument
974 bool cont = true, save = (fi->tkd != NULL); in parseTrackKernData()
1012 if (!(tcount < fi->numOfTracks)) in parseTrackKernData()
1014 reallocFontMetrics( (void**)&(fi->tkd), &(fi->numOfTracks), in parseTrackKernData()
1015 enlargeCount(fi->numOfTracks), sizeof(TrackKernData) ); in parseTrackKernData()
1018 if (tcount < fi->numOfTracks) in parseTrackKernData()
1021 fi->tkd[pos].degree = atoi(keyword); in parseTrackKernData()
1023 fi->tkd[pos].minPtSize = StringToDouble(keyword); in parseTrackKernData()
1025 fi->tkd[pos].minKernAmt = StringToDouble(keyword); in parseTrackKernData()
1027 fi->tkd[pos].maxPtSize = StringToDouble(keyword); in parseTrackKernData()
1029 fi->tkd[pos++].maxKernAmt = StringToDouble(keyword); in parseTrackKernData()
1053 if (error == ok && tcount != fi->numOfTracks) in parseTrackKernData()
1054 error = reallocFontMetrics( (void**)&(fi->tkd), &(fi->numOfTracks), in parseTrackKernData()
1057 if (error == ok && tcount != fi->numOfTracks) in parseTrackKernData()
1080 static int parsePairKernData( FileInputStream* fp, register FontInfo* fi) in parsePairKernData() argument
1082 bool cont = true, save = (fi->pkd != NULL); in parsePairKernData()
1120 if (!(pcount < fi->numOfPairs)) in parsePairKernData()
1122 reallocFontMetrics( (void**)&(fi->pkd), &(fi->numOfPairs), in parsePairKernData()
1123 enlargeCount(fi->numOfPairs), sizeof(PairKernData) ); in parsePairKernData()
1125 if (pcount < fi->numOfPairs) in parsePairKernData()
1128 fi->pkd[pos].name1 = strdup( keyword ); in parsePairKernData()
1130 fi->pkd[pos].name2 = strdup( keyword ); in parsePairKernData()
1132 fi->pkd[pos].xamt = atoi(keyword); in parsePairKernData()
1134 fi->pkd[pos++].yamt = atoi(keyword); in parsePairKernData()
1144 if (!(pcount < fi->numOfPairs)) in parsePairKernData()
1146 reallocFontMetrics( (void**)&(fi->pkd), &(fi->numOfPairs), in parsePairKernData()
1147 enlargeCount(fi->numOfPairs), sizeof(PairKernData) ); in parsePairKernData()
1149 if (pcount < fi->numOfPairs) in parsePairKernData()
1152 fi->pkd[pos].name1 = strdup( keyword ); in parsePairKernData()
1154 fi->pkd[pos].name2 = strdup( keyword ); in parsePairKernData()
1156 fi->pkd[pos++].xamt = atoi(keyword); in parsePairKernData()
1180 if ((error == ok) && (pcount != fi->numOfPairs)) in parsePairKernData()
1181 error = reallocFontMetrics( (void**)&(fi->pkd), &(fi->numOfPairs), in parsePairKernData()
1184 if (error == ok && pcount != fi->numOfPairs) in parsePairKernData()
1210 static int parseCompCharData( FileInputStream* fp, register FontInfo* fi) in parseCompCharData() argument
1212 bool cont = true, firstTime = true, save = (fi->ccd != NULL); in parseCompCharData()
1226 if (ccount > fi->numOfComps) in parseCompCharData()
1228 reallocFontMetrics( (void**)&(fi->ccd), &(fi->numOfComps), in parseCompCharData()
1229 enlargeCount(fi->numOfComps), sizeof(CompCharData) ); in parseCompCharData()
1231 if (ccount > fi->numOfComps) in parseCompCharData()
1264 if (!(ccount < fi->numOfComps)) in parseCompCharData()
1266 reallocFontMetrics( (void**)&(fi->ccd), &(fi->numOfComps), in parseCompCharData()
1267 enlargeCount(fi->numOfComps), sizeof(CompCharData) ); in parseCompCharData()
1269 if (ccount < fi->numOfComps) in parseCompCharData()
1272 if (pcount != fi->ccd[pos].numOfPieces) in parseCompCharData()
1277 fi->ccd[pos].ccName = strdup( keyword ); in parseCompCharData()
1279 fi->ccd[pos].numOfPieces = atoi(keyword); in parseCompCharData()
1280 fi->ccd[pos].pieces = (Pcc *) in parseCompCharData()
1281 calloc(fi->ccd[pos].numOfPieces, sizeof(Pcc)); in parseCompCharData()
1292 if (pcount < fi->ccd[pos].numOfPieces) in parseCompCharData()
1295 fi->ccd[pos].pieces[j].pccName = strdup( keyword ); in parseCompCharData()
1297 fi->ccd[pos].pieces[j].deltax = atoi(keyword); in parseCompCharData()
1299 fi->ccd[pos].pieces[j++].deltay = atoi(keyword); in parseCompCharData()
1319 if (error == ok && ccount != fi->numOfComps) in parseCompCharData()
1320 reallocFontMetrics( (void**)&(fi->ccd), &(fi->numOfComps), in parseCompCharData()
1323 if (error == ok && ccount != fi->numOfComps) in parseCompCharData()
1357 int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags) in parseFile() argument
1368 (*fi) = (FontInfo *) calloc(1, sizeof(FontInfo)); in parseFile()
1369 if ((*fi) == NULL) {error = storageProblem; return(error);} in parseFile()
1373 (*fi)->gfi = (GlobalFontInfo *) calloc(1, sizeof(GlobalFontInfo)); in parseFile()
1374 if ((*fi)->gfi == NULL) {error = storageProblem; return(error);} in parseFile()
1379 code = parseGlobals(&aFile, (*fi)->gfi); in parseFile()
1394 (*fi)->numOfChars = atoi(keyword); in parseFile()
1397 (*fi)->cmi = (CharMetricInfo *) in parseFile()
1398 calloc((*fi)->numOfChars, sizeof(CharMetricInfo)); in parseFile()
1399 if ((*fi)->cmi == NULL) {error = storageProblem; return(error);} in parseFile()
1400 code = parseCharMetrics(&aFile, *fi); in parseFile()
1406 (*fi)->cwi = (int *) calloc(256, sizeof(int)); in parseFile()
1407 if ((*fi)->cwi == NULL) in parseFile()
1414 code = parseCharWidths(&aFile, (*fi)->cwi); in parseFile()
1446 (*fi)->numOfTracks = atoi(keyword); in parseFile()
1447 (*fi)->tkd = (TrackKernData *) in parseFile()
1448 calloc((*fi)->numOfTracks, sizeof(TrackKernData)); in parseFile()
1449 if ((*fi)->tkd == NULL) in parseFile()
1455 code = parseTrackKernData(&aFile, *fi); in parseFile()
1461 (*fi)->numOfPairs = atoi(keyword); in parseFile()
1462 (*fi)->pkd = (PairKernData *) in parseFile()
1463 calloc((*fi)->numOfPairs, sizeof(PairKernData)); in parseFile()
1464 if ((*fi)->pkd == NULL) in parseFile()
1470 code = parsePairKernData(&aFile, *fi); in parseFile()
1476 (*fi)->numOfComps = atoi(keyword); in parseFile()
1477 (*fi)->ccd = (CompCharData *) in parseFile()
1478 calloc((*fi)->numOfComps, sizeof(CompCharData)); in parseFile()
1479 if ((*fi)->ccd == NULL) in parseFile()
1485 code = parseCompCharData(&aFile, *fi); in parseFile()
1510 freeFontInfo (FontInfo *fi) in freeFontInfo() argument
1514 if (fi->gfi) in freeFontInfo()
1516 free (fi->gfi->afmVersion); in freeFontInfo()
1517 free (fi->gfi->fontName); in freeFontInfo()
1518 free (fi->gfi->fullName); in freeFontInfo()
1519 free (fi->gfi->familyName); in freeFontInfo()
1520 free (fi->gfi->weight); in freeFontInfo()
1521 free (fi->gfi->version); in freeFontInfo()
1522 free (fi->gfi->notice); in freeFontInfo()
1523 free (fi->gfi->encodingScheme); in freeFontInfo()
1524 free (fi->gfi); in freeFontInfo()
1527 free (fi->cwi); in freeFontInfo()
1529 if (fi->cmi) in freeFontInfo()
1531 for (i = 0; i < fi->numOfChars; i++) in freeFontInfo()
1534 free (fi->cmi[i].name); in freeFontInfo()
1535 ligs = fi->cmi[i].ligs; in freeFontInfo()
1546 free (fi->cmi); in freeFontInfo()
1549 free (fi->tkd); in freeFontInfo()
1551 if (fi->pkd) in freeFontInfo()
1553 for ( i = 0; i < fi->numOfPairs; i++) in freeFontInfo()
1555 free (fi->pkd[i].name1); in freeFontInfo()
1556 free (fi->pkd[i].name2); in freeFontInfo()
1558 free (fi->pkd); in freeFontInfo()
1561 if (fi->ccd) in freeFontInfo()
1563 for (i = 0; i < fi->numOfComps; i++) in freeFontInfo()
1565 free (fi->ccd[i].ccName); in freeFontInfo()
1566 for (j = 0; j < fi->ccd[i].numOfPieces; j++) in freeFontInfo()
1567 free (fi->ccd[i].pieces[j].pccName); in freeFontInfo()
1569 free (fi->ccd[i].pieces); in freeFontInfo()
1571 free (fi->ccd); in freeFontInfo()
1574 free (fi); in freeFontInfo()