… | |
… | |
891 | rxvt_fontset::realize_font (int i) |
891 | rxvt_fontset::realize_font (int i) |
892 | { |
892 | { |
893 | if (fonts[i]->loaded) |
893 | if (fonts[i]->loaded) |
894 | return true; |
894 | return true; |
895 | |
895 | |
|
|
896 | fonts[i]->loaded = true; |
|
|
897 | |
896 | if (fonts[i]->load (height)) |
898 | if (!fonts[i]->load (height)) |
897 | return fonts[i]->loaded = true; |
899 | { |
898 | |
900 | fonts[i]->cs = CS_UNKNOWN; |
899 | delete fonts[i]; |
|
|
900 | fonts.erase (fonts.begin () + i); |
|
|
901 | |
|
|
902 | return false; |
901 | return false; |
|
|
902 | } |
|
|
903 | |
|
|
904 | return true; |
903 | } |
905 | } |
904 | |
906 | |
905 | void |
907 | void |
906 | rxvt_fontset::populate (const char *desc) |
908 | rxvt_fontset::populate (const char *desc) |
907 | { |
909 | { |
… | |
… | |
944 | { |
946 | { |
945 | if (FROM_UNICODE (f->cs, unicode) == NOCHAR) |
947 | if (FROM_UNICODE (f->cs, unicode) == NOCHAR) |
946 | goto next_font; |
948 | goto next_font; |
947 | |
949 | |
948 | if (!realize_font (i)) |
950 | if (!realize_font (i)) |
949 | { |
|
|
950 | --i; |
|
|
951 | goto next_font; |
951 | goto next_font; |
952 | } |
952 | } |
953 | |
953 | |
954 | //printf ("added font %s for %04lx\n", f->name, unicode); |
|
|
955 | } |
|
|
956 | |
|
|
957 | if (f->has_codepoint (unicode)) |
954 | if (f->cs != CS_UNKNOWN && f->has_codepoint (unicode)) |
958 | return i; |
955 | return i; |
959 | |
956 | |
960 | next_font: |
957 | next_font: |
961 | if (i == fonts.size () - 1 && fallback->name) |
958 | if (i == fonts.size () - 1 && fallback->name) |
962 | { |
959 | { |
963 | fonts.push_back (new_font (fallback->name, fallback->cs)); |
960 | fonts.push_back (new_font (fallback->name, fallback->cs)); |
964 | fallback++; |
961 | fallback++; |
|
|
962 | i = 0; |
965 | } |
963 | } |
966 | } |
964 | } |
967 | |
965 | |
968 | return 0; /* we must return SOME font */ |
966 | return 0; /* we must return SOME font */ |
969 | } |
967 | } |