idx = FT_Get_Char_Index (face, (FT_ULong) index);
else
idx = index;
- if (FT_Load_Glyph (face, idx, FT_LOAD_RENDER | FT_LOAD_MONOCHROME) == 0
- && face->glyph->bitmap.rows > 0
- && face->glyph->bitmap.width > 0)
+ if (FT_Load_Glyph (face, idx, FT_LOAD_RENDER | FT_LOAD_MONOCHROME) == 0)
{
- unsigned char *p = face->glyph->bitmap.buffer;
- int width = (face->glyph->bitmap.width - 1) / 8 + 1;
-
- fprintf (fp, "gsave %f %f translate %d %d scale 0 0 moveto\n",
- xoff + (unit + margin * 2) * j + margin - g_x,
- yoff + (unit + label_height + margin * 2) * (15 - i) + label_height + margin - g_y,
- 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,
- face->glyph->bitmap_top);
- fprintf (fp, "{< ");
- for (k = 0; k < face->glyph->bitmap.rows;
- k++, p += face->glyph->bitmap.pitch)
+ if (face->glyph->bitmap.rows > 0
+ && face->glyph->bitmap.width > 0)
{
- for (l = 0; l < width; l++)
- fprintf (fp, "%02X", p[l]);
- fprintf (fp, "\n");
+ unsigned char *p = face->glyph->bitmap.buffer;
+ int width = (face->glyph->bitmap.width - 1) / 8 + 1;
+
+ fprintf (fp, "gsave %f %f translate %d %d scale 0 0 moveto\n",
+ xoff + (unit + margin * 2) * j + margin - g_x,
+ yoff + (unit + label_height + margin * 2) * (15 - i) + label_height + margin - g_y,
+ 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,
+ face->glyph->bitmap_top);
+ fprintf (fp, "{< ");
+ for (k = 0; k < face->glyph->bitmap.rows;
+ k++, p += face->glyph->bitmap.pitch)
+ {
+ for (l = 0; l < width; l++)
+ fprintf (fp, "%02X", p[l]);
+ fprintf (fp, "\n");
+ }
+ fprintf (fp, ">} imagemask grestore\n");
+ }
+ else
+ {
+ int boxsize = unit + margin * 2;
+
+ fprintf (fp, "gsave 0 setlinewidth %d %d translate\n",
+ xoff + boxsize * j,
+ yoff + (boxsize + label_height) * (15 - i) + label_height);
+ fprintf (fp, "0 0 moveto %d %d lineto stroke\n",
+ boxsize, boxsize);
+ fprintf (fp, "0 %d moveto %d 0 lineto stroke grestore\n",
+ boxsize, boxsize);
}
- fprintf (fp, ">} imagemask grestore\n");
}
}
fprintf (fp, "showpage\n");