comparison src/mule-charset.c @ 3711:761385dfa575

[xemacs-hg @ 2006-11-29 19:56:09 by aidan] Provide a FORCE argument in set-charset-registries, document that the user should be using XLFD font forms and that the Mule build refuses to accept non-XLFD forms unless forced.
author aidan
date Wed, 29 Nov 2006 19:56:15 +0000
parents 3131094eed8c
children bd7108edc555
comparison
equal deleted inserted replaced
3710:4bcad369dfd4 3711:761385dfa575
889 XCHARSET_REGISTRIES (charset) = registries; 889 XCHARSET_REGISTRIES (charset) = registries;
890 invalidate_charset_font_caches (charset); 890 invalidate_charset_font_caches (charset);
891 face_property_was_changed (Vdefault_face, Qfont, Qglobal); 891 face_property_was_changed (Vdefault_face, Qfont, Qglobal);
892 } 892 }
893 893
894 DEFUN ("set-charset-registries", Fset_charset_registries, 2, 2, 0, /* 894 DEFUN ("set-charset-registries", Fset_charset_registries, 2, 3, 0, /*
895 Set the `registries' property of CHARSET to REGISTRIES. 895 Set the `registries' property of CHARSET to REGISTRIES.
896 896
897 REGISTRIES is an ordered vector of strings that describe the X11 897 REGISTRIES is an ordered vector of strings that describe the X11
898 CHARSET_REGISTRY and the CHARSET_ENCODINGs appropriate for this charset. 898 CHARSET_REGISTRY and the CHARSET_ENCODINGs appropriate for this charset.
899 Separate each registry from the corresponding encoding with a dash. The 899 Separate each registry from the corresponding encoding with a dash. The
904 prefer the backslash to display as a Yen sign; the corresponding syntax 904 prefer the backslash to display as a Yen sign; the corresponding syntax
905 would be: 905 would be:
906 906
907 (set-charset-registries 'ascii ["jisx0201.1976-0"]) 907 (set-charset-registries 'ascii ["jisx0201.1976-0"])
908 908
909 */ 909 If optional argument FORCE is non-nil, avoid sanity-checking the elements of
910 (charset, registries)) 910 REGISTRIES. Normally the strings are checked to make sure they contain no
911 XLFD wild cards and that they contain at least one hyphen; the only context
912 in which one might want not to do this is in order to use a font which
913 doesn't have a full XLFD--and thus, an effective
914 CHARSET_REGISTRY-CHARSET_ENCODING of ""--to display ASCII.
915
916 We recommend strongly that you specify a full XLFD, since this makes
917 multilingual and variant font handling work much better. To get the full
918 XLFD of any font, start xfd with the short name as the pattern argument:
919
920 xfd -fn 8x16kana
921
922 and use the text that appears at the top of the window.
923 */
924 (charset, registries, force))
911 { 925 {
912 int i; 926 int i;
913 charset = Fget_charset (charset); 927 charset = Fget_charset (charset);
914 CHECK_VECTOR (registries); 928 CHECK_VECTOR (registries);
915 929
916 for (i = 0; i < XVECTOR_LENGTH(registries); ++i) 930 for (i = 0; i < XVECTOR_LENGTH(registries); ++i)
917 { 931 {
918 CHECK_STRING (XVECTOR_DATA(registries)[i]); 932 CHECK_STRING (XVECTOR_DATA(registries)[i]);
933
934 if (!NILP(force))
935 {
936 continue;
937 }
938
919 if (NULL == qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '-')) 939 if (NULL == qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '-'))
920 { 940 {
921 invalid_argument("Not an X11 REGISTRY-ENCODING combination", 941 invalid_argument("Not an X11 REGISTRY-ENCODING combination",
922 XVECTOR_DATA(registries)[i]); 942 XVECTOR_DATA(registries)[i]);
923 } 943 }