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

Comparing rxvt-unicode/src/rxvtfont.C (file contents):
Revision 1.151 by root, Sat Apr 4 13:58:55 2009 UTC vs.
Revision 1.152 by root, Sat Apr 4 21:27:53 2009 UTC

792 return false; 792 return false;
793 793
794 char *registry = get_property (f, term->xa [XA_CHARSET_REGISTRY], 0); 794 char *registry = get_property (f, term->xa [XA_CHARSET_REGISTRY], 0);
795 char *encoding = get_property (f, term->xa [XA_CHARSET_ENCODING], 0); 795 char *encoding = get_property (f, term->xa [XA_CHARSET_ENCODING], 0);
796 796
797 cs = CS_UNKNOWN;
798
797 if (registry && encoding) 799 if (registry && encoding)
798 { 800 {
799 char charset[64]; 801 char charset[64];
800 snprintf (charset, 64, "%s-%s", registry, encoding); 802 snprintf (charset, 64, "%s-%s", registry, encoding);
801 803
802 cs = codeset_from_name (charset); 804 cs = codeset_from_name (charset);
805
806 if (cs == CS_UNKNOWN)
807 rxvt_warn ("%s: cannot deduce encoding from registry/encoding properties \"%s\", ignoring font.\n", name, charset);
803 } 808 }
804 else 809
810 free (registry);
811 free (encoding);
812
813 if (cs == CS_UNKNOWN)
805 { 814 {
806 const char *charset = get_property (f, XA_FONT, 0); 815 const char *charset = get_property (f, XA_FONT, 0);
807 816
808 if (!charset) 817 if (!charset)
809 charset = name; 818 charset = name;
812 while (*charset) 821 while (*charset)
813 if (*charset++ == '-' && !--count) 822 if (*charset++ == '-' && !--count)
814 break; 823 break;
815 824
816 cs = codeset_from_name (charset); 825 cs = codeset_from_name (charset);
826 if (cs == CS_UNKNOWN)
827 rxvt_warn ("%s: cannot deduce encoding from font name property \"%s\", ignoring font.\n", name, charset);
828 }
829
830 if (cs == CS_UNKNOWN)
817 } 831 {
818 832 clear ();
819 free (registry); 833 return false;
820 free (encoding); 834 }
821 835
822 if (cs == CS_UNICODE) 836 if (cs == CS_UNICODE)
823 cs = CS_UNICODE_16; // X11 can have a max. of 65536 chars per font 837 cs = CS_UNICODE_16; // X11 can have a max. of 65536 chars per font
824 838
825 encm = f->min_byte1 != 0 || f->max_byte1 != 0; 839 encm = f->min_byte1 != 0 || f->max_byte1 != 0;
870 884
871 int wcw = WCWIDTH (*t); 885 int wcw = WCWIDTH (*t);
872 if (wcw > 0) g.width = (g.width + wcw - 1) / wcw; 886 if (wcw > 0) g.width = (g.width + wcw - 1) / wcw;
873 887
874 if (width < g.width) width = g.width; 888 if (width < g.width) width = g.width;
875 }
876
877 if (cs == CS_UNKNOWN)
878 {
879 fprintf (stderr, "unable to deduce codeset, ignoring font '%s'\n", name);
880
881 clear ();
882 return false;
883 } 889 }
884 890
885#if 0 // do it per-character 891#if 0 // do it per-character
886 if (prop && width > prop->width) 892 if (prop && width > prop->width)
887 { 893 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines