diff options
author | Youngbok Shin <youngb.shin@samsung.com> | 2017-09-25 18:34:22 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2017-09-26 11:31:31 +0900 |
commit | 17504106501cec1a0a85eb380c5dea7e0ca3729c (patch) | |
tree | 942944734aa98b84c791206bdc6c5db1e084c3ae /src | |
parent | bb887f9869c3dd9eca72c8e65f335d148f9dbdd3 (diff) |
evas: Add scale feature for embedded bitmap fonts.
Summary:
When evas selects a strike of embedded bitmap font,
calculate ratio and use it for scaling embedded bitmap.
@feature
Reviewers: jpeg, tasn, woohyun, raster, herdsman
Reviewed By: raster
Subscribers: charlesmilette, Francesco149, cedric
Differential Revision: https://phab.enlightenment.org/D2713
Diffstat (limited to 'src')
20 files changed, 395 insertions, 181 deletions
diff --git a/src/lib/efl/interfaces/efl_text_font.eo b/src/lib/efl/interfaces/efl_text_font.eo index b43c522c2a..b68e142b6f 100644 --- a/src/lib/efl/interfaces/efl_text_font.eo +++ b/src/lib/efl/interfaces/efl_text_font.eo | |||
@@ -37,6 +37,18 @@ enum Efl.Text.Font.Slant { | |||
37 | italic, [[Italic font slant]] | 37 | italic, [[Italic font slant]] |
38 | } | 38 | } |
39 | 39 | ||
40 | /* FIXME: It needs to support "normal" option for non-color bitmap font. | ||
41 | For supporting "normal" option, S/W glyph drawing engine should be updated. | ||
42 | */ | ||
43 | enum Efl.Text.Font.Bitmap_Scalable { | ||
44 | [[Scalable of bitmap fonts | ||
45 | |||
46 | @since 1.21 | ||
47 | ]] | ||
48 | none = 0, [[Disable scalable feature for bitmap fonts.]] | ||
49 | color = (1 << 0), [[Enable scalable feature for color bitmap fonts.]] | ||
50 | } | ||
51 | |||
40 | interface Efl.Text.Font { | 52 | interface Efl.Text.Font { |
41 | [[Font settings of the text | 53 | [[Font settings of the text |
42 | 54 | ||
@@ -114,5 +126,17 @@ interface Efl.Text.Font { | |||
114 | lang: string; [[Language]] | 126 | lang: string; [[Language]] |
115 | } | 127 | } |
116 | } | 128 | } |
129 | |||
130 | @property font_bitmap_scalable { | ||
131 | [[The bitmap fonts have fixed size glyphs for several available sizes. | ||
132 | Basically, it is not scalable. But, it needs to be scalable for some use cases. | ||
133 | (ex. colorful emoji fonts) | ||
134 | |||
135 | Default is $Efl.Text.Font.Bitmap_Scalable.none\. | ||
136 | ]] | ||
137 | values { | ||
138 | scalable: Efl.Text.Font.Bitmap_Scalable; [[Scalable]] | ||
139 | } | ||
140 | } | ||
117 | } | 141 | } |
118 | } | 142 | } |
diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo index d18c9bf93f..22b8e9dd0d 100644 --- a/src/lib/evas/canvas/efl_canvas_text.eo +++ b/src/lib/evas/canvas/efl_canvas_text.eo | |||
@@ -282,6 +282,7 @@ Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor, Efl.Text.Annota | |||
282 | Efl.Text.Font.font_weight { get; set; } | 282 | Efl.Text.Font.font_weight { get; set; } |
283 | Efl.Text.Font.font_slant { get; set; } | 283 | Efl.Text.Font.font_slant { get; set; } |
284 | Efl.Text.Font.font_width { get; set; } | 284 | Efl.Text.Font.font_width { get; set; } |
285 | Efl.Text.Font.font_bitmap_scalable { get; set; } | ||
285 | Efl.Text.Style.normal_color { get; set; } | 286 | Efl.Text.Style.normal_color { get; set; } |
286 | Efl.Text.Style.backing_type { get; set; } | 287 | Efl.Text.Style.backing_type { get; set; } |
287 | Efl.Text.Style.backing_color { get; set; } | 288 | Efl.Text.Style.backing_color { get; set; } |
diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index 80e37fad08..6514b0ffd4 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c | |||
@@ -32,6 +32,7 @@ struct _Fndat | |||
32 | Evas_Font_Set *font; | 32 | Evas_Font_Set *font; |
33 | int ref; | 33 | int ref; |
34 | Font_Rend_Flags wanted_rend; | 34 | Font_Rend_Flags wanted_rend; |
35 | Efl_Text_Font_Bitmap_Scalable bitmap_scalable; | ||
35 | 36 | ||
36 | #ifdef HAVE_FONTCONFIG | 37 | #ifdef HAVE_FONTCONFIG |
37 | FcFontSet *set; | 38 | FcFontSet *set; |
@@ -235,7 +236,7 @@ evas_font_free(Evas *eo_evas, void *font) | |||
235 | #ifdef HAVE_FONTCONFIG | 236 | #ifdef HAVE_FONTCONFIG |
236 | static Evas_Font_Set * | 237 | static Evas_Font_Set * |
237 | _evas_load_fontconfig(Evas_Font_Set *font, Evas *eo_evas, FcFontSet *set, int size, | 238 | _evas_load_fontconfig(Evas_Font_Set *font, Evas *eo_evas, FcFontSet *set, int size, |
238 | Font_Rend_Flags wanted_rend) | 239 | Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
239 | { | 240 | { |
240 | Evas_Public_Data *evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS); | 241 | Evas_Public_Data *evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS); |
241 | int i; | 242 | int i; |
@@ -248,9 +249,9 @@ _evas_load_fontconfig(Evas_Font_Set *font, Evas *eo_evas, FcFontSet *set, int si | |||
248 | FcPatternGet(set->fonts[i], FC_FILE, 0, &filename); | 249 | FcPatternGet(set->fonts[i], FC_FILE, 0, &filename); |
249 | 250 | ||
250 | if (font) | 251 | if (font) |
251 | evas->engine.func->font_add(_evas_engine_context(evas), font, (char *)filename.u.s, size, wanted_rend); | 252 | evas->engine.func->font_add(_evas_engine_context(evas), font, (char *)filename.u.s, size, wanted_rend, bitmap_scalable); |
252 | else | 253 | else |
253 | font = evas->engine.func->font_load(_evas_engine_context(evas), (char *)filename.u.s, size, wanted_rend); | 254 | font = evas->engine.func->font_load(_evas_engine_context(evas), (char *)filename.u.s, size, wanted_rend, bitmap_scalable); |
254 | } | 255 | } |
255 | 256 | ||
256 | return font; | 257 | return font; |
@@ -550,7 +551,7 @@ evas_font_name_parse(Evas_Font_Description *fdesc, const char *name) | |||
550 | } | 551 | } |
551 | 552 | ||
552 | void * | 553 | void * |
553 | evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size) | 554 | evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
554 | { | 555 | { |
555 | Evas_Public_Data *evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS); | 556 | Evas_Public_Data *evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS); |
556 | #ifdef HAVE_FONTCONFIG | 557 | #ifdef HAVE_FONTCONFIG |
@@ -585,8 +586,9 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
585 | if (((!source) && (!fd->source)) || | 586 | if (((!source) && (!fd->source)) || |
586 | ((source) && (fd->source) && (!strcmp(source, fd->source)))) | 587 | ((source) && (fd->source) && (!strcmp(source, fd->source)))) |
587 | { | 588 | { |
588 | if ((size == fd->size) && | 589 | if ((size == fd->size) && |
589 | (wanted_rend == fd->wanted_rend)) | 590 | (wanted_rend == fd->wanted_rend) && |
591 | (bitmap_scalable == fd->bitmap_scalable)) | ||
590 | { | 592 | { |
591 | fonts_cache = eina_list_promote_list(fonts_cache, l); | 593 | fonts_cache = eina_list_promote_list(fonts_cache, l); |
592 | fd->ref++; | 594 | fd->ref++; |
@@ -605,7 +607,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
605 | #ifdef HAVE_FONTCONFIG | 607 | #ifdef HAVE_FONTCONFIG |
606 | if (found_fd) | 608 | if (found_fd) |
607 | { | 609 | { |
608 | font = _evas_load_fontconfig(font, evas->evas, found_fd->set, size, wanted_rend); | 610 | font = _evas_load_fontconfig(font, evas->evas, found_fd->set, size, wanted_rend, bitmap_scalable); |
609 | goto on_find; | 611 | goto on_find; |
610 | } | 612 | } |
611 | #endif | 613 | #endif |
@@ -638,7 +640,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
638 | #ifdef HAVE_FONTCONFIG | 640 | #ifdef HAVE_FONTCONFIG |
639 | if (found_fd) | 641 | if (found_fd) |
640 | { | 642 | { |
641 | font = _evas_load_fontconfig(font, evas->evas, found_fd->set, size, wanted_rend); | 643 | font = _evas_load_fontconfig(font, evas->evas, found_fd->set, size, wanted_rend, bitmap_scalable); |
642 | goto on_find; | 644 | goto on_find; |
643 | } | 645 | } |
644 | #endif | 646 | #endif |
@@ -656,7 +658,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
656 | fake_name = evas_file_path_join(source, nm); | 658 | fake_name = evas_file_path_join(source, nm); |
657 | if (fake_name) | 659 | if (fake_name) |
658 | { | 660 | { |
659 | font = evas->engine.func->font_load(_evas_engine_context(evas), fake_name, size, wanted_rend); | 661 | font = evas->engine.func->font_load(_evas_engine_context(evas), fake_name, size, wanted_rend, bitmap_scalable); |
660 | if (!font) /* Load from fake name failed, probably not cached */ | 662 | if (!font) /* Load from fake name failed, probably not cached */ |
661 | { | 663 | { |
662 | /* read original!!! */ | 664 | /* read original!!! */ |
@@ -669,7 +671,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
669 | fdata = eet_read(ef, nm, &fsize); | 671 | fdata = eet_read(ef, nm, &fsize); |
670 | if (fdata) | 672 | if (fdata) |
671 | { | 673 | { |
672 | font = evas->engine.func->font_memory_load(_evas_engine_context(evas), source, nm, size, fdata, fsize, wanted_rend); | 674 | font = evas->engine.func->font_memory_load(_evas_engine_context(evas), source, nm, size, fdata, fsize, wanted_rend, bitmap_scalable); |
673 | free(fdata); | 675 | free(fdata); |
674 | } | 676 | } |
675 | eet_close(ef); | 677 | eet_close(ef); |
@@ -681,7 +683,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
681 | if (!font) /* Source load failed */ | 683 | if (!font) /* Source load failed */ |
682 | { | 684 | { |
683 | if (evas_file_path_is_full_path((char *)nm)) /* Try filename */ | 685 | if (evas_file_path_is_full_path((char *)nm)) /* Try filename */ |
684 | font = evas->engine.func->font_load(_evas_engine_context(evas), (char *)nm, size, wanted_rend); | 686 | font = evas->engine.func->font_load(_evas_engine_context(evas), (char *)nm, size, wanted_rend, bitmap_scalable); |
685 | else /* search font path */ | 687 | else /* search font path */ |
686 | { | 688 | { |
687 | Eina_List *ll; | 689 | Eina_List *ll; |
@@ -694,7 +696,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
694 | f_file = evas_font_dir_cache_find(dir, (char *)nm); | 696 | f_file = evas_font_dir_cache_find(dir, (char *)nm); |
695 | if (f_file) | 697 | if (f_file) |
696 | { | 698 | { |
697 | font = evas->engine.func->font_load(_evas_engine_context(evas), f_file, size, wanted_rend); | 699 | font = evas->engine.func->font_load(_evas_engine_context(evas), f_file, size, wanted_rend, bitmap_scalable); |
698 | if (font) break; | 700 | if (font) break; |
699 | } | 701 | } |
700 | } | 702 | } |
@@ -708,7 +710,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
708 | f_file = evas_font_dir_cache_find(dir, (char *)nm); | 710 | f_file = evas_font_dir_cache_find(dir, (char *)nm); |
709 | if (f_file) | 711 | if (f_file) |
710 | { | 712 | { |
711 | font = evas->engine.func->font_load(_evas_engine_context(evas), f_file, size, wanted_rend); | 713 | font = evas->engine.func->font_load(_evas_engine_context(evas), f_file, size, wanted_rend, bitmap_scalable); |
712 | if (font) break; | 714 | if (font) break; |
713 | } | 715 | } |
714 | } | 716 | } |
@@ -729,7 +731,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
729 | if (fake_name) | 731 | if (fake_name) |
730 | { | 732 | { |
731 | /* FIXME: make an engine func */ | 733 | /* FIXME: make an engine func */ |
732 | if (!evas->engine.func->font_add(_evas_engine_context(evas), font, fake_name, size, wanted_rend)) | 734 | if (!evas->engine.func->font_add(_evas_engine_context(evas), font, fake_name, size, wanted_rend, bitmap_scalable)) |
733 | { | 735 | { |
734 | /* read original!!! */ | 736 | /* read original!!! */ |
735 | ef = eet_open(source, EET_FILE_MODE_READ); | 737 | ef = eet_open(source, EET_FILE_MODE_READ); |
@@ -741,7 +743,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
741 | fdata = eet_read(ef, nm, &fsize); | 743 | fdata = eet_read(ef, nm, &fsize); |
742 | if ((fdata) && (fsize > 0)) | 744 | if ((fdata) && (fsize > 0)) |
743 | { | 745 | { |
744 | ok = evas->engine.func->font_memory_add(_evas_engine_context(evas), font, source, nm, size, fdata, fsize, wanted_rend); | 746 | ok = evas->engine.func->font_memory_add(_evas_engine_context(evas), font, source, nm, size, fdata, fsize, wanted_rend, bitmap_scalable); |
745 | } | 747 | } |
746 | eet_close(ef); | 748 | eet_close(ef); |
747 | free(fdata); | 749 | free(fdata); |
@@ -755,7 +757,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
755 | if (!ok) | 757 | if (!ok) |
756 | { | 758 | { |
757 | if (evas_file_path_is_full_path((char *)nm)) | 759 | if (evas_file_path_is_full_path((char *)nm)) |
758 | evas->engine.func->font_add(_evas_engine_context(evas), font, (char *)nm, size, wanted_rend); | 760 | evas->engine.func->font_add(_evas_engine_context(evas), font, (char *)nm, size, wanted_rend, bitmap_scalable); |
759 | else | 761 | else |
760 | { | 762 | { |
761 | Eina_List *ll; | 763 | Eina_List *ll; |
@@ -769,7 +771,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
769 | f_file = evas_font_dir_cache_find(dir, (char *)nm); | 771 | f_file = evas_font_dir_cache_find(dir, (char *)nm); |
770 | if (f_file) | 772 | if (f_file) |
771 | { | 773 | { |
772 | fn = (RGBA_Font *)evas->engine.func->font_add(_evas_engine_context(evas), font, f_file, size, wanted_rend); | 774 | fn = (RGBA_Font *)evas->engine.func->font_add(_evas_engine_context(evas), font, f_file, size, wanted_rend, bitmap_scalable); |
773 | if (fn) | 775 | if (fn) |
774 | break; | 776 | break; |
775 | } | 777 | } |
@@ -784,7 +786,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
784 | f_file = evas_font_dir_cache_find(dir, (char *)nm); | 786 | f_file = evas_font_dir_cache_find(dir, (char *)nm); |
785 | if (f_file) | 787 | if (f_file) |
786 | { | 788 | { |
787 | fn = (RGBA_Font *)evas->engine.func->font_add(_evas_engine_context(evas), font, f_file, size, wanted_rend); | 789 | fn = (RGBA_Font *)evas->engine.func->font_add(_evas_engine_context(evas), font, f_file, size, wanted_rend, bitmap_scalable); |
788 | if (fn) | 790 | if (fn) |
789 | break; | 791 | break; |
790 | } | 792 | } |
@@ -854,7 +856,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
854 | } | 856 | } |
855 | else | 857 | else |
856 | { | 858 | { |
857 | font = _evas_load_fontconfig(font, evas->evas, set, size, wanted_rend); | 859 | font = _evas_load_fontconfig(font, evas->evas, set, size, wanted_rend, bitmap_scalable); |
858 | } | 860 | } |
859 | } | 861 | } |
860 | else /* Add a fallback list from fontconfig according to the found font. */ | 862 | else /* Add a fallback list from fontconfig according to the found font. */ |
@@ -881,7 +883,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
881 | } | 883 | } |
882 | else | 884 | else |
883 | { | 885 | { |
884 | font = _evas_load_fontconfig(font, evas->evas, set, size, wanted_rend); | 886 | font = _evas_load_fontconfig(font, evas->evas, set, size, wanted_rend, bitmap_scalable); |
885 | } | 887 | } |
886 | } | 888 | } |
887 | #endif | 889 | #endif |
@@ -899,6 +901,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, | |||
899 | fd->font = font; | 901 | fd->font = font; |
900 | fd->wanted_rend = wanted_rend; | 902 | fd->wanted_rend = wanted_rend; |
901 | fd->size = size; | 903 | fd->size = size; |
904 | fd->bitmap_scalable = bitmap_scalable; | ||
902 | fd->ref = 1; | 905 | fd->ref = 1; |
903 | fonts_cache = eina_list_prepend(fonts_cache, fd); | 906 | fonts_cache = eina_list_prepend(fonts_cache, fd); |
904 | #ifdef HAVE_FONTCONFIG | 907 | #ifdef HAVE_FONTCONFIG |
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 6704bd3239..5108aad00e 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c | |||
@@ -48,6 +48,7 @@ struct _Evas_Text_Data | |||
48 | 48 | ||
49 | Evas_Font_Size size; | 49 | Evas_Font_Size size; |
50 | Evas_Text_Style_Type style; | 50 | Evas_Text_Style_Type style; |
51 | Efl_Text_Font_Bitmap_Scalable bitmap_scalable; | ||
51 | } cur, prev; | 52 | } cur, prev; |
52 | 53 | ||
53 | struct { | 54 | struct { |
@@ -417,44 +418,14 @@ _evas_text_efl_text_properties_font_source_get(Eo *eo_obj EINA_UNUSED, Evas_Text | |||
417 | return o->cur.source; | 418 | return o->cur.source; |
418 | } | 419 | } |
419 | 420 | ||
420 | EOLIAN static void | 421 | static void |
421 | _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const char *font, Evas_Font_Size size) | 422 | _evas_text_font_reload(Eo *eo_obj, Evas_Text_Data *o) |
422 | { | 423 | { |
423 | Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); | 424 | Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); |
424 | Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE; | 425 | Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE; |
425 | Eina_Bool source_invisible = EINA_FALSE; | 426 | Eina_Bool source_invisible = EINA_FALSE; |
426 | Evas_Font_Description *fdesc; | ||
427 | Eina_List *was = NULL; | 427 | Eina_List *was = NULL; |
428 | 428 | ||
429 | if ((!font) || (size <= 0)) return; | ||
430 | |||
431 | evas_object_async_block(obj); | ||
432 | if ((size == o->cur.size) && | ||
433 | (o->cur.font && !strcmp(font, o->cur.font))) return; | ||
434 | |||
435 | /* We can't assume the given font is same with current fdesc by comparing string. | ||
436 | Since Evas starts to supporting "auto" for language, | ||
437 | the given font string should be parsed once before comparing it. */ | ||
438 | fdesc = evas_font_desc_new(); | ||
439 | |||
440 | /* Set default language according to locale. */ | ||
441 | eina_stringshare_replace(&(fdesc->lang), evas_font_lang_normalize("auto")); | ||
442 | evas_font_name_parse(fdesc, font); | ||
443 | |||
444 | if (o->cur.fdesc && !evas_font_desc_cmp(fdesc, o->cur.fdesc) && | ||
445 | (size == o->cur.size)) | ||
446 | { | ||
447 | evas_font_desc_unref(fdesc); | ||
448 | return; | ||
449 | } | ||
450 | |||
451 | if (o->cur.fdesc) evas_font_desc_unref(o->cur.fdesc); | ||
452 | o->cur.fdesc = fdesc; | ||
453 | |||
454 | o->cur.size = size; | ||
455 | eina_stringshare_replace(&o->cur.font, font); | ||
456 | o->prev.font = NULL; | ||
457 | |||
458 | if (!(obj->layer->evas->is_frozen)) | 429 | if (!(obj->layer->evas->is_frozen)) |
459 | { | 430 | { |
460 | pass = evas_event_passes_through(eo_obj, obj); | 431 | pass = evas_event_passes_through(eo_obj, obj); |
@@ -473,7 +444,7 @@ _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const cha | |||
473 | } | 444 | } |
474 | 445 | ||
475 | o->font = evas_font_load(obj->layer->evas->evas, o->cur.fdesc, o->cur.source, | 446 | o->font = evas_font_load(obj->layer->evas->evas, o->cur.fdesc, o->cur.source, |
476 | (int)(((double) o->cur.size) * obj->cur->scale)); | 447 | (int)(((double) o->cur.size) * obj->cur->scale), o->cur.bitmap_scalable); |
477 | { | 448 | { |
478 | o->ascent = 0; | 449 | o->ascent = 0; |
479 | o->descent = 0; | 450 | o->descent = 0; |
@@ -495,6 +466,44 @@ _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const cha | |||
495 | } | 466 | } |
496 | 467 | ||
497 | EOLIAN static void | 468 | EOLIAN static void |
469 | _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const char *font, Evas_Font_Size size) | ||
470 | { | ||
471 | Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); | ||
472 | Evas_Font_Description *fdesc; | ||
473 | |||
474 | if ((!font) || (size <= 0)) return; | ||
475 | |||
476 | evas_object_async_block(obj); | ||
477 | if ((size == o->cur.size) && | ||
478 | (o->cur.font && !strcmp(font, o->cur.font))) return; | ||
479 | |||
480 | /* We can't assume the given font is same with current fdesc by comparing string. | ||
481 | Since Evas starts to supporting "auto" for language, | ||
482 | the given font string should be parsed once before comparing it. */ | ||
483 | fdesc = evas_font_desc_new(); | ||
484 | |||
485 | /* Set default language according to locale. */ | ||
486 | eina_stringshare_replace(&(fdesc->lang), evas_font_lang_normalize("auto")); | ||
487 | evas_font_name_parse(fdesc, font); | ||
488 | |||
489 | if (o->cur.fdesc && !evas_font_desc_cmp(fdesc, o->cur.fdesc) && | ||
490 | (size == o->cur.size)) | ||
491 | { | ||
492 | evas_font_desc_unref(fdesc); | ||
493 | return; | ||
494 | } | ||
495 | |||
496 | if (o->cur.fdesc) evas_font_desc_unref(o->cur.fdesc); | ||
497 | o->cur.fdesc = fdesc; | ||
498 | |||
499 | o->cur.size = size; | ||
500 | eina_stringshare_replace(&o->cur.font, font); | ||
501 | o->prev.font = NULL; | ||
502 | |||
503 | _evas_text_font_reload(eo_obj, o); | ||
504 | } | ||
505 | |||
506 | EOLIAN static void | ||
498 | _evas_text_efl_text_properties_font_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, const char **font, Evas_Font_Size *size) | 507 | _evas_text_efl_text_properties_font_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o, const char **font, Evas_Font_Size *size) |
499 | { | 508 | { |
500 | if (font) *font = o->cur.font; | 509 | if (font) *font = o->cur.font; |
@@ -1618,6 +1627,7 @@ evas_object_text_init(Evas_Object *eo_obj) | |||
1618 | Evas_Text_Data *o = obj->private_data; | 1627 | Evas_Text_Data *o = obj->private_data; |
1619 | /* alloc obj private data */ | 1628 | /* alloc obj private data */ |
1620 | o->prev.ellipsis = o->cur.ellipsis = -1.0; | 1629 | o->prev.ellipsis = o->cur.ellipsis = -1.0; |
1630 | o->prev.bitmap_scalable = o->cur.bitmap_scalable = EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR; | ||
1621 | o->prev = o->cur; | 1631 | o->prev = o->cur; |
1622 | #ifdef BIDI_SUPPORT | 1632 | #ifdef BIDI_SUPPORT |
1623 | o->bidi_par_props = evas_bidi_paragraph_props_new(); | 1633 | o->bidi_par_props = evas_bidi_paragraph_props_new(); |
@@ -2442,6 +2452,21 @@ _evas_text_efl_canvas_object_paragraph_direction_get(Eo *eo_obj EINA_UNUSED, | |||
2442 | return o->paragraph_direction; | 2452 | return o->paragraph_direction; |
2443 | } | 2453 | } |
2444 | 2454 | ||
2455 | EOLIAN static void | ||
2456 | _evas_text_efl_text_font_font_bitmap_scalable_set(Eo *eo_obj, Evas_Text_Data *o, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) | ||
2457 | { | ||
2458 | if (o->cur.bitmap_scalable == bitmap_scalable) return; | ||
2459 | o->prev.bitmap_scalable = o->cur.bitmap_scalable; | ||
2460 | o->cur.bitmap_scalable = bitmap_scalable; | ||
2461 | _evas_text_font_reload(eo_obj, o); | ||
2462 | } | ||
2463 | |||
2464 | EOLIAN static Efl_Text_Font_Bitmap_Scalable | ||
2465 | _evas_text_efl_text_font_font_bitmap_scalable_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o) | ||
2466 | { | ||
2467 | return o->cur.bitmap_scalable; | ||
2468 | } | ||
2469 | |||
2445 | #define EVAS_TEXT_EXTRA_OPS \ | 2470 | #define EVAS_TEXT_EXTRA_OPS \ |
2446 | EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _evas_text_efl_object_dbg_info_get) | 2471 | EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _evas_text_efl_object_dbg_info_get) |
2447 | 2472 | ||
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index ac39ea65d6..c804522f21 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c | |||
@@ -512,6 +512,7 @@ struct _Evas_Object_Textblock_Format | |||
512 | const char *source; /**< Pointer to object from which to search for the font. */ | 512 | const char *source; /**< Pointer to object from which to search for the font. */ |
513 | Evas_Font_Set *font; /**< Pointer to font set. */ | 513 | Evas_Font_Set *font; /**< Pointer to font set. */ |
514 | Evas_Font_Size size; /**< Size of the font. */ | 514 | Evas_Font_Size size; /**< Size of the font. */ |
515 | Efl_Text_Font_Bitmap_Scalable bitmap_scalable; /**< Scalable for bitmap font. */ | ||
515 | } font; | 516 | } font; |
516 | struct { | 517 | struct { |
517 | struct { | 518 | struct { |
@@ -629,6 +630,7 @@ struct _Evas_Object_Textblock | |||
629 | Efl_Text_Style_Effect_Type effect; | 630 | Efl_Text_Style_Effect_Type effect; |
630 | Efl_Text_Style_Shadow_Direction shadow_direction; | 631 | Efl_Text_Style_Shadow_Direction shadow_direction; |
631 | Efl_Text_Format_Wrap wrap; | 632 | Efl_Text_Format_Wrap wrap; |
633 | Efl_Text_Font_Bitmap_Scalable bitmap_scalable; | ||
632 | } info; | 634 | } info; |
633 | } default_format; | 635 | } default_format; |
634 | double valign; | 636 | double valign; |
@@ -2826,7 +2828,7 @@ _format_dup(Evas_Object *eo_obj, const Evas_Object_Textblock_Format *fmt) | |||
2826 | 2828 | ||
2827 | /* FIXME: just ref the font here... */ | 2829 | /* FIXME: just ref the font here... */ |
2828 | fmt2->font.font = evas_font_load(obj->layer->evas->evas, fmt2->font.fdesc, | 2830 | fmt2->font.font = evas_font_load(obj->layer->evas->evas, fmt2->font.fdesc, |
2829 | fmt2->font.source, (int)(((double) fmt2->font.size) * obj->cur->scale)); | 2831 | fmt2->font.source, (int)(((double) fmt2->font.size) * obj->cur->scale), fmt2->font.bitmap_scalable); |
2830 | 2832 | ||
2831 | if (fmt->gfx_filter) | 2833 | if (fmt->gfx_filter) |
2832 | { | 2834 | { |
@@ -3365,6 +3367,7 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt, | |||
3365 | c->format_stack = eina_list_prepend(c->format_stack, fmt); | 3367 | c->format_stack = eina_list_prepend(c->format_stack, fmt); |
3366 | *fmt = c->o->default_format.format; | 3368 | *fmt = c->o->default_format.format; |
3367 | fmt->ref = 1; | 3369 | fmt->ref = 1; |
3370 | fmt->font.bitmap_scalable = _FMT_INFO(bitmap_scalable); | ||
3368 | 3371 | ||
3369 | // Apply font if specified | 3372 | // Apply font if specified |
3370 | if (_FMT_INFO(font)) | 3373 | if (_FMT_INFO(font)) |
@@ -3389,7 +3392,7 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt, | |||
3389 | fmt->font.fdesc->width = _FMT_INFO(font_width); | 3392 | fmt->font.fdesc->width = _FMT_INFO(font_width); |
3390 | fmt->font.fdesc->lang = _FMT_INFO(font_lang); | 3393 | fmt->font.fdesc->lang = _FMT_INFO(font_lang); |
3391 | fmt->font.font = evas_font_load(evas_obj->layer->evas->evas, fmt->font.fdesc, | 3394 | fmt->font.font = evas_font_load(evas_obj->layer->evas->evas, fmt->font.fdesc, |
3392 | fmt->font.source, (int)(((double) _FMT_INFO(size)) * evas_obj->cur->scale)); | 3395 | fmt->font.source, (int)(((double) _FMT_INFO(size)) * evas_obj->cur->scale), fmt->font.bitmap_scalable); |
3393 | } | 3396 | } |
3394 | if (_FMT_INFO(gfx_filter_name)) | 3397 | if (_FMT_INFO(gfx_filter_name)) |
3395 | { | 3398 | { |
@@ -4490,7 +4493,7 @@ _format_finalize(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt) | |||
4490 | of = fmt->font.font; | 4493 | of = fmt->font.font; |
4491 | 4494 | ||
4492 | fmt->font.font = evas_font_load(obj->layer->evas->evas, fmt->font.fdesc, | 4495 | fmt->font.font = evas_font_load(obj->layer->evas->evas, fmt->font.fdesc, |
4493 | fmt->font.source, (int)(((double) fmt->font.size) * obj->cur->scale)); | 4496 | fmt->font.source, (int)(((double) fmt->font.size) * obj->cur->scale), fmt->font.bitmap_scalable); |
4494 | if (of) evas_font_free(obj->layer->evas->evas, of); | 4497 | if (of) evas_font_free(obj->layer->evas->evas, of); |
4495 | } | 4498 | } |
4496 | 4499 | ||
@@ -6760,6 +6763,7 @@ _efl_canvas_text_efl_object_constructor(Eo *eo_obj, Efl_Canvas_Text_Data *class_ | |||
6760 | _FMT(linerelgap) = 0.0; | 6763 | _FMT(linerelgap) = 0.0; |
6761 | _FMT(password) = 1; | 6764 | _FMT(password) = 1; |
6762 | _FMT(ellipsis) = -1; | 6765 | _FMT(ellipsis) = -1; |
6766 | _FMT_INFO(bitmap_scalable) = EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR; | ||
6763 | 6767 | ||
6764 | return eo_obj; | 6768 | return eo_obj; |
6765 | } | 6769 | } |
@@ -15159,6 +15163,20 @@ _efl_canvas_text_efl_text_font_font_width_get(Eo *obj EINA_UNUSED, Efl_Canvas_Te | |||
15159 | return _FMT_INFO(font_width); | 15163 | return _FMT_INFO(font_width); |
15160 | } | 15164 | } |
15161 | 15165 | ||
15166 | EOLIAN static void | ||
15167 | _efl_canvas_text_efl_text_font_font_bitmap_scalable_set(Eo *obj, Efl_Canvas_Text_Data *o, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) | ||
15168 | { | ||
15169 | if (_FMT_INFO(bitmap_scalable) == bitmap_scalable) return; | ||
15170 | _FMT_INFO(bitmap_scalable) = bitmap_scalable; | ||
15171 | _canvas_text_format_changed(obj, o); | ||
15172 | } | ||
15173 | |||
15174 | EOLIAN static Efl_Text_Font_Bitmap_Scalable | ||
15175 | _efl_canvas_text_efl_text_font_font_bitmap_scalable_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o) | ||
15176 | { | ||
15177 | return _FMT_INFO(bitmap_scalable); | ||
15178 | } | ||
15179 | |||
15162 | /* Efl.Text.Style interface implementation */ | 15180 | /* Efl.Text.Style interface implementation */ |
15163 | 15181 | ||
15164 | /* Helper: sets color fields of style 'x' and informs if any are changed. */ | 15182 | /* Helper: sets color fields of style 'x' and informs if any are changed. */ |
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c index 1a24086d3e..7f6dc76eb6 100644 --- a/src/lib/evas/canvas/evas_object_textgrid.c +++ b/src/lib/evas/canvas/evas_object_textgrid.c | |||
@@ -36,6 +36,7 @@ struct _Evas_Textgrid_Data | |||
36 | 36 | ||
37 | Eina_Array palette_standard; | 37 | Eina_Array palette_standard; |
38 | Eina_Array palette_extended; | 38 | Eina_Array palette_extended; |
39 | Efl_Text_Font_Bitmap_Scalable bitmap_scalable; | ||
39 | } cur, prev; | 40 | } cur, prev; |
40 | 41 | ||
41 | int ascent; | 42 | int ascent; |
@@ -156,6 +157,7 @@ evas_object_textgrid_init(Evas_Object *eo_obj) | |||
156 | 157 | ||
157 | Evas_Textgrid_Data *o = obj->private_data; | 158 | Evas_Textgrid_Data *o = obj->private_data; |
158 | o->magic = MAGIC_OBJ_TEXTGRID; | 159 | o->magic = MAGIC_OBJ_TEXTGRID; |
160 | o->prev.bitmap_scalable = o->cur.bitmap_scalable = EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR; | ||
159 | o->prev = o->cur; | 161 | o->prev = o->cur; |
160 | eina_array_step_set(&o->cur.palette_standard, sizeof (Eina_Array), 16); | 162 | eina_array_step_set(&o->cur.palette_standard, sizeof (Eina_Array), 16); |
161 | eina_array_step_set(&o->cur.palette_extended, sizeof (Eina_Array), 16); | 163 | eina_array_step_set(&o->cur.palette_extended, sizeof (Eina_Array), 16); |
@@ -1005,7 +1007,8 @@ _alternate_font_weight_slant(Evas_Object_Protected_Data *obj, | |||
1005 | fdesc, | 1007 | fdesc, |
1006 | o->cur.font_source, | 1008 | o->cur.font_source, |
1007 | (int)(((double) o->cur.font_size) * | 1009 | (int)(((double) o->cur.font_size) * |
1008 | obj->cur->scale)); | 1010 | obj->cur->scale), |
1011 | o->cur.bitmap_scalable); | ||
1009 | if (font) | 1012 | if (font) |
1010 | { | 1013 | { |
1011 | Eina_Unicode W[2] = { 'O', 0 }; | 1014 | Eina_Unicode W[2] = { 'O', 0 }; |
@@ -1054,11 +1057,8 @@ _alternate_font_weight_slant(Evas_Object_Protected_Data *obj, | |||
1054 | return ret; | 1057 | return ret; |
1055 | } | 1058 | } |
1056 | 1059 | ||
1057 | EOLIAN static void | 1060 | static void |
1058 | _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj, | 1061 | _evas_textgrid_font_reload(Eo *eo_obj, Evas_Textgrid_Data *o) |
1059 | Evas_Textgrid_Data *o, | ||
1060 | const char *font_name, | ||
1061 | Evas_Font_Size font_size) | ||
1062 | { | 1062 | { |
1063 | Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); | 1063 | Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); |
1064 | Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE; | 1064 | Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE; |
@@ -1066,30 +1066,7 @@ _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj, | |||
1066 | Evas_Font_Description *fdesc; | 1066 | Evas_Font_Description *fdesc; |
1067 | Eina_List *was = NULL; | 1067 | Eina_List *was = NULL; |
1068 | 1068 | ||
1069 | if ((!font_name) || (!*font_name) || (font_size <= 0)) | 1069 | fdesc = o->cur.font_description_normal; |
1070 | return; | ||
1071 | |||
1072 | evas_object_async_block(obj); | ||
1073 | fdesc = evas_font_desc_new(); | ||
1074 | /* Set default language according to locale. */ | ||
1075 | eina_stringshare_replace(&(fdesc->lang), | ||
1076 | evas_font_lang_normalize("auto")); | ||
1077 | evas_font_name_parse(fdesc, font_name); | ||
1078 | if (o->cur.font_description_normal && | ||
1079 | !evas_font_desc_cmp(fdesc, o->cur.font_description_normal) && | ||
1080 | (font_size == o->cur.font_size)) | ||
1081 | { | ||
1082 | evas_font_desc_unref(fdesc); | ||
1083 | return; | ||
1084 | } | ||
1085 | |||
1086 | if (o->cur.font_description_normal) | ||
1087 | evas_font_desc_unref(o->cur.font_description_normal); | ||
1088 | o->cur.font_description_normal = fdesc; | ||
1089 | |||
1090 | o->cur.font_size = font_size; | ||
1091 | eina_stringshare_replace(&o->cur.font_name, font_name); | ||
1092 | o->prev.font_name = NULL; | ||
1093 | 1070 | ||
1094 | if (!(obj->layer->evas->is_frozen)) | 1071 | if (!(obj->layer->evas->is_frozen)) |
1095 | { | 1072 | { |
@@ -1111,7 +1088,8 @@ _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj, | |||
1111 | o->cur.font_description_normal, | 1088 | o->cur.font_description_normal, |
1112 | o->cur.font_source, | 1089 | o->cur.font_source, |
1113 | (int)(((double) o->cur.font_size) * | 1090 | (int)(((double) o->cur.font_size) * |
1114 | obj->cur->scale)); | 1091 | obj->cur->scale), |
1092 | o->cur.bitmap_scalable); | ||
1115 | if (o->font_normal) | 1093 | if (o->font_normal) |
1116 | { | 1094 | { |
1117 | Eina_Unicode W[2] = { 'O', 0 }; | 1095 | Eina_Unicode W[2] = { 'O', 0 }; |
@@ -1245,6 +1223,43 @@ _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj, | |||
1245 | } | 1223 | } |
1246 | 1224 | ||
1247 | EOLIAN static void | 1225 | EOLIAN static void |
1226 | _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj, | ||
1227 | Evas_Textgrid_Data *o, | ||
1228 | const char *font_name, | ||
1229 | Evas_Font_Size font_size) | ||
1230 | { | ||
1231 | Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); | ||
1232 | Evas_Font_Description *fdesc; | ||
1233 | |||
1234 | if ((!font_name) || (!*font_name) || (font_size <= 0)) | ||
1235 | return; | ||
1236 | |||
1237 | evas_object_async_block(obj); | ||
1238 | fdesc = evas_font_desc_new(); | ||
1239 | /* Set default language according to locale. */ | ||
1240 | eina_stringshare_replace(&(fdesc->lang), | ||
1241 | evas_font_lang_normalize("auto")); | ||
1242 | evas_font_name_parse(fdesc, font_name); | ||
1243 | if (o->cur.font_description_normal && | ||
1244 | !evas_font_desc_cmp(fdesc, o->cur.font_description_normal) && | ||
1245 | (font_size == o->cur.font_size)) | ||
1246 | { | ||
1247 | evas_font_desc_unref(fdesc); | ||
1248 | return; | ||
1249 | } | ||
1250 | |||
1251 | if (o->cur.font_description_normal) | ||
1252 | evas_font_desc_unref(o->cur.font_description_normal); | ||
1253 | o->cur.font_description_normal = fdesc; | ||
1254 | |||
1255 | o->cur.font_size = font_size; | ||
1256 | eina_stringshare_replace(&o->cur.font_name, font_name); | ||
1257 | o->prev.font_name = NULL; | ||
1258 | |||
1259 | _evas_textgrid_font_reload(eo_obj, o); | ||
1260 | } | ||
1261 | |||
1262 | EOLIAN static void | ||
1248 | _evas_textgrid_efl_text_properties_font_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, const char **font_name, Evas_Font_Size *font_size) | 1263 | _evas_textgrid_efl_text_properties_font_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o, const char **font_name, Evas_Font_Size *font_size) |
1249 | { | 1264 | { |
1250 | if (font_name) *font_name = o->cur.font_name; | 1265 | if (font_name) *font_name = o->cur.font_name; |
@@ -1500,6 +1515,21 @@ evas_object_textgrid_font_get(const Eo *obj, const char **font_name, Evas_Font_S | |||
1500 | efl_text_properties_font_get((Eo *) obj, font_name, font_size); | 1515 | efl_text_properties_font_get((Eo *) obj, font_name, font_size); |
1501 | } | 1516 | } |
1502 | 1517 | ||
1518 | EOLIAN static void | ||
1519 | _evas_textgrid_efl_text_font_font_bitmap_scalable_set(Eo *eo_obj, Evas_Textgrid_Data *o, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) | ||
1520 | { | ||
1521 | if (o->cur.bitmap_scalable == bitmap_scalable) return; | ||
1522 | o->prev.bitmap_scalable = o->cur.bitmap_scalable; | ||
1523 | o->cur.bitmap_scalable = bitmap_scalable; | ||
1524 | _evas_textgrid_font_reload(eo_obj, o); | ||
1525 | } | ||
1526 | |||
1527 | EOLIAN static Efl_Text_Font_Bitmap_Scalable | ||
1528 | _evas_textgrid_efl_text_font_font_bitmap_scalable_get(Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o) | ||
1529 | { | ||
1530 | return o->cur.bitmap_scalable; | ||
1531 | } | ||
1532 | |||
1503 | #define EVAS_TEXTGRID_EXTRA_OPS \ | 1533 | #define EVAS_TEXTGRID_EXTRA_OPS \ |
1504 | EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _evas_textgrid_efl_object_dbg_info_get) | 1534 | EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _evas_textgrid_efl_object_dbg_info_get) |
1505 | 1535 | ||
diff --git a/src/lib/evas/canvas/evas_text.eo b/src/lib/evas/canvas/evas_text.eo index 017d5b34ca..68623a672e 100644 --- a/src/lib/evas/canvas/evas_text.eo +++ b/src/lib/evas/canvas/evas_text.eo | |||
@@ -1,6 +1,6 @@ | |||
1 | type @extern Evas.Text_Style_Type : __undefined_type; [[External text style type]] | 1 | type @extern Evas.Text_Style_Type : __undefined_type; [[External text style type]] |
2 | 2 | ||
3 | class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Canvas.Filter.Internal) | 3 | class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Text.Font, Efl.Canvas.Filter.Internal) |
4 | { | 4 | { |
5 | [[Evas text class]] | 5 | [[Evas text class]] |
6 | legacy_prefix: evas_object_text; | 6 | legacy_prefix: evas_object_text; |
@@ -274,6 +274,7 @@ class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Canvas.Fi | |||
274 | Efl.Text.text { get; set; } | 274 | Efl.Text.text { get; set; } |
275 | Efl.Text.Properties.font { get; set; } | 275 | Efl.Text.Properties.font { get; set; } |
276 | Efl.Text.Properties.font_source { get; set; } | 276 | Efl.Text.Properties.font_source { get; set; } |
277 | Efl.Text.Font.font_bitmap_scalable { get; set; } | ||
277 | Efl.Gfx.Filter.filter_program { set; } | 278 | Efl.Gfx.Filter.filter_program { set; } |
278 | Efl.Canvas.Filter.Internal.filter_dirty; | 279 | Efl.Canvas.Filter.Internal.filter_dirty; |
279 | Efl.Canvas.Filter.Internal.filter_input_alpha; | 280 | Efl.Canvas.Filter.Internal.filter_input_alpha; |
diff --git a/src/lib/evas/canvas/evas_textgrid.eo b/src/lib/evas/canvas/evas_textgrid.eo index 2dd3966f2d..369068862b 100644 --- a/src/lib/evas/canvas/evas_textgrid.eo +++ b/src/lib/evas/canvas/evas_textgrid.eo | |||
@@ -20,7 +20,7 @@ enum Evas.Textgrid.Font_Style { | |||
20 | /* XXX: Actual definition is in C. */ | 20 | /* XXX: Actual definition is in C. */ |
21 | struct Evas.Textgrid.Cell; [[Evas textgrid cell data structure]] | 21 | struct Evas.Textgrid.Cell; [[Evas textgrid cell data structure]] |
22 | 22 | ||
23 | class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties) | 23 | class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font) |
24 | { | 24 | { |
25 | [[Evas textgrid class]] | 25 | [[Evas textgrid class]] |
26 | legacy_prefix: evas_object_textgrid; | 26 | legacy_prefix: evas_object_textgrid; |
@@ -200,5 +200,6 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties) | |||
200 | Efl.Object.destructor; | 200 | Efl.Object.destructor; |
201 | Efl.Text.Properties.font { get; set; } | 201 | Efl.Text.Properties.font { get; set; } |
202 | Efl.Text.Properties.font_source { get; set; } | 202 | Efl.Text.Properties.font_source { get; set; } |
203 | Efl.Text.Font.font_bitmap_scalable { get; set; } | ||
203 | } | 204 | } |
204 | } | 205 | } |
diff --git a/src/lib/evas/common/evas_draw.h b/src/lib/evas/common/evas_draw.h index 28b7c9429f..e045a186ce 100644 --- a/src/lib/evas/common/evas_draw.h +++ b/src/lib/evas/common/evas_draw.h | |||
@@ -11,7 +11,7 @@ EAPI void evas_common_draw_context_font_ext_set (RGBA_D | |||
11 | void *data, | 11 | void *data, |
12 | void *(*gl_new) (void *data, RGBA_Font_Glyph *fg), | 12 | void *(*gl_new) (void *data, RGBA_Font_Glyph *fg), |
13 | void (*gl_free) (void *ext_dat), | 13 | void (*gl_free) (void *ext_dat), |
14 | void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y), | 14 | void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y, int w, int h), |
15 | void *(*gl_image_new) (void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace), | 15 | void *(*gl_image_new) (void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace), |
16 | void (*gl_image_free) (void *image), | 16 | void (*gl_image_free) (void *image), |
17 | void (*gl_image_draw) (void *gc, void *im, int dx, int dy, int dw, int dh, int smooth)); | 17 | void (*gl_image_draw) (void *gc, void *im, int dx, int dy, int dw, int dh, int smooth)); |
diff --git a/src/lib/evas/common/evas_draw_main.c b/src/lib/evas/common/evas_draw_main.c index d6b0a8942b..2f3fa949de 100644 --- a/src/lib/evas/common/evas_draw_main.c +++ b/src/lib/evas/common/evas_draw_main.c | |||
@@ -215,7 +215,7 @@ evas_common_draw_context_font_ext_set(RGBA_Draw_Context *dc, | |||
215 | void *data, | 215 | void *data, |
216 | void *(*gl_new) (void *data, RGBA_Font_Glyph *fg), | 216 | void *(*gl_new) (void *data, RGBA_Font_Glyph *fg), |
217 | void (*gl_free) (void *ext_dat), | 217 | void (*gl_free) (void *ext_dat), |
218 | void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y), | 218 | void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y, int w, int h), |
219 | void *(*gl_image_new) (void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace), | 219 | void *(*gl_image_new) (void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace), |
220 | void (*gl_image_free) (void *image), | 220 | void (*gl_image_free) (void *image), |
221 | void (*gl_image_draw) (void *gc, void *im, int dx, int dy, int dw, int dh, int smooth)) | 221 | void (*gl_image_draw) (void *gc, void *im, int dx, int dy, int dw, int dh, int smooth)) |
diff --git a/src/lib/evas/common/evas_font.h b/src/lib/evas/common/evas_font.h index f9f8026c85..b50b68d530 100644 --- a/src/lib/evas/common/evas_font.h +++ b/src/lib/evas/common/evas_font.h | |||
@@ -46,27 +46,27 @@ EAPI int evas_common_font_source_load_complete (RGBA_Font_Source * | |||
46 | EAPI RGBA_Font_Source *evas_common_font_source_find (const char *name); | 46 | EAPI RGBA_Font_Source *evas_common_font_source_find (const char *name); |
47 | EAPI void evas_common_font_source_free (RGBA_Font_Source *fs); | 47 | EAPI void evas_common_font_source_free (RGBA_Font_Source *fs); |
48 | EAPI void evas_common_font_size_use (RGBA_Font *fn); | 48 | EAPI void evas_common_font_size_use (RGBA_Font *fn); |
49 | EAPI RGBA_Font_Int *evas_common_font_int_load (const char *name, int size, Font_Rend_Flags wanted_rend); | 49 | EAPI RGBA_Font_Int *evas_common_font_int_load (const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
50 | EAPI RGBA_Font_Int *evas_common_font_int_load_init (RGBA_Font_Int *fn); | 50 | EAPI RGBA_Font_Int *evas_common_font_int_load_init (RGBA_Font_Int *fn); |
51 | EAPI RGBA_Font_Int *evas_common_font_int_load_complete (RGBA_Font_Int *fi); | 51 | EAPI RGBA_Font_Int *evas_common_font_int_load_complete (RGBA_Font_Int *fi); |
52 | EAPI RGBA_Font *evas_common_font_memory_load (const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend); | 52 | EAPI RGBA_Font *evas_common_font_memory_load (const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
53 | EAPI RGBA_Font *evas_common_font_load (const char *name, int size, Font_Rend_Flags wanted_rend); | 53 | EAPI RGBA_Font *evas_common_font_load (const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
54 | EAPI RGBA_Font *evas_common_font_add (RGBA_Font *fn, const char *name, int size, Font_Rend_Flags wanted_rend); | 54 | EAPI RGBA_Font *evas_common_font_add (RGBA_Font *fn, const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
55 | EAPI RGBA_Font *evas_common_font_memory_add (RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend); | 55 | EAPI RGBA_Font *evas_common_font_memory_add (RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
56 | EAPI void evas_common_font_free (RGBA_Font *fn); | 56 | EAPI void evas_common_font_free (RGBA_Font *fn); |
57 | EAPI void evas_common_font_int_unref (RGBA_Font_Int *fi); | 57 | EAPI void evas_common_font_int_unref (RGBA_Font_Int *fi); |
58 | EAPI void evas_common_font_hinting_set (RGBA_Font *fn, Font_Hint_Flags hinting); | 58 | EAPI void evas_common_font_hinting_set (RGBA_Font *fn, Font_Hint_Flags hinting); |
59 | EAPI Eina_Bool evas_common_hinting_available (Font_Hint_Flags hinting); | 59 | EAPI Eina_Bool evas_common_hinting_available (Font_Hint_Flags hinting); |
60 | EAPI RGBA_Font *evas_common_font_memory_hinting_load (const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend); | 60 | EAPI RGBA_Font *evas_common_font_memory_hinting_load (const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
61 | EAPI RGBA_Font *evas_common_font_hinting_load (const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend); | 61 | EAPI RGBA_Font *evas_common_font_hinting_load (const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
62 | EAPI RGBA_Font *evas_common_font_hinting_add (RGBA_Font *fn, const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend); | 62 | EAPI RGBA_Font *evas_common_font_hinting_add (RGBA_Font *fn, const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
63 | EAPI RGBA_Font *evas_common_font_memory_hinting_add (RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend); | 63 | EAPI RGBA_Font *evas_common_font_memory_hinting_add (RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
64 | EAPI void evas_common_font_int_modify_cache_by (RGBA_Font_Int *fi, int dir); | 64 | EAPI void evas_common_font_int_modify_cache_by (RGBA_Font_Int *fi, int dir); |
65 | EAPI int evas_common_font_cache_get (void); | 65 | EAPI int evas_common_font_cache_get (void); |
66 | EAPI void evas_common_font_cache_set (int size); | 66 | EAPI void evas_common_font_cache_set (int size); |
67 | EAPI void evas_common_font_flush (void); | 67 | EAPI void evas_common_font_flush (void); |
68 | EAPI void evas_common_font_flush_last (void); | 68 | EAPI void evas_common_font_flush_last (void); |
69 | EAPI RGBA_Font_Int *evas_common_font_int_find (const char *name, int size, Font_Rend_Flags wanted_rend); | 69 | EAPI RGBA_Font_Int *evas_common_font_int_find (const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
70 | EAPI void evas_common_font_all_clear (void); | 70 | EAPI void evas_common_font_all_clear (void); |
71 | EAPI void evas_common_font_ext_clear (void); | 71 | EAPI void evas_common_font_ext_clear (void); |
72 | 72 | ||
@@ -85,7 +85,7 @@ EAPI int evas_common_font_query_run_font_end_get(RGBA_Font *fn, RG | |||
85 | EAPI void evas_common_font_ascent_descent_get(RGBA_Font *fn, const Evas_Text_Props *text_props, int *ascent, int *descent); | 85 | EAPI void evas_common_font_ascent_descent_get(RGBA_Font *fn, const Evas_Text_Props *text_props, int *ascent, int *descent); |
86 | 86 | ||
87 | EAPI void *evas_common_font_glyph_compress(void *data, int num_grays, int pixel_mode, int pitch_data, int w, int h, int *size_ret); | 87 | EAPI void *evas_common_font_glyph_compress(void *data, int num_grays, int pixel_mode, int pitch_data, int w, int h, int *size_ret); |
88 | EAPI void evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, RGBA_Draw_Context *dc, RGBA_Image *dst, int dst_pitch, int x, int y, int cx, int cy, int cw, int ch); | 88 | EAPI void evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, RGBA_Draw_Context *dc, RGBA_Image *dst, int dst_pitch, int dx, int dy, int dw, int dh, int cx, int cy, int cw, int ch); |
89 | EAPI DATA8 *evas_common_font_glyph_uncompress(RGBA_Font_Glyph *fg, int *wret, int *hret); | 89 | EAPI DATA8 *evas_common_font_glyph_uncompress(RGBA_Font_Glyph *fg, int *wret, int *hret); |
90 | 90 | ||
91 | void evas_common_font_load_init(void); | 91 | void evas_common_font_load_init(void); |
diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 3a0e90c64f..5e7658caf8 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c | |||
@@ -482,14 +482,19 @@ EAPI void | |||
482 | evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, | 482 | evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, |
483 | RGBA_Draw_Context *dc, | 483 | RGBA_Draw_Context *dc, |
484 | RGBA_Image *dst_image, int dst_pitch, | 484 | RGBA_Image *dst_image, int dst_pitch, |
485 | int x, int y, int cx, int cy, int cw, int ch) | 485 | int dx, int dy, int dw, int dh, int cx, int cy, int cw, int ch) |
486 | { | 486 | { |
487 | RGBA_Font_Glyph_Out *fgo = fg->glyph_out; | 487 | RGBA_Font_Glyph_Out *fgo = fg->glyph_out; |
488 | int w, h, x1, x2, y1, y2, i, *iptr; | 488 | int x, y, w, h, x1, x2, y1, y2, i, *iptr; |
489 | DATA32 *dst = dst_image->image.data; | 489 | DATA32 *dst = dst_image->image.data; |
490 | DATA32 coltab[16], col; | 490 | DATA32 coltab[16], col; |
491 | DATA16 mtab[16], v; | 491 | DATA16 mtab[16], v; |
492 | 492 | ||
493 | // FIXME: Use dw, dh for scaling glyphs... | ||
494 | (void) dw; | ||
495 | (void) dh; | ||
496 | x = dx; | ||
497 | y = dy; | ||
493 | w = fgo->bitmap.width; h = fgo->bitmap.rows; | 498 | w = fgo->bitmap.width; h = fgo->bitmap.rows; |
494 | // skip if totally clipped out | 499 | // skip if totally clipped out |
495 | if ((y >= (cy + ch)) || ((y + h) <= cy) || | 500 | if ((y >= (cy + ch)) || ((y + h) <= cy) || |
@@ -582,7 +587,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, | |||
582 | 587 | ||
583 | ptr = dst + (x + x1) + ((y + row) * dst_pitch); | 588 | ptr = dst + (x + x1) + ((y + row) * dst_pitch); |
584 | buf_ptr = buf + (row * w) + x1; | 589 | buf_ptr = buf + (row * w) + x1; |
585 | func(buf_ptr, mask, 0, ptr, x2 - x1); | 590 | func(buf_ptr, mask, 0, ptr, w); |
586 | } | 591 | } |
587 | } | 592 | } |
588 | else | 593 | else |
diff --git a/src/lib/evas/common/evas_font_draw.c b/src/lib/evas/common/evas_font_draw.c index f7fcb13bd8..4bdecddafe 100644 --- a/src/lib/evas/common/evas_font_draw.c +++ b/src/lib/evas/common/evas_font_draw.c | |||
@@ -24,16 +24,25 @@ evas_common_font_draw_init(void) | |||
24 | } | 24 | } |
25 | 25 | ||
26 | static void * | 26 | static void * |
27 | _evas_font_image_new_from_data(int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace) | 27 | _evas_font_image_new(RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace) |
28 | { | 28 | { |
29 | DATA32 *image_data; | ||
30 | int src_w, src_h; | ||
31 | |||
32 | if (!fg) return NULL; | ||
33 | |||
34 | image_data = (DATA32 *)fg->glyph_out->bitmap.buffer; | ||
35 | src_w = fg->glyph_out->bitmap.width; | ||
36 | src_h = fg->glyph_out->bitmap.rows; | ||
37 | |||
29 | #ifdef EVAS_CSERVE2 | 38 | #ifdef EVAS_CSERVE2 |
30 | if (evas_cserve2_use_get()) | 39 | if (evas_cserve2_use_get()) |
31 | { | 40 | { |
32 | Evas_Cache2 *cache = evas_common_image_cache2_get(); | 41 | Evas_Cache2 *cache = evas_common_image_cache2_get(); |
33 | return evas_cache2_image_data(cache, w, h, image_data, alpha, cspace); | 42 | return evas_cache2_image_data(cache, src_w, src_h, image_data, alpha, cspace); |
34 | } | 43 | } |
35 | #endif | 44 | #endif |
36 | return evas_cache_image_data(evas_common_image_cache_get(), w, h, image_data, alpha, cspace); | 45 | return evas_cache_image_data(evas_common_image_cache_get(), src_w, src_h, image_data, alpha, cspace); |
37 | } | 46 | } |
38 | 47 | ||
39 | static void | 48 | static void |
@@ -50,12 +59,15 @@ _evas_font_image_free(void *image) | |||
50 | } | 59 | } |
51 | 60 | ||
52 | static void | 61 | static void |
53 | _evas_font_image_draw(void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth) | 62 | _evas_font_image_draw(void *context, void *surface, void *image, RGBA_Font_Glyph *fg, int x, int y, int w, int h, int smooth) |
54 | { | 63 | { |
55 | RGBA_Image *im; | 64 | RGBA_Image *im; |
65 | int src_w, src_h; | ||
56 | 66 | ||
57 | if (!image) return; | 67 | if (!image || !fg) return; |
58 | im = image; | 68 | im = image; |
69 | src_w = fg->glyph_out->bitmap.width; | ||
70 | src_h = fg->glyph_out->bitmap.rows; | ||
59 | 71 | ||
60 | #ifdef BUILD_PIPE_RENDER | 72 | #ifdef BUILD_PIPE_RENDER |
61 | if ((eina_cpu_count() > 1)) | 73 | if ((eina_cpu_count() > 1)) |
@@ -66,24 +78,24 @@ _evas_font_image_draw(void *context, void *surface, void *image, int src_x, int | |||
66 | #endif | 78 | #endif |
67 | evas_common_rgba_image_scalecache_prepare((Image_Entry *)(im), | 79 | evas_common_rgba_image_scalecache_prepare((Image_Entry *)(im), |
68 | surface, context, smooth, | 80 | surface, context, smooth, |
69 | src_x, src_y, src_w, src_h, | 81 | 0, 0, src_w, src_h, |
70 | dst_x, dst_y, dst_w, dst_h); | 82 | x, y, w, h); |
71 | 83 | ||
72 | evas_common_pipe_image_draw(im, surface, context, smooth, | 84 | evas_common_pipe_image_draw(im, surface, context, smooth, |
73 | src_x, src_y, src_w, src_h, | 85 | 0, 0, src_w, src_h, |
74 | dst_x, dst_y, dst_w, dst_h); | 86 | x, y, w, h); |
75 | } | 87 | } |
76 | else | 88 | else |
77 | #endif | 89 | #endif |
78 | { | 90 | { |
79 | evas_common_rgba_image_scalecache_prepare | 91 | evas_common_rgba_image_scalecache_prepare |
80 | (&im->cache_entry, surface, context, smooth, | 92 | (&im->cache_entry, surface, context, smooth, |
81 | src_x, src_y, src_w, src_h, | 93 | 0, 0, src_w, src_h, |
82 | dst_x, dst_y, dst_w, dst_h); | 94 | x, y, w, h); |
83 | evas_common_rgba_image_scalecache_do | 95 | evas_common_rgba_image_scalecache_do |
84 | (&im->cache_entry, surface, context, smooth, | 96 | (&im->cache_entry, surface, context, smooth, |
85 | src_x, src_y, src_w, src_h, | 97 | 0, 0, src_w, src_h, |
86 | dst_x, dst_y, dst_w, dst_h); | 98 | x, y, w, h); |
87 | 99 | ||
88 | evas_common_cpu_end_opt(); | 100 | evas_common_cpu_end_opt(); |
89 | } | 101 | } |
@@ -111,9 +123,20 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, | |||
111 | int chr_x, chr_y, w, h; | 123 | int chr_x, chr_y, w, h; |
112 | 124 | ||
113 | fg = glyph->fg; | 125 | fg = glyph->fg; |
126 | |||
114 | w = fg->glyph_out->bitmap.width; | 127 | w = fg->glyph_out->bitmap.width; |
115 | h = fg->glyph_out->bitmap.rows; | 128 | h = fg->glyph_out->bitmap.rows; |
116 | 129 | ||
130 | if (FT_HAS_FIXED_SIZES(fg->fi->src->ft.face)) | ||
131 | { | ||
132 | if ((fg->fi->bitmap_scalable & EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR) && | ||
133 | FT_HAS_COLOR(fg->fi->src->ft.face)) | ||
134 | { | ||
135 | w *= fg->fi->scale_factor; | ||
136 | h *= fg->fi->scale_factor; | ||
137 | } | ||
138 | } | ||
139 | |||
117 | if ((!fg->ext_dat) && (dc->font_ext.func.gl_new)) | 140 | if ((!fg->ext_dat) && (dc->font_ext.func.gl_new)) |
118 | { | 141 | { |
119 | /* extension calls */ | 142 | /* extension calls */ |
@@ -132,9 +155,7 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, | |||
132 | } | 155 | } |
133 | else | 156 | else |
134 | { | 157 | { |
135 | fg->ext_dat = _evas_font_image_new_from_data | 158 | fg->ext_dat = _evas_font_image_new(fg, EINA_TRUE, EVAS_COLORSPACE_ARGB8888); |
136 | (w, h, (DATA32 *)fg->glyph_out->bitmap.buffer, | ||
137 | EINA_TRUE, EVAS_COLORSPACE_ARGB8888); | ||
138 | fg->ext_dat_free = _evas_font_image_free; | 159 | fg->ext_dat_free = _evas_font_image_free; |
139 | } | 160 | } |
140 | } | 161 | } |
@@ -150,10 +171,11 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, | |||
150 | if ((fg->ext_dat) && (dc->font_ext.func.gl_draw)) | 171 | if ((fg->ext_dat) && (dc->font_ext.func.gl_draw)) |
151 | dc->font_ext.func.gl_draw(dc->font_ext.data, dst, | 172 | dc->font_ext.func.gl_draw(dc->font_ext.data, dst, |
152 | dc, fg, | 173 | dc, fg, |
153 | chr_x, y - (chr_y - y)); | 174 | chr_x, y - (chr_y - y), w, h); |
154 | else | 175 | else |
176 | // TODO: scale with evas_font_compress_draw.c... | ||
155 | evas_common_font_glyph_draw(fg, dc, dst, im_w, | 177 | evas_common_font_glyph_draw(fg, dc, dst, im_w, |
156 | chr_x, y - (chr_y - y), | 178 | chr_x, y - (chr_y - y), w, h, |
157 | ext_x, ext_y, | 179 | ext_x, ext_y, |
158 | ext_w, ext_h); | 180 | ext_w, ext_h); |
159 | } | 181 | } |
@@ -165,7 +187,7 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, | |||
165 | chr_x, y - (chr_y - y), w, h, EINA_TRUE); | 187 | chr_x, y - (chr_y - y), w, h, EINA_TRUE); |
166 | else | 188 | else |
167 | _evas_font_image_draw | 189 | _evas_font_image_draw |
168 | (dc, dst, fg->ext_dat, 0, 0, w, h, | 190 | (dc, dst, fg->ext_dat, fg, |
169 | chr_x, y - (chr_y - y), w, h, EINA_TRUE); | 191 | chr_x, y - (chr_y - y), w, h, EINA_TRUE); |
170 | } | 192 | } |
171 | } | 193 | } |
diff --git a/src/lib/evas/common/evas_font_load.c b/src/lib/evas/common/evas_font_load.c index 2afd124941..6bf1e34a08 100644 --- a/src/lib/evas/common/evas_font_load.c +++ b/src/lib/evas/common/evas_font_load.c | |||
@@ -42,9 +42,16 @@ _evas_font_cache_int_cmp(const RGBA_Font_Int *k1, int k1_length EINA_UNUSED, | |||
42 | if (k1->src->name == k2->src->name) | 42 | if (k1->src->name == k2->src->name) |
43 | { | 43 | { |
44 | if (k1->size == k2->size) | 44 | if (k1->size == k2->size) |
45 | return k1->wanted_rend - k2->wanted_rend; | 45 | { |
46 | if (k1->wanted_rend == k2->wanted_rend) | ||
47 | return k1->bitmap_scalable - k2->bitmap_scalable; | ||
48 | else | ||
49 | return k1->wanted_rend - k2->wanted_rend; | ||
50 | } | ||
46 | else | 51 | else |
47 | return k1->size - k2->size; | 52 | { |
53 | return k1->size - k2->size; | ||
54 | } | ||
48 | } | 55 | } |
49 | return strcmp(k1->src->name, k2->src->name); | 56 | return strcmp(k1->src->name, k2->src->name); |
50 | } | 57 | } |
@@ -57,6 +64,7 @@ _evas_font_cache_int_hash(const RGBA_Font_Int *key, int key_length EINA_UNUSED) | |||
57 | hash = eina_hash_djb2(key->src->name, eina_stringshare_strlen(key->src->name) + 1); | 64 | hash = eina_hash_djb2(key->src->name, eina_stringshare_strlen(key->src->name) + 1); |
58 | hash ^= eina_hash_int32(&key->size, sizeof (int)); | 65 | hash ^= eina_hash_int32(&key->size, sizeof (int)); |
59 | hash ^= eina_hash_int32(&wanted_rend, sizeof (int)); | 66 | hash ^= eina_hash_int32(&wanted_rend, sizeof (int)); |
67 | hash ^= eina_hash_int32(&key->bitmap_scalable, sizeof (int)); | ||
60 | return hash; | 68 | return hash; |
61 | } | 69 | } |
62 | 70 | ||
@@ -322,13 +330,13 @@ _evas_common_font_int_cache_init(RGBA_Font_Int *fi) | |||
322 | } | 330 | } |
323 | 331 | ||
324 | EAPI RGBA_Font_Int * | 332 | EAPI RGBA_Font_Int * |
325 | evas_common_font_int_memory_load(const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend) | 333 | evas_common_font_int_memory_load(const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
326 | { | 334 | { |
327 | RGBA_Font_Int *fi; | 335 | RGBA_Font_Int *fi; |
328 | char *fake_name; | 336 | char *fake_name; |
329 | 337 | ||
330 | fake_name = evas_file_path_join(source, name); | 338 | fake_name = evas_file_path_join(source, name); |
331 | fi = evas_common_font_int_find(fake_name, size, wanted_rend); | 339 | fi = evas_common_font_int_find(fake_name, size, wanted_rend, bitmap_scalable); |
332 | if (fi) | 340 | if (fi) |
333 | { | 341 | { |
334 | free(fake_name); | 342 | free(fake_name); |
@@ -350,6 +358,7 @@ evas_common_font_int_memory_load(const char *source, const char *name, int size, | |||
350 | return NULL; | 358 | return NULL; |
351 | } | 359 | } |
352 | fi->size = size; | 360 | fi->size = size; |
361 | fi->bitmap_scalable = bitmap_scalable; | ||
353 | _evas_common_font_int_cache_init(fi); | 362 | _evas_common_font_int_cache_init(fi); |
354 | fi = evas_common_font_int_load_init(fi); | 363 | fi = evas_common_font_int_load_init(fi); |
355 | evas_common_font_int_load_complete(fi); | 364 | evas_common_font_int_load_complete(fi); |
@@ -374,11 +383,12 @@ evas_common_font_int_memory_load(const char *source, const char *name, int size, | |||
374 | 383 | ||
375 | EAPI RGBA_Font_Int * | 384 | EAPI RGBA_Font_Int * |
376 | evas_common_font_int_load(const char *name, int size, | 385 | evas_common_font_int_load(const char *name, int size, |
377 | Font_Rend_Flags wanted_rend) | 386 | Font_Rend_Flags wanted_rend, |
387 | Efl_Text_Font_Bitmap_Scalable bitmap_scalable) | ||
378 | { | 388 | { |
379 | RGBA_Font_Int *fi; | 389 | RGBA_Font_Int *fi; |
380 | 390 | ||
381 | fi = evas_common_font_int_find(name, size, wanted_rend); | 391 | fi = evas_common_font_int_find(name, size, wanted_rend, bitmap_scalable); |
382 | if (fi) return fi; | 392 | if (fi) return fi; |
383 | fi = calloc(1, sizeof(RGBA_Font_Int)); | 393 | fi = calloc(1, sizeof(RGBA_Font_Int)); |
384 | if (!fi) return NULL; | 394 | if (!fi) return NULL; |
@@ -393,6 +403,7 @@ evas_common_font_int_load(const char *name, int size, | |||
393 | } | 403 | } |
394 | fi->size = size; | 404 | fi->size = size; |
395 | fi->wanted_rend = wanted_rend; | 405 | fi->wanted_rend = wanted_rend; |
406 | fi->bitmap_scalable = bitmap_scalable; | ||
396 | _evas_common_font_int_cache_init(fi); | 407 | _evas_common_font_int_cache_init(fi); |
397 | fi = evas_common_font_int_load_init(fi); | 408 | fi = evas_common_font_int_load_init(fi); |
398 | #ifdef EVAS_CSERVE2 | 409 | #ifdef EVAS_CSERVE2 |
@@ -437,6 +448,7 @@ evas_common_font_int_load_complete(RGBA_Font_Int *fi) | |||
437 | FT_Activate_Size(fi->ft.size); | 448 | FT_Activate_Size(fi->ft.size); |
438 | } | 449 | } |
439 | fi->real_size = fi->size * 64; | 450 | fi->real_size = fi->size * 64; |
451 | fi->scale_factor = 1.0; | ||
440 | error = FT_Set_Char_Size(fi->src->ft.face, 0, fi->real_size, font_dpi, font_dpi); | 452 | error = FT_Set_Char_Size(fi->src->ft.face, 0, fi->real_size, font_dpi, font_dpi); |
441 | if (error) | 453 | if (error) |
442 | error = FT_Set_Pixel_Sizes(fi->src->ft.face, 0, fi->real_size); | 454 | error = FT_Set_Pixel_Sizes(fi->src->ft.face, 0, fi->real_size); |
@@ -468,9 +480,20 @@ evas_common_font_int_load_complete(RGBA_Font_Int *fi) | |||
468 | FTLOCK(); | 480 | FTLOCK(); |
469 | 481 | ||
470 | if (FT_HAS_FIXED_SIZES(fi->src->ft.face)) | 482 | if (FT_HAS_FIXED_SIZES(fi->src->ft.face)) |
471 | error = FT_Select_Size(fi->src->ft.face, strike_index); | 483 | { |
484 | error = FT_Select_Size(fi->src->ft.face, strike_index); | ||
485 | |||
486 | if (!error) | ||
487 | { | ||
488 | if (FT_HAS_COLOR(fi->src->ft.face) && | ||
489 | fi->bitmap_scalable & EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR) | ||
490 | fi->scale_factor = (float)fi->size * 64.0 / (float)fi->real_size; | ||
491 | } | ||
492 | } | ||
472 | else | 493 | else |
473 | error = FT_Set_Pixel_Sizes(fi->src->ft.face, 0, fi->real_size); | 494 | { |
495 | error = FT_Set_Pixel_Sizes(fi->src->ft.face, 0, fi->real_size); | ||
496 | } | ||
474 | 497 | ||
475 | FTUNLOCK(); | 498 | FTUNLOCK(); |
476 | if (error) | 499 | if (error) |
@@ -543,13 +566,13 @@ evas_common_font_int_load_complete(RGBA_Font_Int *fi) | |||
543 | } | 566 | } |
544 | 567 | ||
545 | EAPI RGBA_Font * | 568 | EAPI RGBA_Font * |
546 | evas_common_font_memory_load(const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend) | 569 | evas_common_font_memory_load(const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
547 | { | 570 | { |
548 | RGBA_Font *fn; | 571 | RGBA_Font *fn; |
549 | RGBA_Font_Int *fi; | 572 | RGBA_Font_Int *fi; |
550 | 573 | ||
551 | fi = evas_common_font_int_memory_load(source, name, size, data, data_size, | 574 | fi = evas_common_font_int_memory_load(source, name, size, data, data_size, |
552 | wanted_rend); | 575 | wanted_rend, bitmap_scalable); |
553 | if (!fi) return NULL; | 576 | if (!fi) return NULL; |
554 | fn = calloc(1, sizeof(RGBA_Font)); | 577 | fn = calloc(1, sizeof(RGBA_Font)); |
555 | if (!fn) | 578 | if (!fn) |
@@ -577,12 +600,12 @@ evas_common_font_memory_load(const char *source, const char *name, int size, con | |||
577 | // fi->fs | 600 | // fi->fs |
578 | 601 | ||
579 | EAPI RGBA_Font * | 602 | EAPI RGBA_Font * |
580 | evas_common_font_load(const char *name, int size, Font_Rend_Flags wanted_rend) | 603 | evas_common_font_load(const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
581 | { | 604 | { |
582 | RGBA_Font *fn; | 605 | RGBA_Font *fn; |
583 | RGBA_Font_Int *fi; | 606 | RGBA_Font_Int *fi; |
584 | 607 | ||
585 | fi = evas_common_font_int_load(name, size, wanted_rend); | 608 | fi = evas_common_font_int_load(name, size, wanted_rend, bitmap_scalable); |
586 | if (!fi) return NULL; | 609 | if (!fi) return NULL; |
587 | /* First font, complete load */ | 610 | /* First font, complete load */ |
588 | if (!fi->ft.size) | 611 | if (!fi->ft.size) |
@@ -619,12 +642,12 @@ evas_common_font_load(const char *name, int size, Font_Rend_Flags wanted_rend) | |||
619 | } | 642 | } |
620 | 643 | ||
621 | EAPI RGBA_Font * | 644 | EAPI RGBA_Font * |
622 | evas_common_font_add(RGBA_Font *fn, const char *name, int size, Font_Rend_Flags wanted_rend) | 645 | evas_common_font_add(RGBA_Font *fn, const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
623 | { | 646 | { |
624 | RGBA_Font_Int *fi; | 647 | RGBA_Font_Int *fi; |
625 | 648 | ||
626 | if (!fn) return NULL; | 649 | if (!fn) return NULL; |
627 | fi = evas_common_font_int_load(name, size, wanted_rend); | 650 | fi = evas_common_font_int_load(name, size, wanted_rend, bitmap_scalable); |
628 | if (fi) | 651 | if (fi) |
629 | { | 652 | { |
630 | fn->fonts = eina_list_append(fn->fonts, fi); | 653 | fn->fonts = eina_list_append(fn->fonts, fi); |
@@ -641,13 +664,13 @@ evas_common_font_add(RGBA_Font *fn, const char *name, int size, Font_Rend_Flags | |||
641 | } | 664 | } |
642 | 665 | ||
643 | EAPI RGBA_Font * | 666 | EAPI RGBA_Font * |
644 | evas_common_font_memory_add(RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend) | 667 | evas_common_font_memory_add(RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
645 | { | 668 | { |
646 | RGBA_Font_Int *fi; | 669 | RGBA_Font_Int *fi; |
647 | 670 | ||
648 | if (!fn) | 671 | if (!fn) |
649 | return NULL; | 672 | return NULL; |
650 | fi = evas_common_font_int_memory_load(source, name, size, data, data_size, wanted_rend); | 673 | fi = evas_common_font_int_memory_load(source, name, size, data, data_size, wanted_rend, bitmap_scalable); |
651 | if (fi) | 674 | if (fi) |
652 | { | 675 | { |
653 | fn->fonts = eina_list_append(fn->fonts, fi); | 676 | fn->fonts = eina_list_append(fn->fonts, fi); |
@@ -744,38 +767,38 @@ evas_common_hinting_available(Font_Hint_Flags hinting) | |||
744 | } | 767 | } |
745 | 768 | ||
746 | EAPI RGBA_Font * | 769 | EAPI RGBA_Font * |
747 | evas_common_font_memory_hinting_load(const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend) | 770 | evas_common_font_memory_hinting_load(const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
748 | { | 771 | { |
749 | RGBA_Font *fn; | 772 | RGBA_Font *fn; |
750 | 773 | ||
751 | fn = evas_common_font_memory_load(source, name, size, data, data_size, wanted_rend); | 774 | fn = evas_common_font_memory_load(source, name, size, data, data_size, wanted_rend, bitmap_scalable); |
752 | if (fn) evas_common_font_hinting_set(fn, hinting); | 775 | if (fn) evas_common_font_hinting_set(fn, hinting); |
753 | return fn; | 776 | return fn; |
754 | } | 777 | } |
755 | 778 | ||
756 | EAPI RGBA_Font * | 779 | EAPI RGBA_Font * |
757 | evas_common_font_hinting_load(const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend) | 780 | evas_common_font_hinting_load(const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
758 | { | 781 | { |
759 | RGBA_Font *fn; | 782 | RGBA_Font *fn; |
760 | 783 | ||
761 | fn = evas_common_font_load(name, size, wanted_rend); | 784 | fn = evas_common_font_load(name, size, wanted_rend, bitmap_scalable); |
762 | if (fn) evas_common_font_hinting_set(fn, hinting); | 785 | if (fn) evas_common_font_hinting_set(fn, hinting); |
763 | return fn; | 786 | return fn; |
764 | } | 787 | } |
765 | 788 | ||
766 | EAPI RGBA_Font * | 789 | EAPI RGBA_Font * |
767 | evas_common_font_hinting_add(RGBA_Font *fn, const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend) | 790 | evas_common_font_hinting_add(RGBA_Font *fn, const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
768 | { | 791 | { |
769 | fn = evas_common_font_add(fn, name, size, wanted_rend); | 792 | fn = evas_common_font_add(fn, name, size, wanted_rend, bitmap_scalable); |
770 | if (fn) evas_common_font_hinting_set(fn, hinting); | 793 | if (fn) evas_common_font_hinting_set(fn, hinting); |
771 | return fn; | 794 | return fn; |
772 | } | 795 | } |
773 | 796 | ||
774 | EAPI RGBA_Font * | 797 | EAPI RGBA_Font * |
775 | evas_common_font_memory_hinting_add(RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend) | 798 | evas_common_font_memory_hinting_add(RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
776 | { | 799 | { |
777 | fn = evas_common_font_memory_add(fn, source, name, size, data, data_size, | 800 | fn = evas_common_font_memory_add(fn, source, name, size, data, data_size, |
778 | wanted_rend); | 801 | wanted_rend, bitmap_scalable); |
779 | if (fn) evas_common_font_hinting_set(fn, hinting); | 802 | if (fn) evas_common_font_hinting_set(fn, hinting); |
780 | return fn; | 803 | return fn; |
781 | } | 804 | } |
@@ -939,7 +962,8 @@ evas_common_font_flush_last(void) | |||
939 | 962 | ||
940 | EAPI RGBA_Font_Int * | 963 | EAPI RGBA_Font_Int * |
941 | evas_common_font_int_find(const char *name, int size, | 964 | evas_common_font_int_find(const char *name, int size, |
942 | Font_Rend_Flags wanted_rend) | 965 | Font_Rend_Flags wanted_rend, |
966 | Efl_Text_Font_Bitmap_Scalable bitmap_scalable) | ||
943 | { | 967 | { |
944 | RGBA_Font_Int tmp_fi; | 968 | RGBA_Font_Int tmp_fi; |
945 | RGBA_Font_Source tmp_fn; | 969 | RGBA_Font_Source tmp_fn; |
@@ -949,6 +973,7 @@ evas_common_font_int_find(const char *name, int size, | |||
949 | tmp_fi.src = &tmp_fn; | 973 | tmp_fi.src = &tmp_fn; |
950 | tmp_fi.size = size; | 974 | tmp_fi.size = size; |
951 | tmp_fi.wanted_rend = wanted_rend; | 975 | tmp_fi.wanted_rend = wanted_rend; |
976 | tmp_fi.bitmap_scalable = bitmap_scalable; | ||
952 | fi = eina_hash_find(fonts, &tmp_fi); | 977 | fi = eina_hash_find(fonts, &tmp_fi); |
953 | if (fi) | 978 | if (fi) |
954 | { | 979 | { |
diff --git a/src/lib/evas/common/evas_font_main.c b/src/lib/evas/common/evas_font_main.c index 91db4d52ec..0b25e31868 100644 --- a/src/lib/evas/common/evas_font_main.c +++ b/src/lib/evas/common/evas_font_main.c | |||
@@ -115,6 +115,14 @@ evas_common_font_instance_ascent_get(RGBA_Font_Int *fi) | |||
115 | WRN("NOT SCALABLE!"); | 115 | WRN("NOT SCALABLE!"); |
116 | } | 116 | } |
117 | val = (int)fi->src->ft.face->size->metrics.ascender; | 117 | val = (int)fi->src->ft.face->size->metrics.ascender; |
118 | |||
119 | if (FT_HAS_FIXED_SIZES(fi->src->ft.face)) | ||
120 | { | ||
121 | if (FT_HAS_COLOR(fi->src->ft.face) && | ||
122 | fi->bitmap_scalable & EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR) | ||
123 | val *= fi->scale_factor; | ||
124 | } | ||
125 | |||
118 | return FONT_METRIC_ROUNDUP(val); | 126 | return FONT_METRIC_ROUNDUP(val); |
119 | // printf("%i | %i\n", val, val >> 6); | 127 | // printf("%i | %i\n", val, val >> 6); |
120 | // if (fi->src->ft.face->units_per_EM == 0) | 128 | // if (fi->src->ft.face->units_per_EM == 0) |
@@ -137,6 +145,14 @@ evas_common_font_instance_descent_get(RGBA_Font_Int *fi) | |||
137 | fi->src->current_size = fi->size; | 145 | fi->src->current_size = fi->size; |
138 | } | 146 | } |
139 | val = -(int)fi->src->ft.face->size->metrics.descender; | 147 | val = -(int)fi->src->ft.face->size->metrics.descender; |
148 | |||
149 | if (FT_HAS_FIXED_SIZES(fi->src->ft.face)) | ||
150 | { | ||
151 | if (FT_HAS_COLOR(fi->src->ft.face) && | ||
152 | fi->bitmap_scalable & EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR) | ||
153 | val *= fi->scale_factor; | ||
154 | } | ||
155 | |||
140 | return FONT_METRIC_ROUNDUP(val); | 156 | return FONT_METRIC_ROUNDUP(val); |
141 | // if (fi->src->ft.face->units_per_EM == 0) | 157 | // if (fi->src->ft.face->units_per_EM == 0) |
142 | // return val; | 158 | // return val; |
@@ -165,6 +181,14 @@ evas_common_font_instance_max_ascent_get(RGBA_Font_Int *fi) | |||
165 | val = FONT_METRIC_ROUNDUP((int)fi->src->ft.face->size->metrics.ascender); | 181 | val = FONT_METRIC_ROUNDUP((int)fi->src->ft.face->size->metrics.ascender); |
166 | else | 182 | else |
167 | val = (int)fi->src->ft.face->bbox.yMax; | 183 | val = (int)fi->src->ft.face->bbox.yMax; |
184 | |||
185 | if (FT_HAS_FIXED_SIZES(fi->src->ft.face)) | ||
186 | { | ||
187 | if (FT_HAS_COLOR(fi->src->ft.face) && | ||
188 | fi->bitmap_scalable & EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR) | ||
189 | val *= fi->scale_factor; | ||
190 | } | ||
191 | |||
168 | if (fi->src->ft.face->units_per_EM == 0) | 192 | if (fi->src->ft.face->units_per_EM == 0) |
169 | return val; | 193 | return val; |
170 | dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; | 194 | dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; |
@@ -192,6 +216,14 @@ evas_common_font_instance_max_descent_get(RGBA_Font_Int *fi) | |||
192 | val = FONT_METRIC_ROUNDUP(-(int)fi->src->ft.face->size->metrics.descender); | 216 | val = FONT_METRIC_ROUNDUP(-(int)fi->src->ft.face->size->metrics.descender); |
193 | else | 217 | else |
194 | val = -(int)fi->src->ft.face->bbox.yMin; | 218 | val = -(int)fi->src->ft.face->bbox.yMin; |
219 | |||
220 | if (FT_HAS_FIXED_SIZES(fi->src->ft.face)) | ||
221 | { | ||
222 | if (FT_HAS_COLOR(fi->src->ft.face) && | ||
223 | fi->bitmap_scalable & EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR) | ||
224 | val *= fi->scale_factor; | ||
225 | } | ||
226 | |||
195 | if (fi->src->ft.face->units_per_EM == 0) | 227 | if (fi->src->ft.face->units_per_EM == 0) |
196 | return val; | 228 | return val; |
197 | dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; | 229 | dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; |
@@ -244,6 +276,14 @@ evas_common_font_get_line_advance(RGBA_Font *fn) | |||
244 | fi->src->current_size = fi->size; | 276 | fi->src->current_size = fi->size; |
245 | } | 277 | } |
246 | val = (int)fi->src->ft.face->size->metrics.height; | 278 | val = (int)fi->src->ft.face->size->metrics.height; |
279 | |||
280 | if (FT_HAS_FIXED_SIZES(fi->src->ft.face)) | ||
281 | { | ||
282 | if ((fi->bitmap_scalable & EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR) && | ||
283 | FT_HAS_COLOR(fi->src->ft.face)) | ||
284 | val *= fi->scale_factor; | ||
285 | } | ||
286 | |||
247 | if ((fi->src->ft.face->bbox.yMax == 0) && | 287 | if ((fi->src->ft.face->bbox.yMax == 0) && |
248 | (fi->src->ft.face->bbox.yMin == 0) && | 288 | (fi->src->ft.face->bbox.yMin == 0) && |
249 | (fi->src->ft.face->units_per_EM == 0)) | 289 | (fi->src->ft.face->units_per_EM == 0)) |
@@ -558,6 +598,19 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx) | |||
558 | fg->width = EVAS_FONT_ROUND_26_6_TO_INT(outbox.xMax - outbox.xMin); | 598 | fg->width = EVAS_FONT_ROUND_26_6_TO_INT(outbox.xMax - outbox.xMin); |
559 | fg->x_bear = EVAS_FONT_ROUND_26_6_TO_INT(outbox.xMin); | 599 | fg->x_bear = EVAS_FONT_ROUND_26_6_TO_INT(outbox.xMin); |
560 | fg->y_bear = EVAS_FONT_ROUND_26_6_TO_INT(outbox.yMax); | 600 | fg->y_bear = EVAS_FONT_ROUND_26_6_TO_INT(outbox.yMax); |
601 | |||
602 | if (FT_HAS_FIXED_SIZES(fi->src->ft.face)) | ||
603 | { | ||
604 | if (FT_HAS_COLOR(fi->src->ft.face) && | ||
605 | fi->bitmap_scalable & EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR) | ||
606 | { | ||
607 | fg->glyph->advance.x *= fi->scale_factor; | ||
608 | fg->glyph->advance.y *= fi->scale_factor; | ||
609 | fg->width *= fi->scale_factor; | ||
610 | fg->x_bear *= fi->scale_factor; | ||
611 | fg->y_bear *= fi->scale_factor; | ||
612 | } | ||
613 | } | ||
561 | } | 614 | } |
562 | 615 | ||
563 | fg->index = idx; | 616 | fg->index = idx; |
diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h index a4b3ae3623..12cda89d02 100644 --- a/src/lib/evas/include/evas_common_private.h +++ b/src/lib/evas/include/evas_common_private.h | |||
@@ -749,7 +749,7 @@ struct _RGBA_Draw_Context | |||
749 | struct { | 749 | struct { |
750 | void *(*gl_new) (void *data, RGBA_Font_Glyph *fg); | 750 | void *(*gl_new) (void *data, RGBA_Font_Glyph *fg); |
751 | void (*gl_free) (void *ext_dat); | 751 | void (*gl_free) (void *ext_dat); |
752 | void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y); | 752 | void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y, int w, int h); |
753 | void *(*gl_image_new) (void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace); | 753 | void *(*gl_image_new) (void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace); |
754 | void (*gl_image_free) (void *image); | 754 | void (*gl_image_free) (void *image); |
755 | void (*gl_image_draw) (void *gc, void *im, int dx, int dy, int dw, int dh, int smooth); | 755 | void (*gl_image_draw) (void *gc, void *im, int dx, int dy, int dw, int dh, int smooth); |
@@ -1010,6 +1010,7 @@ struct _RGBA_Font_Int | |||
1010 | Eina_Hash *kerning; | 1010 | Eina_Hash *kerning; |
1011 | Fash_Glyph *fash; | 1011 | Fash_Glyph *fash; |
1012 | unsigned int size; | 1012 | unsigned int size; |
1013 | float scale_factor; | ||
1013 | int real_size; | 1014 | int real_size; |
1014 | int max_h; | 1015 | int max_h; |
1015 | int references; | 1016 | int references; |
@@ -1033,6 +1034,8 @@ struct _RGBA_Font_Int | |||
1033 | 1034 | ||
1034 | int generation; | 1035 | int generation; |
1035 | 1036 | ||
1037 | Efl_Text_Font_Bitmap_Scalable bitmap_scalable; | ||
1038 | |||
1036 | unsigned char sizeok : 1; | 1039 | unsigned char sizeok : 1; |
1037 | unsigned char inuse : 1; | 1040 | unsigned char inuse : 1; |
1038 | }; | 1041 | }; |
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 12419998de..02c93c54a8 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h | |||
@@ -1501,10 +1501,10 @@ struct _Evas_Func | |||
1501 | void *(*image_plane_assign) (void *data, void *image, int x, int y); | 1501 | void *(*image_plane_assign) (void *data, void *image, int x, int y); |
1502 | void (*image_plane_release) (void *data, void *image, void *plane); | 1502 | void (*image_plane_release) (void *data, void *image, void *plane); |
1503 | 1503 | ||
1504 | Evas_Font_Set *(*font_load) (void *engine, const char *name, int size, Font_Rend_Flags wanted_rend); | 1504 | Evas_Font_Set *(*font_load) (void *engine, const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
1505 | Evas_Font_Set *(*font_memory_load) (void *engine, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend); | 1505 | Evas_Font_Set *(*font_memory_load) (void *engine, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
1506 | Evas_Font_Set *(*font_add) (void *engine, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend); | 1506 | Evas_Font_Set *(*font_add) (void *engine, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
1507 | Evas_Font_Set *(*font_memory_add) (void *engine, Evas_Font_Set *font, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend); | 1507 | Evas_Font_Set *(*font_memory_add) (void *engine, Evas_Font_Set *font, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
1508 | void (*font_free) (void *engine, Evas_Font_Set *font); | 1508 | void (*font_free) (void *engine, Evas_Font_Set *font); |
1509 | int (*font_ascent_get) (void *engine, Evas_Font_Set *font); | 1509 | int (*font_ascent_get) (void *engine, Evas_Font_Set *font); |
1510 | int (*font_descent_get) (void *engine, Evas_Font_Set *font); | 1510 | int (*font_descent_get) (void *engine, Evas_Font_Set *font); |
@@ -1774,7 +1774,7 @@ void evas_font_desc_unref(Evas_Font_Description *fdesc); | |||
1774 | int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b); | 1774 | int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b); |
1775 | Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc); | 1775 | Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc); |
1776 | const char *evas_font_lang_normalize(const char *lang); | 1776 | const char *evas_font_lang_normalize(const char *lang); |
1777 | void * evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size); | 1777 | void * evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size, Efl_Text_Font_Bitmap_Scalable bitmap_scalable); |
1778 | void evas_font_load_hinting_set(Evas *evas, void *font, int hinting); | 1778 | void evas_font_load_hinting_set(Evas *evas, void *font, int hinting); |
1779 | void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events, Eina_Bool sourve_invisible); | 1779 | void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events, Eina_Bool sourve_invisible); |
1780 | void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b); | 1780 | void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b); |
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h index 6124cf8da0..8e212952c4 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_common.h +++ b/src/modules/evas/engines/gl_common/evas_gl_common.h | |||
@@ -748,7 +748,7 @@ Evas_GL_Image *evas_gl_common_image_virtual_scaled_get(Evas_GL_Image *scaled, | |||
748 | 748 | ||
749 | void *evas_gl_font_texture_new(void *gc, RGBA_Font_Glyph *fg); | 749 | void *evas_gl_font_texture_new(void *gc, RGBA_Font_Glyph *fg); |
750 | void evas_gl_font_texture_free(void *); | 750 | void evas_gl_font_texture_free(void *); |
751 | void evas_gl_font_texture_draw(void *gc, void *surface, void *dc, RGBA_Font_Glyph *fg, int x, int y); | 751 | void evas_gl_font_texture_draw(void *gc, void *surface, void *dc, RGBA_Font_Glyph *fg, int x, int y, int w, int h); |
752 | void *evas_gl_font_image_new(void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace); | 752 | void *evas_gl_font_image_new(void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace); |
753 | void evas_gl_font_image_free(void *im); | 753 | void evas_gl_font_image_free(void *im); |
754 | void evas_gl_font_image_draw(void *gc, void *im, int dx, int dy, int dw, int dh, int smooth); | 754 | void evas_gl_font_image_draw(void *gc, void *im, int dx, int dy, int dw, int dh, int smooth); |
diff --git a/src/modules/evas/engines/gl_common/evas_gl_font.c b/src/modules/evas/engines/gl_common/evas_gl_font.c index 1b3e35b607..2e2c5263a9 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_font.c +++ b/src/modules/evas/engines/gl_common/evas_gl_font.c | |||
@@ -57,7 +57,7 @@ evas_gl_font_texture_free(void *tex) | |||
57 | } | 57 | } |
58 | 58 | ||
59 | void | 59 | void |
60 | evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_context, RGBA_Font_Glyph *fg, int x, int y) | 60 | evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_context, RGBA_Font_Glyph *fg, int x, int y, int w, int h) |
61 | { | 61 | { |
62 | Evas_Engine_GL_Context *gc = context; | 62 | Evas_Engine_GL_Context *gc = context; |
63 | RGBA_Draw_Context *dc = draw_context; | 63 | RGBA_Draw_Context *dc = draw_context; |
@@ -108,25 +108,25 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c | |||
108 | { | 108 | { |
109 | int nx, ny, nw, nh; | 109 | int nx, ny, nw, nh; |
110 | 110 | ||
111 | nx = x; ny = y; nw = tex->w; nh = tex->h; | 111 | nx = x; ny = y; nw = w; nh = h; |
112 | RECTS_CLIP_TO_RECT(nx, ny, nw, nh, | 112 | RECTS_CLIP_TO_RECT(nx, ny, nw, nh, |
113 | gc->dc->clip.x, gc->dc->clip.y, | 113 | gc->dc->clip.x, gc->dc->clip.y, |
114 | gc->dc->clip.w, gc->dc->clip.h); | 114 | gc->dc->clip.w, gc->dc->clip.h); |
115 | if ((nw < 1) || (nh < 1)) return; | 115 | if ((nw < 1) || (nh < 1)) return; |
116 | if ((nx == x) && (ny == y) && (nw == tex->w) && (nh == tex->h)) | 116 | if ((nx == x) && (ny == y) && (nw == w) && (nh == h)) |
117 | { | 117 | { |
118 | evas_gl_common_context_font_push(gc, tex, | 118 | evas_gl_common_context_font_push(gc, tex, |
119 | 0.0, 0.0, 0.0, 0.0, | 119 | 0.0, 0.0, 0.0, 0.0, |
120 | // sx, sy, sw, sh, | 120 | // sx, sy, sw, sh, |
121 | x, y, tex->w, tex->h, | 121 | x, y, w, h, |
122 | mtex, mx, my, mw, mh, mask_smooth, mask_color, | 122 | mtex, mx, my, mw, mh, mask_smooth, mask_color, |
123 | r, g, b, a); | 123 | r, g, b, a); |
124 | return; | 124 | return; |
125 | } | 125 | } |
126 | ssx = (double)sx + ((double)(sw * (nx - x)) / (double)(tex->w)); | 126 | ssx = (double)sx + ((double)(sw * (nx - x)) / (double)(w)); |
127 | ssy = (double)sy + ((double)(sh * (ny - y)) / (double)(tex->h)); | 127 | ssy = (double)sy + ((double)(sh * (ny - y)) / (double)(h)); |
128 | ssw = ((double)sw * (double)(nw)) / (double)(tex->w); | 128 | ssw = ((double)sw * (double)(nw)) / (double)(w); |
129 | ssh = ((double)sh * (double)(nh)) / (double)(tex->h); | 129 | ssh = ((double)sh * (double)(nh)) / (double)(h); |
130 | evas_gl_common_context_font_push(gc, tex, | 130 | evas_gl_common_context_font_push(gc, tex, |
131 | ssx, ssy, ssw, ssh, | 131 | ssx, ssy, ssw, ssh, |
132 | nx, ny, nw, nh, | 132 | nx, ny, nw, nh, |
@@ -138,7 +138,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c | |||
138 | evas_gl_common_context_font_push(gc, tex, | 138 | evas_gl_common_context_font_push(gc, tex, |
139 | 0.0, 0.0, 0.0, 0.0, | 139 | 0.0, 0.0, 0.0, 0.0, |
140 | // sx, sy, sw, sh, | 140 | // sx, sy, sw, sh, |
141 | x, y, tex->w, tex->h, | 141 | x, y, w, h, |
142 | mtex, mx, my, mw, mh, mask_smooth, mask_color, | 142 | mtex, mx, my, mw, mh, mask_smooth, mask_color, |
143 | r, g, b, a); | 143 | r, g, b, a); |
144 | } | 144 | } |
@@ -147,7 +147,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c | |||
147 | /* save out clip info */ | 147 | /* save out clip info */ |
148 | c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h; | 148 | c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h; |
149 | evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->shared->w, gc->shared->h); | 149 | evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->shared->w, gc->shared->h); |
150 | evas_common_draw_context_clip_clip(gc->dc, x, y, tex->w, tex->h); | 150 | evas_common_draw_context_clip_clip(gc->dc, x, y, w, h); |
151 | /* our clip is 0 size.. abort */ | 151 | /* our clip is 0 size.. abort */ |
152 | if ((gc->dc->clip.w <= 0) || (gc->dc->clip.h <= 0)) | 152 | if ((gc->dc->clip.w <= 0) || (gc->dc->clip.h <= 0)) |
153 | { | 153 | { |
@@ -160,23 +160,23 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c | |||
160 | int nx, ny, nw, nh; | 160 | int nx, ny, nw, nh; |
161 | 161 | ||
162 | rct = _evas_gl_common_cutout_rects->rects + i; | 162 | rct = _evas_gl_common_cutout_rects->rects + i; |
163 | nx = x; ny = y; nw = tex->w; nh = tex->h; | 163 | nx = x; ny = y; nw = w; nh = h; |
164 | RECTS_CLIP_TO_RECT(nx, ny, nw, nh, rct->x, rct->y, rct->w, rct->h); | 164 | RECTS_CLIP_TO_RECT(nx, ny, nw, nh, rct->x, rct->y, rct->w, rct->h); |
165 | if ((nw < 1) || (nh < 1)) continue; | 165 | if ((nw < 1) || (nh < 1)) continue; |
166 | if ((nx == x) && (ny == y) && (nw == tex->w) && (nh == tex->h)) | 166 | if ((nx == x) && (ny == y) && (nw == w) && (nh == h)) |
167 | { | 167 | { |
168 | evas_gl_common_context_font_push(gc, tex, | 168 | evas_gl_common_context_font_push(gc, tex, |
169 | 0.0, 0.0, 0.0, 0.0, | 169 | 0.0, 0.0, 0.0, 0.0, |
170 | // sx, sy, sw, sh, | 170 | // sx, sy, sw, sh, |
171 | x, y, tex->w, tex->h, | 171 | x, y, w, h, |
172 | mtex, mx, my, mw, mh, mask_smooth, mask_color, | 172 | mtex, mx, my, mw, mh, mask_smooth, mask_color, |
173 | r, g, b, a); | 173 | r, g, b, a); |
174 | continue; | 174 | continue; |
175 | } | 175 | } |
176 | ssx = (double)sx + ((double)(sw * (nx - x)) / (double)(tex->w)); | 176 | ssx = (double)sx + ((double)(sw * (nx - x)) / (double)(w)); |
177 | ssy = (double)sy + ((double)(sh * (ny - y)) / (double)(tex->h)); | 177 | ssy = (double)sy + ((double)(sh * (ny - y)) / (double)(h)); |
178 | ssw = ((double)sw * (double)(nw)) / (double)(tex->w); | 178 | ssw = ((double)sw * (double)(nw)) / (double)(w); |
179 | ssh = ((double)sh * (double)(nh)) / (double)(tex->h); | 179 | ssh = ((double)sh * (double)(nh)) / (double)(h); |
180 | evas_gl_common_context_font_push(gc, tex, | 180 | evas_gl_common_context_font_push(gc, tex, |
181 | ssx, ssy, ssw, ssh, | 181 | ssx, ssy, ssw, ssh, |
182 | nx, ny, nw, nh, | 182 | nx, ny, nw, nh, |
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index d7253de9fb..554fdf8d3b 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c | |||
@@ -3192,30 +3192,33 @@ eng_image_cache_get(void *data EINA_UNUSED) | |||
3192 | 3192 | ||
3193 | static Evas_Font_Set * | 3193 | static Evas_Font_Set * |
3194 | eng_font_load(void *data EINA_UNUSED, const char *name, int size, | 3194 | eng_font_load(void *data EINA_UNUSED, const char *name, int size, |
3195 | Font_Rend_Flags wanted_rend) | 3195 | Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) |
3196 | { | 3196 | { |
3197 | return (Evas_Font_Set *) evas_common_font_load(name, size, wanted_rend); | 3197 | return (Evas_Font_Set *) evas_common_font_load(name, size, wanted_rend, bitmap_scalable); |
3198 | } | 3198 | } |
3199 | 3199 | ||
3200 | static Evas_Font_Set * | 3200 | static Evas_Font_Set * |
3201 | eng_font_memory_load(void *data EINA_UNUSED, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend) | 3201 | eng_font_memory_load(void *data EINA_UNUSED, const char *source, const char *name, int size, const void *fdata, int fdata_size, |
3202 | Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) | ||
3202 | { | 3203 | { |
3203 | return (Evas_Font_Set *) evas_common_font_memory_load(source, name, size, | 3204 | return (Evas_Font_Set *) evas_common_font_memory_load(source, name, size, |
3204 | fdata, fdata_size, wanted_rend); | 3205 | fdata, fdata_size, wanted_rend, bitmap_scalable); |
3205 | } | 3206 | } |
3206 | 3207 | ||
3207 | static Evas_Font_Set * | 3208 | static Evas_Font_Set * |
3208 | eng_font_add(void *data EINA_UNUSED, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend) | 3209 | eng_font_add(void *data EINA_UNUSED, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend, |
3210 | Efl_Text_Font_Bitmap_Scalable bitmap_scalable) | ||
3209 | { | 3211 | { |
3210 | return (Evas_Font_Set *) evas_common_font_add((RGBA_Font *) font, name, | 3212 | return (Evas_Font_Set *) evas_common_font_add((RGBA_Font *) font, name, |
3211 | size, wanted_rend); | 3213 | size, wanted_rend, bitmap_scalable); |
3212 | } | 3214 | } |
3213 | 3215 | ||
3214 | static Evas_Font_Set * | 3216 | static Evas_Font_Set * |
3215 | eng_font_memory_add(void *data EINA_UNUSED, Evas_Font_Set *font, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend) | 3217 | eng_font_memory_add(void *data EINA_UNUSED, Evas_Font_Set *font, const char *source, const char *name, int size, const void *fdata, int fdata_size, |
3218 | Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable) | ||
3216 | { | 3219 | { |
3217 | return (Evas_Font_Set *) evas_common_font_memory_add((RGBA_Font *) font, | 3220 | return (Evas_Font_Set *) evas_common_font_memory_add((RGBA_Font *) font, |
3218 | source, name, size, fdata, fdata_size, wanted_rend); | 3221 | source, name, size, fdata, fdata_size, wanted_rend, bitmap_scalable); |
3219 | } | 3222 | } |
3220 | 3223 | ||
3221 | static void | 3224 | static void |