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)
+ if (idx > 0
+ && FT_Load_Glyph (face, idx, FT_LOAD_RENDER | FT_LOAD_MONOCHROME) == 0
+ && face->glyph->bitmap.rows > 0
+ && face->glyph->bitmap.width > 0)
{
- if (face->glyph->bitmap.rows > 0
- && face->glyph->bitmap.width > 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)
{
- 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);
+ 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, "showpage\n");
n += otf->gsub->ScriptList.Script[i].LangSysCount + 1;
if (otf->gpos)
for (i = 0; i < otf->gpos->ScriptList.ScriptCount; i++)
- n += otf->gsub->ScriptList.Script[i].LangSysCount + 1;
+ n += otf->gpos->ScriptList.Script[i].LangSysCount + 1;
script_langsys = alloca ((sizeof script_langsys[0]) * n);
n = 0;
nfeatures = 0;
script_langsys[n].script = tag;
script_langsys[n++].langsys = 0;
}
- for (j = 0; j < otf->gsub->ScriptList.Script[i].LangSysCount; j++)
+ for (j = 0; j < otf->gpos->ScriptList.Script[i].LangSysCount; j++)
{
int l;
if (k < prev_n)
{
- OTF_Script *script = otf->gsub->ScriptList.Script + i;
+ OTF_Script *script = otf->gpos->ScriptList.Script + i;
for (l = k; l < prev_n && tag == script_langsys[l].script; l++)
if (script->LangSysRecord[j].LangSysTag