ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/defaultfont.C
(Generate patch)

Comparing rxvt-unicode/src/defaultfont.C (file contents):
Revision 1.4 by pcg, Sat Nov 29 18:42:07 2003 UTC vs.
Revision 1.5 by pcg, Thu Dec 4 00:43:26 2003 UTC

891rxvt_fontset::realize_font (int i) 891rxvt_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
905void 907void
906rxvt_fontset::populate (const char *desc) 908rxvt_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}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines