| | idxl[0] ... idxl[15] | |
| +--------------------------------------+ |
| +--- render_area (form) ---------------+ |
- | | clear del bidi | |
+ | | clear del bidi alt_subst | |
| | +--- raw (box) --------------------+ | |
| | | raw_label raw_image | | |
| | +----------------------------------+ | |
Widget command_area, quit, dump, *charmap;
Widget navi_area, FIRST, PREV, prev, range, next, NEXT, LAST;
Widget glyph_area, glyph[128], index_label[8];
-Widget render_area, clear, del, bidi, raw, seq;
+Widget render_area, clear, del, bidi, alt_subst, raw, seq;
Widget raw_label, raw_image, seq_label, seq_image;
unsigned long foreground, background;
int charmap_index;
int reversed;
+int do_alternate_subst;
unsigned glyph_width, glyph_height;
int glyph_x, glyph_y;
int glyph_index;
str = get_features (&otf->gsub->FeatureList, &gsub);
if (str)
{
- OTF_drive_gsub (otf, &gstring, NULL, NULL, str);
+ if (do_alternate_subst)
+ OTF_drive_gsub_alternate (otf, &gstring, NULL, NULL, str);
+ else
+ OTF_drive_gsub (otf, &gstring, NULL, NULL, str);
free (str);
}
}
create_pixmap (gstring.glyphs[i].glyph_id);
if (! bmp->pixmap)
continue;
+ advance = bmp->advance;
}
switch (g->positioning_type)
{
mark = g;
else
base = g, base_width = advance;
-
- if (g->alternate_set)
- for (j = 0; j < g->alternate_set->GlyphCount; j++)
- {
- bmp = bitmap + g->alternate_set->Alternate[j];
- if (! bmp->pixmap)
- create_pixmap (g->alternate_set->Alternate[j]);
- if (! bmp->pixmap)
- continue;
- 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 += bmp->advance;
- }
}
free (gstring.glyphs);
}
void
+AltSubstProc (Widget w, XtPointer client_data, XtPointer call_data)
+{
+ do_alternate_subst = ! do_alternate_subst;
+ update_seq_area ();
+}
+
+void
FeatureProc (Widget w, XtPointer client_data, XtPointer call_data)
{
FeatureRec *rec = (FeatureRec *) client_data;
XtAddCallback (del, XtNcallback, RenderProc, (XtPointer) -2);
bidi = XtCreateManagedWidget ("L->R", toggleWidgetClass, w, arg, 0);
XtAddCallback (bidi, XtNcallback, BidiProc, NULL);
+ alt_subst = XtCreateManagedWidget ("AltSubst", toggleWidgetClass, w, arg, 0);
+ XtAddCallback (alt_subst, XtNcallback, AltSubstProc, NULL);
XtSetArg (arg[4], XtNorientation, XtorientHorizontal);
XtSetArg (arg[5], XtNborderWidth, 0);