aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorK. Handa2015-09-02 22:29:37 +0900
committerK. Handa2015-09-02 22:29:37 +0900
commit33f2e0023a5ef03db3e99ade0b93a7a1a913dbe1 (patch)
tree576cdcead4b57550ee04d9b04bd61e851a366b89 /src
parentfa5a9c7bae6d484107162641d16b1b38312ac225 (diff)
downloademacs-33f2e0023a5ef03db3e99ade0b93a7a1a913dbe1.tar.gz
emacs-33f2e0023a5ef03db3e99ade0b93a7a1a913dbe1.zip
fix for the case that M17N_FLT_USE_NEW_FEATURE is not defined
* ftfont.c (ftfont_drive_otf) [not M17N_FLT_USE_NEW_FEATURE]: Adjusted for the change of type of elements in the array MFLTGlyphString.glyphs.
Diffstat (limited to 'src')
-rw-r--r--src/ftfont.c68
1 files changed, 35 insertions, 33 deletions
diff --git a/src/ftfont.c b/src/ftfont.c
index 98058aca343..15a815924c1 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -2234,6 +2234,8 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2234 MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment) 2234 MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment)
2235{ 2235{
2236 struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font; 2236 struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font;
2237 MFLTGlyphFT *in_glyphs = (MFLTGlyphFT *) (in->glyphs) + from;
2238 MFLTGlyphFT *out_glyphs = out ? (MFLTGlyphFT *) (out->glyphs) : NULL;
2237 FT_Face ft_face = flt_font_ft->ft_face; 2239 FT_Face ft_face = flt_font_ft->ft_face;
2238 OTF *otf = flt_font_ft->otf; 2240 OTF *otf = flt_font_ft->otf;
2239 int len = to - from; 2241 int len = to - from;
@@ -2284,8 +2286,8 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2284 setup_otf_gstring (len); 2286 setup_otf_gstring (len);
2285 for (i = 0; i < len; i++) 2287 for (i = 0; i < len; i++)
2286 { 2288 {
2287 otf_gstring.glyphs[i].c = in->glyphs[from + i].c; 2289 otf_gstring.glyphs[i].c = in_glyphs[i].g.c;
2288 otf_gstring.glyphs[i].glyph_id = in->glyphs[from + i].code; 2290 otf_gstring.glyphs[i].glyph_id = in_glyphs[i].g.code;
2289 } 2291 }
2290 2292
2291 OTF_drive_gdef (otf, &otf_gstring); 2293 OTF_drive_gdef (otf, &otf_gstring);
@@ -2307,17 +2309,17 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2307 int min_from, max_to; 2309 int min_from, max_to;
2308 int j; 2310 int j;
2309 2311
2310 g = out->glyphs + out->used; 2312 g = out_glyphs + out->used;
2311 *g = in->glyphs[from + otfg->f.index.from]; 2313 *g = in_glyphs[otfg->f.index.from];
2312 if (g->code != otfg->glyph_id) 2314 if (g->g.code != otfg->glyph_id)
2313 { 2315 {
2314 g->c = 0; 2316 g->g.c = 0;
2315 g->code = otfg->glyph_id; 2317 g->g.code = otfg->glyph_id;
2316 g->measured = 0; 2318 g->g.measured = 0;
2317 } 2319 }
2318 out->used++; 2320 out->used++;
2319 min_from = g->from; 2321 min_from = g->g.from;
2320 max_to = g->to; 2322 max_to = g->g.to;
2321 if (otfg->f.index.from < otfg->f.index.to) 2323 if (otfg->f.index.from < otfg->f.index.to)
2322 { 2324 {
2323 /* OTFG substitutes multiple glyphs in IN. */ 2325 /* OTFG substitutes multiple glyphs in IN. */
@@ -2329,20 +2331,20 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2329 if (max_to < in->glyphs[j].to) 2331 if (max_to < in->glyphs[j].to)
2330 max_to = in->glyphs[j].to; 2332 max_to = in->glyphs[j].to;
2331 } 2333 }
2332 g->from = min_from; 2334 g->g.from = min_from;
2333 g->to = max_to; 2335 g->g.to = max_to;
2334 } 2336 }
2335 for (i++, otfg++; (i < otf_gstring.used 2337 for (i++, otfg++; (i < otf_gstring.used
2336 && otfg->f.index.from == otfg[-1].f.index.from); 2338 && otfg->f.index.from == otfg[-1].f.index.from);
2337 i++, otfg++) 2339 i++, otfg++)
2338 { 2340 {
2339 g = out->glyphs + out->used; 2341 g = out_glyphs + out->used;
2340 *g = in->glyphs[from + otfg->f.index.to]; 2342 *g = in_glyphs[otfg->f.index.to];
2341 if (g->code != otfg->glyph_id) 2343 if (g->g.code != otfg->glyph_id)
2342 { 2344 {
2343 g->c = 0; 2345 g->g.c = 0;
2344 g->code = otfg->glyph_id; 2346 g->g.code = otfg->glyph_id;
2345 g->measured = 0; 2347 g->g.measured = 0;
2346 } 2348 }
2347 out->used++; 2349 out->used++;
2348 } 2350 }
@@ -2356,7 +2358,7 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2356 return -2; 2358 return -2;
2357 } 2359 }
2358 for (i = 0; i < len; i++) 2360 for (i = 0; i < len; i++)
2359 out->glyphs[out->used++] = in->glyphs[from + i]; 2361 out_glyphs[out->used++] = in_glyphs[i];
2360 } 2362 }
2361 2363
2362 if (gpos_features) 2364 if (gpos_features)
@@ -2376,7 +2378,7 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2376 x_scale = ft_face->size->metrics.x_scale; 2378 x_scale = ft_face->size->metrics.x_scale;
2377 y_scale = ft_face->size->metrics.y_scale; 2379 y_scale = ft_face->size->metrics.y_scale;
2378 2380
2379 for (i = 0, otfg = otf_gstring.glyphs, g = out->glyphs + gidx; 2381 for (i = 0, otfg = otf_gstring.glyphs, g = out_glyphs + gidx;
2380 i < otf_gstring.used; i++, otfg++, g++) 2382 i < otf_gstring.used; i++, otfg++, g++)
2381 { 2383 {
2382 MFLTGlyphFT *prev; 2384 MFLTGlyphFT *prev;
@@ -2444,10 +2446,10 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2444 mark_y = otfg->f.f4.mark_anchor->YCoordinate * y_scale / 0x10000; 2446 mark_y = otfg->f.f4.mark_anchor->YCoordinate * y_scale / 0x10000;
2445 2447
2446 if (otfg->f.f4.base_anchor->AnchorFormat != 1) 2448 if (otfg->f.f4.base_anchor->AnchorFormat != 1)
2447 adjust_anchor (ft_face, otfg->f.f4.base_anchor, 2449 adjust_anchor (ft_face, otfg->f.f4.base_anchor, prev->g.code,
2448 prev->code, x_ppem, y_ppem, &base_x, &base_y); 2450 x_ppem, y_ppem, &base_x, &base_y);
2449 if (otfg->f.f4.mark_anchor->AnchorFormat != 1) 2451 if (otfg->f.f4.mark_anchor->AnchorFormat != 1)
2450 adjust_anchor (ft_face, otfg->f.f4.mark_anchor, g->code, 2452 adjust_anchor (ft_face, otfg->f.f4.mark_anchor, g->g.code,
2451 x_ppem, y_ppem, &mark_x, &mark_y); 2453 x_ppem, y_ppem, &mark_x, &mark_y);
2452 adjustment[i].xoff = (base_x - mark_x); 2454 adjustment[i].xoff = (base_x - mark_x);
2453 adjustment[i].yoff = - (base_y - mark_y); 2455 adjustment[i].yoff = - (base_y - mark_y);
@@ -2455,19 +2457,19 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2455 adjustment[i].xadv = 0; 2457 adjustment[i].xadv = 0;
2456 adjustment[i].advance_is_absolute = 1; 2458 adjustment[i].advance_is_absolute = 1;
2457 adjustment[i].set = 1; 2459 adjustment[i].set = 1;
2458 this_from = g->from; 2460 this_from = g->g.from;
2459 this_to = g->to; 2461 this_to = g->g.to;
2460 for (j = 0; prev + j < g; j++) 2462 for (j = 0; prev + j < g; j++)
2461 { 2463 {
2462 if (this_from > prev[j].from) 2464 if (this_from > prev[j].g.from)
2463 this_from = prev[j].from; 2465 this_from = prev[j].g.from;
2464 if (this_to < prev[j].to) 2466 if (this_to < prev[j].g.to)
2465 this_to = prev[j].to; 2467 this_to = prev[j].g.to;
2466 } 2468 }
2467 for (; prev <= g; prev++) 2469 for (; prev <= g; prev++)
2468 { 2470 {
2469 prev->from = this_from; 2471 prev->g.from = this_from;
2470 prev->to = this_to; 2472 prev->g.to = this_to;
2471 } 2473 }
2472 } 2474 }
2473 } 2475 }
@@ -2487,8 +2489,8 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
2487 if (out->allocated < out->used + len) 2489 if (out->allocated < out->used + len)
2488 return -2; 2490 return -2;
2489 font->get_metrics (font, in, from, to); 2491 font->get_metrics (font, in, from, to);
2490 memcpy (out->glyphs + out->used, in->glyphs + from, 2492 memcpy (out_glyphs + out->used, in_glyphs,
2491 sizeof (MFLTGlyph) * len); 2493 sizeof (MFLTGlyphFT) * len);
2492 out->used += len; 2494 out->used += len;
2493 return to; 2495 return to;
2494} 2496}