return 0;
}
return 1;
-#endif
+#endif /* HAVE_OTF */
not_otf:
return ((! spec->features[0] || spec->features[0][0] == 0xFFFFFFFF)
&& (! spec->features[1] || spec->features[1][0] == 0xFFFFFFFF));
*y += DEVICE_DELTA (anchor->f.f2.YDeviceTable, y_ppem);
}
}
-#endif
+#endif /* HAVE_OTF */
static int
ft_drive_otf (MFLTFont *font, MFLTOtfSpec *spec,
MRealizedFontFT *ft_rfont = rfont->info;
MFontFT *ft_info = (MFontFT *) rfont->font;
#ifdef HAVE_OTF
+ MGlyph *in_glyphs = (MGlyph *) (in->glyphs);
+ MGlyph *out_glyphs = (MGlyph *) (out->glyphs);
OTF *otf;
OTF_GlyphString otf_gstring;
OTF_Glyph *otfg;
return -2;
for (i = 0, otfg = otf_gstring.glyphs; i < otf_gstring.used; i++, otfg++)
{
- MGlyph *g = ((MGlyph *) out->glyphs) + out->used;
+ MGlyph *g = out_glyphs + out->used;
int j;
- *g = ((MGlyph *) in->glyphs)[from + otfg->f.index.from];
+ *g = in_glyphs[from + otfg->f.index.from];
g->g.c = 0;
for (j = from + otfg->f.index.from; j <= from + otfg->f.index.to; j++)
- if (((MGlyph *)in->glyphs)[j].g.code == otfg->glyph_id)
+ if (in_glyphs[j].g.code == otfg->glyph_id)
{
- g->g.c = ((MGlyph *)in->glyphs)[j].g.c;
+ g->g.c = in_glyphs[j].g.c;
break;
}
if (g->g.code != otfg->glyph_id)
if (out->allocated < out->used + len)
return -2;
for (i = 0; i < len; i++)
- ((MGlyph *) out->glyphs)[out->used++] = ((MGlyph *) in->glyphs)[from + i];
+ out_glyphs[out->used++] = in_glyphs[from + i];
}
if (gpos_features)
{
FT_Face face;
- MFLTGlyph *base = NULL, *mark = NULL, *g;
+ MGlyph *base = NULL, *mark = NULL, *g;
int x_ppem, y_ppem, x_scale, y_scale;
if (OTF_drive_gpos (otf, &otf_gstring, script, langsys, gpos_features)
x_scale = face->size->metrics.x_scale;
y_scale = face->size->metrics.y_scale;
- for (i = 0, otfg = otf_gstring.glyphs, g = out->glyphs + gidx;
+ for (i = 0, otfg = otf_gstring.glyphs, g = out_glyphs + gidx;
i < otf_gstring.used; i++, otfg++, g++)
{
- MFLTGlyph *prev;
+ MGlyph *prev;
if (! otfg->glyph_id)
continue;
{
case 0:
break;
- case 1: case 2:
+ case 1: /* Single */
+ case 2: /* Pair */
{
int format = otfg->f.f1.format;
adjustment[i].set = 1;
}
break;
- case 3:
+ case 3: /* Cursive */
/* Not yet supported. */
break;
- case 4: case 5:
+ case 4: /* Mark-to-Base */
+ case 5: /* Mark-to-Ligature */
if (! base)
break;
prev = base;
goto label_adjust_anchor;
- default: /* i.e. case 6 */
+ default: /* i.e. case 6 Mark-to-Mark */
if (! mark)
break;
prev = mark;
label_adjust_anchor:
{
int base_x, base_y, mark_x, mark_y;
+ int this_from, this_to;
base_x = otfg->f.f4.base_anchor->XCoordinate * x_scale / 0x10000;
base_y = otfg->f.f4.base_anchor->YCoordinate * y_scale / 0x10000;
mark_y = otfg->f.f4.mark_anchor->YCoordinate * y_scale / 0x10000;;
if (otfg->f.f4.base_anchor->AnchorFormat != 1)
- adjust_anchor (otfg->f.f4.base_anchor, face, prev->code,
+ adjust_anchor (otfg->f.f4.base_anchor, face, prev->g.code,
x_ppem, y_ppem, &base_x, &base_y);
if (otfg->f.f4.mark_anchor->AnchorFormat != 1)
- adjust_anchor (otfg->f.f4.mark_anchor, face, g->code,
+ adjust_anchor (otfg->f.f4.mark_anchor, face, g->g.code,
x_ppem, y_ppem, &mark_x, &mark_y);
adjustment[i].xoff = (base_x - mark_x);
adjustment[i].yoff = - (base_y - mark_y);
adjustment[i].xadv = 0;
adjustment[i].advance_is_absolute = 1;
adjustment[i].set = 1;
+ this_from = g->g.from;
+ this_to = g->g.to;
+ for (j = 0; prev + j < g; j++)
+ {
+ if (this_from > prev[j].g.from)
+ this_from = prev[j].g.from;
+ if (this_to < prev[j].g.to)
+ this_to = prev[j].g.to;
+ }
+ for (; prev <= g; prev++)
+ {
+ prev->g.from = this_from;
+ prev->g.to = this_to;
+ }
}
}
if (otfg->GlyphClass == OTF_GlyphClass0)
return to;
simple_copy:
+#endif /* HAVE_OTF */
if (out->allocated < out->used + len)
return -2;
font->get_metrics (font, in, from, to);
msymbol_put (monospace, Mgeneric_family, monospace);
msymbol_put (msymbol ("mono"), Mgeneric_family, monospace);
}
-#endif
+#endif /* HAVE_FONTCONFIG */
return 0;
}
}
#endif /* HAVE_FONTCONFIG */
-\f
-#endif /* HAVE_OTF */
-
#endif /* HAVE_FREETYPE */