From c7971319864131c8bf82ed66998fcbac848e7a43 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 20 Jan 2003 23:19:32 +0000 Subject: [PATCH] *** empty log message *** --- example/otfview.c | 44 +++++++++++++++++++++++++++++++++++++------- src/config.h.in | 6 +++++- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/example/otfview.c b/example/otfview.c index 2680d73..66cab62 100644 --- a/example/otfview.c +++ b/example/otfview.c @@ -127,7 +127,6 @@ main (int argc, char **argv) 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 @@ -395,22 +394,53 @@ main (int argc, char **argv) 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) diff --git a/src/config.h.in b/src/config.h.in index d2fdb05..f78e200 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -24,7 +24,8 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if your system has a working `malloc' function. */ +/* Define to 1 if your system has a working `malloc' function, and to 0 + otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ @@ -85,3 +86,6 @@ /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc -- 1.7.10.4