- float (ht->xMin) / float (ht->Units_Per_EM),
- float (ht->yMin) / float (ht->Units_Per_EM),
- float (ht->xMax) / float (ht->Units_Per_EM),
- float (ht->yMax) / float (ht->Units_Per_EM));
+ float (ht->xMin) / float (ht->Units_Per_EM),
+ float (ht->yMin) / float (ht->Units_Per_EM),
+ float (ht->xMax) / float (ht->Units_Per_EM),
+ float (ht->yMax) / float (ht->Units_Per_EM));
- {
- if (long_offsets)
- {
- offset = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
- p += 4;
- }
- else
- {
- offset = ((p[0] << 8) | p[1]) << 1;
- p += 2;
- }
- if (offset > last_offset + CHUNKSIZE)
- {
- if (last_chunk != last_offset)
- chunks.push_back (FT_UShort (last_offset - last_chunk));
- /*
- a single glyph with more than 64k data
- is a pathological case but...
- */
- FT_ULong rest = offset - last_offset;
- while (rest > CHUNKSIZE)
- {
- chunks.push_back (CHUNKSIZE);
- rest -= CHUNKSIZE;
- }
- chunks.push_back (FT_UShort (rest));
- last_chunk = offset;
- }
- else if (offset > last_chunk + CHUNKSIZE)
- {
- chunks.push_back (FT_UShort (last_offset - last_chunk));
- last_chunk = last_offset;
- }
-
- last_offset = offset;
- }
+ {
+ if (long_offsets)
+ {
+ offset = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
+ p += 4;
+ }
+ else
+ {
+ offset = ((p[0] << 8) | p[1]) << 1;
+ p += 2;
+ }
+ if (offset > last_offset + CHUNKSIZE)
+ {
+ if (last_chunk != last_offset)
+ chunks.push_back (FT_UShort (last_offset - last_chunk));
+ /*
+ a single glyph with more than 64k data
+ is a pathological case but...
+ */
+ FT_ULong rest = offset - last_offset;
+ while (rest > CHUNKSIZE)
+ {
+ chunks.push_back (CHUNKSIZE);
+ rest -= CHUNKSIZE;
+ }
+ chunks.push_back (FT_UShort (rest));
+ last_chunk = offset;
+ }
+ else if (offset > last_chunk + CHUNKSIZE)
+ {
+ chunks.push_back (FT_UShort (last_offset - last_chunk));
+ last_chunk = last_offset;
+ }
+
+ last_offset = offset;
+ }
- {
- /* here, the buffer length must be a multiple of 4 */
- FT_ULong len = (lengths[i] + 3) & ~3;
- unsigned char *buf = new unsigned char[len];
-
- buf[len - 1] = 0x00; /* assure padding with zeros */
- buf[len - 2] = 0x00;
- buf[len - 3] = 0x00;
-
- FT_Error error = FT_Load_Sfnt_Table (face, tags[i], 0, buf, NULL);
- if (error)
- programming_error ("FT_Load_Sfnt_Table (): error.");
-
- if (tag == head_tag)
- {
- /*
- first pass of computing the font checksum
- needs checkSumAdjustment = 0
- */
- buf[8] = 0x00;
- buf[9] = 0x00;
- buf[10] = 0x00;
- buf[11] = 0x00;
- }
-
- checksum = 0;
- unsigned char *endq = buf + len;
- for (unsigned char *q = buf; q < endq; q += 4)
- checksum += (q[0] << 24) | (q[1] << 16) | (q[2] << 8) | q[3];
- font_checksum += checksum;
-
- delete[] buf;
-
- *(p++) = (unsigned char) ((tags[i] & 0xFF000000UL) >> 24);
- *(p++) = (unsigned char) ((tags[i] & 0x00FF0000UL) >> 16);
- *(p++) = (unsigned char) ((tags[i] & 0x0000FF00UL) >> 8);
- *(p++) = tags[i] & 0x000000FFUL;
-
- *(p++) = (unsigned char) ((checksum & 0xFF000000UL) >> 24);
- *(p++) = (unsigned char) ((checksum & 0x00FF0000UL) >> 16);
- *(p++) = (unsigned char) ((checksum & 0x0000FF00UL) >> 8);
- *(p++) = checksum & 0x000000FFUL;
-
- *(p++) = (unsigned char) ((offset & 0xFF000000UL) >> 24);
- *(p++) = (unsigned char) ((offset & 0x00FF0000UL) >> 16);
- *(p++) = (unsigned char) ((offset & 0x0000FF00UL) >> 8);
- *(p++) = offset & 0x000000FFUL;
-
- *(p++) = (unsigned char) ((lengths[i] & 0xFF000000UL) >> 24);
- *(p++) = (unsigned char) ((lengths[i] & 0x00FF0000UL) >> 16);
- *(p++) = (unsigned char) ((lengths[i] & 0x0000FF00UL) >> 8);
- *(p++) = lengths[i] & 0x000000FFUL;
-
- /* offset must be a multiple of 4 */
- offset += (lengths[i] + 3) & ~3;
- }
+ {
+ /* here, the buffer length must be a multiple of 4 */
+ FT_ULong len = (lengths[i] + 3) & ~3;
+ unsigned char *buf = new unsigned char[len];
+
+ buf[len - 1] = 0x00; /* assure padding with zeros */
+ buf[len - 2] = 0x00;
+ buf[len - 3] = 0x00;
+
+ FT_Error error = FT_Load_Sfnt_Table (face, tags[i], 0, buf, NULL);
+ if (error)
+ programming_error ("FT_Load_Sfnt_Table (): error.");
+
+ if (tag == head_tag)
+ {
+ /*
+ first pass of computing the font checksum
+ needs checkSumAdjustment = 0
+ */
+ buf[8] = 0x00;
+ buf[9] = 0x00;
+ buf[10] = 0x00;
+ buf[11] = 0x00;
+ }
+
+ checksum = 0;
+ unsigned char *endq = buf + len;
+ for (unsigned char *q = buf; q < endq; q += 4)
+ checksum += (q[0] << 24) | (q[1] << 16) | (q[2] << 8) | q[3];
+ font_checksum += checksum;
+
+ delete[] buf;
+
+ *(p++) = (unsigned char) ((tags[i] & 0xFF000000UL) >> 24);
+ *(p++) = (unsigned char) ((tags[i] & 0x00FF0000UL) >> 16);
+ *(p++) = (unsigned char) ((tags[i] & 0x0000FF00UL) >> 8);
+ *(p++) = tags[i] & 0x000000FFUL;
+
+ *(p++) = (unsigned char) ((checksum & 0xFF000000UL) >> 24);
+ *(p++) = (unsigned char) ((checksum & 0x00FF0000UL) >> 16);
+ *(p++) = (unsigned char) ((checksum & 0x0000FF00UL) >> 8);
+ *(p++) = checksum & 0x000000FFUL;
+
+ *(p++) = (unsigned char) ((offset & 0xFF000000UL) >> 24);
+ *(p++) = (unsigned char) ((offset & 0x00FF0000UL) >> 16);
+ *(p++) = (unsigned char) ((offset & 0x0000FF00UL) >> 8);
+ *(p++) = offset & 0x000000FFUL;
+
+ *(p++) = (unsigned char) ((lengths[i] & 0xFF000000UL) >> 24);
+ *(p++) = (unsigned char) ((lengths[i] & 0x00FF0000UL) >> 16);
+ *(p++) = (unsigned char) ((lengths[i] & 0x0000FF00UL) >> 8);
+ *(p++) = lengths[i] & 0x000000FFUL;
+
+ /* offset must be a multiple of 4 */
+ offset += (lengths[i] + 3) & ~3;
+ }
- {
- /* in the second pass simply store the computed font checksum */
- buf[8] = (unsigned char) ((font_checksum & 0xFF000000UL) >> 24);
- buf[9] = (unsigned char) ((font_checksum & 0x00FF0000UL) >> 16);
- buf[10] = (unsigned char) ((font_checksum & 0x0000FF00UL) >> 8);
- buf[11] = font_checksum & 0x000000FFUL;
- }
+ {
+ /* in the second pass simply store the computed font checksum */
+ buf[8] = (unsigned char) ((font_checksum & 0xFF000000UL) >> 24);
+ buf[9] = (unsigned char) ((font_checksum & 0x00FF0000UL) >> 16);
+ buf[10] = (unsigned char) ((font_checksum & 0x0000FF00UL) >> 8);
+ buf[11] = font_checksum & 0x000000FFUL;
+ }
- 1, 1, 0, (SCM ttf_file_name, SCM idx),
- "Extract the PostScript name from a TrueType font. The optional"
- " @var{idx} argument is useful for TrueType collections (TTC)"
- " only; it specifies the font index within the TTC. The default"
- " value of @var{idx} is@tie{}0.")
+ 1, 1, 0, (SCM ttf_file_name, SCM idx),
+ "Extract the PostScript name from a TrueType font. The optional"
+ " @var{idx} argument is useful for TrueType collections (TTC)"
+ " only; it specifies the font index within the TTC. The default"
+ " value of @var{idx} is@tie{}0.")
- 1, 1, 0, (SCM ttf_file_name, SCM idx),
- "Convert the contents of a TrueType font file to PostScript"
- " Type@tie{}42 font, returning it as a string. The optional"
- " @var{idx} argument is useful for TrueType collections (TTC)"
- " only; it specifies the font index within the TTC. The default"
- " value of @var{idx} is@tie{}0.")
+ 1, 1, 0, (SCM ttf_file_name, SCM idx),
+ "Convert the contents of a TrueType font file to PostScript"
+ " Type@tie{}42 font, returning it as a string. The optional"
+ " @var{idx} argument is useful for TrueType collections (TTC)"
+ " only; it specifies the font index within the TTC. The default"
+ " value of @var{idx} is@tie{}0.")