int err;
int i, j, max_glyph_idx;
int first_idx;
- int left_idx = -1, right_idx = -1;
int update_mask;
#define UPDATE_RENDERING 1
#define UPDATE_BITMAP 2
OTF_drive_cmap (otf, &gstring);
y = margin + font_height + 1;
- for (i = 0; i < n_codes; i++, x+= max_glyph_width)
+ for (i = 0; i < n_codes; i++, x += max_glyph_width)
draw_bitmap (gstring.glyphs[i].glyph_id, x, -x0, max_glyph_width,
y, -y0, max_glyph_height, 1);
OTF_drive_gsub (otf, &gstring, "deva", NULL, NULL);
x = margin + font_width * 9;
y += max_glyph_height;
+ for (i = 0; i < gstring.used; i++, x += max_glyph_width)
+ draw_bitmap (gstring.glyphs[i].glyph_id, x, -x0, max_glyph_width,
+ y, -y0, max_glyph_height, 0);
+
+ OTF_drive_gpos (otf, &gstring, "deva", NULL, NULL);
+ x = margin + font_width * 9;
+ y += max_glyph_height;
for (i = 0; i < gstring.used; i++)
{
- draw_bitmap (gstring.glyphs[i].glyph_id, x, -x0, max_glyph_width,
- y, -y0, max_glyph_height, 0);
+ int xoff = 0, yoff = 0;
+ OTF_Glyph *g = gstring.glyphs + i;
+
+ switch (g->positioning_type)
+ {
+ case 1: case 2:
+ if (g->f.f1.format & OTF_XPlacement)
+ xoff = PIXEL_SIZE * ((double) (g->f.f1.value->XPlacement)
+ * 100 / otf->head->unitsPerEm);
+ if (g->f.f1.format & OTF_YPlacement)
+ yoff = PIXEL_SIZE * ((double) (g->f.f1.value->YPlacement)
+ * 100 / otf->head->unitsPerEm);
+ break;
+
+ case 4:
+ xoff = (PIXEL_SIZE
+ * ((double) (g->f.f4.base_anchor->XCoordinate
+ - g->f.f4.mark_anchor->XCoordinate)
+ * 100 / otf->head->unitsPerEm));
+ yoff = (PIXEL_SIZE
+ * ((double) (g->f.f4.base_anchor->YCoordinate
+ - g->f.f4.mark_anchor->YCoordinate)
+ * 100 / otf->head->unitsPerEm));
+ break;
+ }
+
+ draw_bitmap (gstring.glyphs[i].glyph_id, x, -x0 + xoff,
+ max_glyph_width,
+ y, -y0 + yoff, max_glyph_height, 0);
x += bitmap[gstring.glyphs[i].glyph_id].width;
}
-
- draw_big_bitmat (left_idx, max_glyph_width * 2, -x0 * 5, max_glyph_width * 5,
- 5, -y0 * 5, max_glyph_height * 5);
}
if (update_mask & UPDATE_BITMAP)