void
adjust_anchor (OTF_Anchor *anchor, FT_Face ft_face,
- OTF_Glyph *prev, int *x, int *y)
+ OTF_Glyph *g, int *x, int *y)
{
- if (anchor->AnchorFormat == 2 && prev)
+ if (anchor->AnchorFormat == 2)
{
FT_Outline *outline;
int ap = anchor->f.f1.AnchorPoint;
- FT_Load_Glyph (ft_face, (FT_UInt) prev->glyph_id, FT_LOAD_MONOCHROME);
+ FT_Load_Glyph (ft_face, (FT_UInt) g->glyph_id, FT_LOAD_MONOCHROME);
outline = &ft_face->glyph->outline;
if (ap < outline->n_points)
{
{
int i, x;
OTF_GlyphString gstring;
- OTF_Glyph *g, *prev;
- int prev_width;
+ OTF_Glyph *g, *prev, *base, *mark;
+ int base_width;
int len = glyph_rec.n_glyphs;
Arg arg[1];
int unitsPerEm = face->units_per_EM;
}
+ mark = base = NULL;
for (i = 0, x = glyph_x, prev = NULL, g = gstring.glyphs;
i < gstring.used; i++, prev = g++)
{
BitmapRec *bmp = bitmap + gstring.glyphs[i].glyph_id;
int xoff = 0, yoff = 0;
+ int prev_width;
int advance = bmp->advance;
if (! bmp->pixmap)
/* Not yet supported. */
break;
case 4: case 5:
+ if (! base)
+ break;
+ prev = base;
+ prev_width = base_width;
+ goto label_adjust_anchor;
+ default: /* i.e. case 6 */
+ if (! mark)
+ break;
+ prev = mark;
+ prev_width = 0;
+ label_adjust_anchor:
{
int base_x, base_y, mark_x, mark_y;
if (g->f.f4.base_anchor->AnchorFormat != 1)
adjust_anchor (g->f.f4.base_anchor, face, prev, &base_x, &base_y);
if (g->f.f4.mark_anchor->AnchorFormat != 1)
- adjust_anchor (g->f.f4.mark_anchor, face, prev, &mark_x, &mark_y);
+ adjust_anchor (g->f.f4.mark_anchor, face, g, &mark_x, &mark_y);
xoff = (base_x - prev_width) - mark_x;
yoff = base_y - mark_y;
}
- break;
-
- default: /* i.e case 6 */
- /* Not yet supported. */
- break;
}
XCopyArea (display, bmp->pixmap, seq_pixmap, gc_or,
glyph_x + bmp->x, glyph_y + bmp->y, bmp->width, bmp->height,
x + bmp->x + xoff, glyph_y + bmp->y - yoff);
- x += prev_width = advance;
+ x += advance;
+
+ if (g->GlyphClass == OTF_GlyphClass0)
+ base = mark = g, base_width = advance;
+ else if (g->GlyphClass == OTF_GlyphClassMark)
+ mark = g;
+ else
+ base = g, base_width = advance;
}
XtSetArg (arg[0], XtNbitmap, seq_pixmap);
XtSetValues (seq_image, arg, 1);