int index = (glyph_index / 0x100) * 0x100;
float scale;
+ g_width = face->bbox.xMax - face->bbox.xMin;
+ g_height = face->bbox.yMax - face->bbox.yMin;
+ if (g_width > g_height)
+ {
+ scale = g_width * size;
+ g_x = face->bbox.xMin * unit / g_width;
+ g_y = face->bbox.yMin * unit / g_width;
+ }
+ else
+ {
+ scale = g_height * size;
+ g_x = face->bbox.xMin * unit / g_height;
+ g_y = face->bbox.yMin * unit / g_height;
+ }
+ scale /= face->units_per_EM;
+
+ FT_Set_Pixel_Sizes (face, 0, size);
+
sprintf (name, "%s-%04X.ps", face->family_name, index);
printf ("Writing %s ... ", name);
fflush (stdout);
fprintf (fp, "%s\n", "%%EndProlog");
fprintf (fp, "DrawTitle DrawFrame\n");
- g_width = face->bbox.xMax - face->bbox.xMin;
- g_height = face->bbox.yMax - face->bbox.yMin;
- scale = ((g_width > g_height) ? g_width : g_height) * size;
- scale /= face->units_per_EM;
- g_x = face->bbox.xMin * scale / unit / face->units_per_EM;
- g_y = face->bbox.yMin * scale / unit / face->units_per_EM;
-
- FT_Set_Pixel_Sizes (face, 0, size);
for (i = 0; i < 16; i++)
for (j = 0; j < 16; j++, index++)
{
unit, unit);
fprintf (fp, "%d %d true [%f 0 0 %f %d %d]\n",
width * 8, face->glyph->bitmap.rows,
- scale, -scale, face->glyph->bitmap_left,
+ scale, -scale, -face->glyph->bitmap_left,
face->glyph->bitmap_top);
fprintf (fp, "{< ");
for (k = 0; k < face->glyph->bitmap.rows;