summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_font_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-06-21 13:48:59 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-06-21 13:48:59 +0000
commite15ba8bba18b0622c6bc7f91be5205973084326a (patch)
tree8a2101b8676356b82b991109e1fb0b2a71e07dbe /legacy/evas/src/lib/engines/common/evas_font_main.c
parent8a73aa9435a14dc8d10d64c4697409e82dd95b1f (diff)
tenative font glyph workaround for fonts not containing gfx drawing
chars. SVN revision: 72604
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_main.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_font_main.c b/legacy/evas/src/lib/engines/common/evas_font_main.c
index d2373ff71d..c09c46b83d 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_font_main.c
@@ -366,7 +366,6 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx)
366 if (fg == (void *)(-1)) return NULL; 366 if (fg == (void *)(-1)) return NULL;
367 else if (fg) return fg; 367 else if (fg) return fg;
368 } 368 }
369
370// fg = eina_hash_find(fi->glyphs, &hindex); 369// fg = eina_hash_find(fi->glyphs, &hindex);
371// if (fg) return fg; 370// if (fg) return fg;
372 371
@@ -467,6 +466,42 @@ struct _Font_Char_Index
467EAPI FT_UInt 466EAPI FT_UInt
468evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl) 467evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl)
469{ 468{
469 static const Eina_Unicode mapfix[] =
470 {
471 0x25c6, 0x1,
472 0x2592, 0x2,
473 0x2409, 0x3,
474 0x240c, 0x4,
475 0x240d, 0x5,
476 0x240a, 0x6,
477 0x00b0, 0x7,
478 0x00b1, 0x8,
479 0x2424, 0x9,
480 0x240b, 0xa,
481 0x2518, 0xb,
482 0x2510, 0xc,
483 0x250c, 0xd,
484 0x2514, 0xe,
485 0x253c, 0xf,
486 0x23ba, 0x10,
487 0x23bb, 0x11,
488 0x2500, 0x12,
489 0x23bc, 0x13,
490 0x23bd, 0x14,
491 0x251c, 0x15,
492 0x2524, 0x16,
493 0x2534, 0x17,
494 0x252c, 0x18,
495 0x2502, 0x19,
496 0x2264, 0x1a,
497 0x2265, 0x1b,
498 0x03c0, 0x1c,
499 0x2260, 0x1d,
500 0x00a3, 0xa3,
501 0x00b7, 0x1f,
502 0x20a4, 0xa3,
503 0x0000, 0x0
504 };
470 Font_Char_Index result; 505 Font_Char_Index result;
471 //FT_UInt ret; 506 //FT_UInt ret;
472 507
@@ -498,6 +533,22 @@ evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl)
498#ifdef HAVE_PTHREAD 533#ifdef HAVE_PTHREAD
499// pthread_mutex_unlock(&fi->ft_mutex); 534// pthread_mutex_unlock(&fi->ft_mutex);
500#endif 535#endif
536 if (result.index <= 0)
537 {
538 int i;
539
540 for (i = 0; mapfix[i]; i += 2)
541 {
542 if (gl == mapfix[i])
543 {
544 gl = mapfix[i + 1];
545 FTLOCK();
546 result.index = FT_Get_Char_Index(fi->src->ft.face, gl);
547 FTUNLOCK();
548 break;
549 }
550 }
551 }
501 return result.index; 552 return result.index;
502} 553}
503 554