Changeset View
Changeset View
Standalone View
Standalone View
src/lib/evas/canvas/evas_font_dir.c
Show First 20 Lines • Show All 663 Lines • ▼ Show 20 Line(s) | 661 | #ifdef HAVE_FONTCONFIG | |||
---|---|---|---|---|---|
664 | Eina_Bool file_font = EINA_FALSE; | 664 | Eina_Bool file_font = EINA_FALSE; | ||
665 | #endif | 665 | #endif | ||
666 | 666 | | |||
667 | Evas_Font_Set *font = NULL; | 667 | Evas_Font_Set *font = NULL; | ||
668 | Eina_List *fonts, *l, *l_next; | 668 | Eina_List *fonts, *l, *l_next; | ||
669 | Fndat *fd; | 669 | Fndat *fd; | ||
670 | #ifdef HAVE_FONTCONFIG | 670 | #ifdef HAVE_FONTCONFIG | ||
671 | Fndat *found_fd = NULL; | 671 | Fndat *found_fd = NULL; | ||
672 | Fndat *found_fd2 = NULL; | ||||
672 | #endif | 673 | #endif | ||
673 | char *nm; | 674 | char *nm; | ||
674 | Font_Rend_Flags wanted_rend = 0; | 675 | Font_Rend_Flags wanted_rend = 0; | ||
675 | 676 | | |||
676 | if (!fdesc) return NULL; | 677 | if (!fdesc) return NULL; | ||
677 | fdesc->is_new = EINA_FALSE; | 678 | fdesc->is_new = EINA_FALSE; | ||
678 | 679 | | |||
679 | if (fdesc->slant != EVAS_FONT_SLANT_NORMAL) | 680 | if (fdesc->slant != EVAS_FONT_SLANT_NORMAL) | ||
Show All 22 Lines | 702 | #ifdef HAVE_FONTCONFIG | |||
702 | else if (fd->set && fd->p_nm && !fd->file_font) | 703 | else if (fd->set && fd->p_nm && !fd->file_font) | ||
703 | { | 704 | { | ||
704 | found_fd = fd; | 705 | found_fd = fd; | ||
705 | } | 706 | } | ||
706 | #endif | 707 | #endif | ||
707 | } | 708 | } | ||
708 | } | 709 | } | ||
709 | } | 710 | } | ||
710 | | ||||
711 | #ifdef HAVE_FONTCONFIG | | |||
712 | if (found_fd) | | |||
ali.alzyod: If found_fd is not null, why to continue the search? | |||||
713 | { | | |||
714 | font = _evas_load_fontconfig(font, found_fd->set, size, wanted_rend, bitmap_scalable); | | |||
715 | goto on_find; | | |||
716 | } | | |||
717 | #endif | | |||
718 | | ||||
719 | EINA_LIST_FOREACH_SAFE(fonts_zero, l, l_next, fd) | 711 | EINA_LIST_FOREACH_SAFE(fonts_zero, l, l_next, fd) | ||
720 | { | 712 | { | ||
721 | if (!evas_font_desc_cmp(fdesc, fd->fdesc)) | 713 | if (!evas_font_desc_cmp(fdesc, fd->fdesc)) | ||
722 | { | 714 | { | ||
723 | if (((!source) && (!fd->source)) || | 715 | if (((!source) && (!fd->source)) || | ||
724 | ((source) && (fd->source) && (!strcmp(source, fd->source)))) | 716 | ((source) && (fd->source) && (!strcmp(source, fd->source)))) | ||
725 | { | 717 | { | ||
726 | if ((size == fd->size) && | 718 | if ((size == fd->size) && | ||
727 | (wanted_rend == fd->wanted_rend)) | 719 | (wanted_rend == fd->wanted_rend)) | ||
728 | { | 720 | { | ||
729 | fonts_zero = eina_list_remove_list(fonts_zero, l); | 721 | fonts_zero = eina_list_remove_list(fonts_zero, l); | ||
730 | fonts_cache = eina_list_prepend(fonts_cache, fd); | 722 | fonts_cache = eina_list_prepend(fonts_cache, fd); | ||
731 | fd->ref++; | 723 | fd->ref++; | ||
732 | return fd->font; | 724 | return fd->font; | ||
733 | } | 725 | } | ||
734 | #ifdef HAVE_FONTCONFIG | 726 | #ifdef HAVE_FONTCONFIG | ||
735 | else if (fd->set && fd->p_nm && !fd->file_font) | 727 | else if (fd->set && fd->p_nm && !fd->file_font) | ||
736 | { | 728 | { | ||
737 | found_fd = fd; | 729 | found_fd2 = fd; | ||
738 | } | 730 | } | ||
739 | #endif | 731 | #endif | ||
740 | } | 732 | } | ||
741 | } | 733 | } | ||
742 | } | 734 | } | ||
743 | | ||||
744 | #ifdef HAVE_FONTCONFIG | 735 | #ifdef HAVE_FONTCONFIG | ||
745 | if (found_fd) | 736 | if (found_fd) | ||
746 | { | 737 | { | ||
747 | font = _evas_load_fontconfig(font, found_fd->set, size, wanted_rend, bitmap_scalable); | 738 | font = _evas_load_fontconfig(font, found_fd->set, size, wanted_rend, bitmap_scalable); | ||
748 | goto on_find; | 739 | goto on_find; | ||
749 | } | 740 | } | ||
741 | | ||||
742 | if (found_fd2) | ||||
743 | { | ||||
744 | font = _evas_load_fontconfig(font, found_fd2->set, size, wanted_rend, bitmap_scalable); | ||||
745 | goto on_find; | ||||
746 | } | ||||
750 | #endif | 747 | #endif | ||
751 | 748 | | |||
752 | fonts = evas_font_set_get(fdesc->name); | 749 | fonts = evas_font_set_get(fdesc->name); | ||
753 | EINA_LIST_FOREACH(fonts, l, nm) /* Load each font in append */ | 750 | EINA_LIST_FOREACH(fonts, l, nm) /* Load each font in append */ | ||
754 | { | 751 | { | ||
755 | if (l == fonts || !font) /* First iteration OR no font */ | 752 | if (l == fonts || !font) /* First iteration OR no font */ | ||
756 | { | 753 | { | ||
757 | /*This will suppress warnings for resource leak*/ | 754 | /*This will suppress warnings for resource leak*/ | ||
▲ Show 20 Lines • Show All 729 Lines • Show Last 20 Lines |
If found_fd is not null, why to continue the search?