Lines Matching defs:is

13  *  hpgs is free software; you can redistribute it and/or              *
18 * hpgs is distributed in the hope that it will be useful, *
164 static int read_uint32(hpgs_istream *is, uint32_t *x)
168 c1=hpgs_getc(is);
170 c2=hpgs_getc(is);
172 c3=hpgs_getc(is);
174 c4=hpgs_getc(is);
186 static int read_int32(hpgs_istream *is, int32_t *x) { return read_uint32(is,(uint32_t *)x); }
188 static int read_uint16(hpgs_istream *is, uint16_t *x)
192 c1=hpgs_getc(is);
194 c2=hpgs_getc(is);
204 static int read_int16(hpgs_istream *is, int16_t *x) { return read_uint16(is,(uint16_t *)x); }
206 static int read_uint8(hpgs_istream *is, uint8_t *x)
210 c=hpgs_getc(is);
217 static int read_int8(hpgs_istream *is, int8_t *x) { return read_uint8(is,(uint8_t *)x); }
222 static int ucs2_stream_string_to_utf8(hpgs_istream *is, size_t n, char *str)
230 if (read_uint16(is,&file_code)) return -1;
251 static int ascii_stream_string_to_utf8(hpgs_istream *is, size_t n, char *str)
257 int c = hpgs_getc(is);
269 static int read_table_entry(hpgs_istream *is, hpgs_font_table_entry *e)
271 if (read_uint32(is,&e->tag)) return -1;
272 if (read_uint32(is,&e->checksum)) return -1;
273 if (read_uint32(is,&e->offset)) return -1;
274 if (read_uint32(is,&e->length)) return -1;
385 static int read_header(hpgs_font_header *header, hpgs_istream *is)
400 if (read_int32(is,&header->version)) return -1;
407 but OpenType support is out of sight now, since this
411 if (read_uint16(is,&header->numtab)) return -1;
412 if (read_uint16(is,&header->searchRange)) return -1;
413 if (read_uint16(is,&header->entrySel)) return -1;
414 if (read_uint16(is,&header->rangeShift)) return -1;
420 if (read_table_entry(is,&header->tables[i])) return -1;
447 static int seek_table(hpgs_istream *is,
452 return hpgs_istream_seek(is,header->tables[table].offset);
459 return hpgs_istream_seek(font->is,font->header.tables[table].offset);
466 return hpgs_istream_seek(font->is,font->header.tables[table].offset+off);
470 hpgs_istream *is)
472 if (seek_table(is,header,header->name_table) < 0) return 0;
478 if (read_uint16(is,&format)) return 0;
479 if (read_uint16(is,&count)) return 0;
480 if (read_uint16(is,&stringOffset)) return 0;
493 if (read_uint16(is,&platformID)) return 0;
494 if (read_uint16(is,&encodingID)) return 0;
495 if (read_uint16(is,&languageID)) return 0;
496 if (read_uint16(is,&nameID)) return 0;
497 if (read_uint16(is,&length)) return 0;
498 if (read_uint16(is,&offset)) return 0;
515 if (hpgs_istream_seek(is,
523 if (ascii_stream_string_to_utf8(is,(size_t)length,name))
540 if (hpgs_istream_seek(is,
549 if (ucs2_stream_string_to_utf8(is,(size_t)length,name))
561 hpgs_istream *is=0;
592 is = hpgs_new_file_istream(fn);
593 if (!is) { free(fn); continue; }
595 if (read_header(&header,is) == 0)
597 char *name = scan_name_table(&header,is);
607 hpgs_istream_close(is);
608 is = 0;
637 is = hpgs_new_file_istream(fn);
638 if (!is) { free(fn); continue; }
640 if (read_header(&header,is) == 0)
642 char *name = scan_name_table(&header,is);
652 hpgs_istream_close(is);
653 is = 0;
743 if (read_uint32(font->is,&font->head_data.version)) return -1;
744 if (read_uint32(font->is,&font->head_data.fontRevision)) return -1;
745 if (read_uint32(font->is,&font->head_data.checkSumAdjustment)) return -1;
746 if (read_uint32(font->is,&font->head_data.magicNumber)) return -1;
747 if (read_uint16(font->is,&font->head_data.flags)) return -1;
748 if (read_uint16(font->is,&font->head_data.unitsPerEm)) return -1;
749 if (read_int32(font->is,&font->head_data.created_low)) return -1;
750 if (read_int32(font->is,&font->head_data.created_high)) return -1;
751 if (read_int32(font->is,&font->head_data.modified_low)) return -1;
752 if (read_int32(font->is,&font->head_data.modified_high)) return -1;
753 if (read_int16(font->is,&font->head_data.xMin)) return -1;
754 if (read_int16(font->is,&font->head_data.yMin)) return -1;
755 if (read_int16(font->is,&font->head_data.xMax)) return -1;
756 if (read_int16(font->is,&font->head_data.yMax)) return -1;
757 if (read_uint16(font->is,&font->head_data.macStyle)) return -1;
758 if (read_int16(font->is,&font->head_data.lowestRecPPEM)) return -1;
759 if (read_int16(font->is,&font->head_data.fontDirectionHint)) return -1;
760 if (read_int16(font->is,&font->head_data.indexToLocFormat)) return -1;
761 if (read_int16(font->is,&font->head_data.glyphDataFormat)) return -1;
770 if (read_uint32(font->is,&font->hhea_data.version)) return -1;
771 if (read_int16(font->is,&font->hhea_data.ascent)) return -1;
772 if (read_int16(font->is,&font->hhea_data.descent)) return -1;
773 if (read_int16(font->is,&font->hhea_data.lineGap)) return -1;
774 if (read_uint16(font->is,&font->hhea_data.advanceWidthMax)) return -1;
775 if (read_int16(font->is,&font->hhea_data.minLeftSideBearing)) return -1;
776 if (read_int16(font->is,&font->hhea_data.minRightSideBearing)) return -1;
777 if (read_int16(font->is,&font->hhea_data.xMaxExtent)) return -1;
778 if (read_int16(font->is,&font->hhea_data.caretSlopeRise)) return -1;
779 if (read_int16(font->is,&font->hhea_data.caretSlopeRun)) return -1;
780 if (read_int16(font->is,&font->hhea_data.caretOffset)) return -1;
781 if (read_int16(font->is,&font->hhea_data.reserved1)) return -1;
782 if (read_int16(font->is,&font->hhea_data.reserved2)) return -1;
783 if (read_int16(font->is,&font->hhea_data.reserved3)) return -1;
784 if (read_int16(font->is,&font->hhea_data.reserved4)) return -1;
785 if (read_int16(font->is,&font->hhea_data.metricDataFormat)) return -1;
786 if (read_uint16(font->is,&font->hhea_data.numOfLongHorMetrics)) return -1;
795 if (read_uint32(font->is,&font->maxp_data.version)) return -1;
796 if (read_uint16(font->is,&font->maxp_data.numGlyphs)) return -1;
797 if (read_uint16(font->is,&font->maxp_data.maxPoints)) return -1;
798 if (read_uint16(font->is,&font->maxp_data.maxContours)) return -1;
799 if (read_uint16(font->is,&font->maxp_data.maxComponentPoints)) return -1;
800 if (read_uint16(font->is,&font->maxp_data.maxComponentContours)) return -1;
801 if (read_uint16(font->is,&font->maxp_data.maxZones)) return -1;
802 if (read_uint16(font->is,&font->maxp_data.maxTwilightPoints)) return -1;
803 if (read_uint16(font->is,&font->maxp_data.maxStorage)) return -1;
804 if (read_uint16(font->is,&font->maxp_data.maxFunctionDefs)) return -1;
805 if (read_uint16(font->is,&font->maxp_data.maxInstructionDefs)) return -1;
806 if (read_uint16(font->is,&font->maxp_data.maxStackElements)) return -1;
807 if (read_uint16(font->is,&font->maxp_data.maxSizeOfInstructions)) return -1;
808 if (read_uint16(font->is,&font->maxp_data.maxComponentElements)) return -1;
809 if (read_uint16(font->is,&font->maxp_data.maxComponentDepth)) return -1;
829 if (read_uint16(font->is,&font->hmtx_data[i].advanceWidth)) return -1;
830 if (read_int16(font->is,&font->hmtx_data[i].leftSideBearing)) return -1;
839 if (read_int16(font->is,&font->hmtx_data[i].leftSideBearing)) return -1;
864 if (read_uint32(font->is,&font->loca_data[i])) return -1;
872 if (read_uint16(font->is,&x)) return -1;
897 // kerning must not be available, so this is not an error.
905 if (read_uint16(font->is,&version)) return -1;
906 if (read_uint16(font->is,&nTables)) return -1;
920 uint16_t coverage; // What type of information is contained in this table.
922 if (read_uint16(font->is,&version)) return -1;
923 if (read_uint16(font->is,&length)) return -1;
924 if (read_uint16(font->is,&coverage)) return -1;
933 uint16_t entrySelector; // This is calculated as log2 of the largest power of two less than or equal to the value of nPairs. This value indicates how many iterations of the search loop will have to be made. (For example, in a list of eight items, there would have to be three iterations of the loop).
936 if (read_uint16(font->is,&nPairs)) return -1;
937 if (read_uint16(font->is,&searchRange)) return -1;
938 if (read_uint16(font->is,&entrySelector)) return -1;
939 if (read_uint16(font->is,&rangeShift)) return -1;
954 if (read_uint16(font->is,&font->kern_data[i].left_gid)) return -1;
955 if (read_uint16(font->is,&font->kern_data[i].right_gid)) return -1;
956 if (read_int16(font->is,&value)) return -1;
979 if (read_uint16(font->is,&dummy)) return -1;
980 if (read_uint16(font->is,&numberSubtables)) return -1;
990 if (read_uint16(font->is,&platformID)) return -1;
991 if (read_uint16(font->is,&platformSpecificID)) return -1;
992 if (read_uint32(font->is,&offset)) return -1;
1006 if (read_uint16(font->is,&dummy)) return -1; // version
1008 // character map is not of type 4.
1012 if (read_uint16(font->is,&length)) return -1;
1014 if (read_uint16(font->is,&dummy)) return -1; // language
1015 if (read_uint16(font->is,&dummy)) return -1; // segCountX2
1028 if (read_uint16(font->is,&dummy)) return -1; // searchRange
1029 if (read_uint16(font->is,&dummy)) return -1; // entrySelector
1030 if (read_uint16(font->is,&dummy)) return -1; // rangeShift
1035 if (read_uint16(font->is,&font->cmap_data.ranges[i].endCode)) return -1;
1037 if (read_uint16(font->is,&dummy)) return -1; // reservedPad
1040 if (read_uint16(font->is,&font->cmap_data.ranges[i].startCode)) return -1;
1043 if (read_uint16(font->is,&font->cmap_data.ranges[i].idDelta)) return -1;
1046 if (read_uint16(font->is,&font->cmap_data.ranges[i].idRangeOffset)) return -1;
1049 if (read_uint16(font->is,&font->cmap_data.glyphIndexArray[i])) return -1;
1058 if (read_int32(font->is,&font->post_data.version)) return -1;
1062 if (read_int32(font->is,&font->post_data.italicAngle)) return -1;
1063 if (read_int16(font->is,&font->post_data.underlinePosition)) return -1;
1064 if (read_int16(font->is,&font->post_data.underlineThickness)) return -1;
1065 if (read_uint32(font->is,&font->post_data.isFixedPitch)) return -1;
1066 if (read_uint32(font->is,&font->post_data.minMemType42)) return -1;
1067 if (read_uint32(font->is,&font->post_data.maxMemType42)) return -1;
1068 if (read_uint32(font->is,&font->post_data.minMemType1)) return -1;
1069 if (read_uint32(font->is,&font->post_data.maxMemType1)) return -1;
1070 if (read_uint16(font->is,&font->post_data.numberOfGlyphs)) return -1;
1088 if (read_uint16(font->is,&glyphNameIndex[ig])) return -1;
1108 if (read_uint8(font->is,&name_l)) return -1;
1116 if ((c=hpgs_getc(font->is)) < 0)
1168 if (read_int16(font->is,&numberOfContours)) return -1;
1169 if (read_int16(font->is,&xMin)) return -1;
1170 if (read_int16(font->is,&yMin)) return -1;
1171 if (read_int16(font->is,&xMax)) return -1;
1172 if (read_int16(font->is,&yMax)) return -1;
1190 if (read_uint16(font->is,&endPtsOfContours[ic])) goto error;
1203 if (read_uint16(font->is,&instructionLength))goto error;
1207 if (hpgs_istream_read(instructions,1,instructionLength,font->is) != instructionLength)
1217 if (read_uint8(font->is,&flags[i])) goto error;
1224 if (read_uint8(font->is,&repeat)) goto error;
1246 if (read_uint8(font->is,&x)) goto error;
1255 if (flags[i] & (1<<4)) // This x is same
1261 if (read_int16(font->is,&xCoordinates[i])) goto error;
1278 if (read_uint8(font->is,&y)) goto error;
1287 if (flags[i] & (1<<5)) // This y is same
1293 if (read_int16(font->is,&yCoordinates[i])) goto error;
1343 if (read_uint16(font->is,&flags)) goto error;
1344 if (read_uint16(font->is,&glyphIndex)) goto error;
1353 if (read_int16(font->is,&dx)) goto error;
1354 if (read_int16(font->is,&dy)) goto error;
1366 if (read_int8(font->is,&dx)) goto error;
1367 if (read_int8(font->is,&dy)) goto error;
1377 if (read_int16(font->is,&scale)) goto error;
1386 if (read_int16(font->is,&xscale)) goto error;
1387 if (read_int16(font->is,&yscale)) goto error;
1400 if (read_int16(font->is,&mxx)) goto error;
1401 if (read_int16(font->is,&mxy)) goto error;
1402 if (read_int16(font->is,&myx)) goto error;
1403 if (read_int16(font->is,&myy)) goto error;
1547 ret->is = 0;
1563 ret->is = hpgs_new_file_istream(fn);
1565 if (!ret->is)
1571 if (read_header(&ret->header,ret->is))
1653 if (ret->is) hpgs_istream_close(ret->is);
1663 \c name is expected to be utf-8 encoded, which is almost no problem,
1737 if (font->is) hpgs_istream_close(font->is);
1794 returned glpyh id is used by several other font functions.
1805 of the form \c uniXXXX, where XXXX is the upppercase 4-digit
1842 id. The unit of the returned vector is em, the nominal size
1843 of the letter M of the font. For almost any font one em is actually
1863 ids. The unit of the returned vector is em, the nominal size
1864 of the letter M of the font. For almost any font one em is actually
1884 string given in utf8 encoding. The unit of the returned vector is em,
1886 one em is actually larger than the size of the capital letter M.