… | |
… | |
302 | =head3 Can I switch the fonts at runtime? |
302 | =head3 Can I switch the fonts at runtime? |
303 | |
303 | |
304 | Yes, using an escape sequence. Try something like this, which has the same |
304 | Yes, using an escape sequence. Try something like this, which has the same |
305 | effect as using the C<-fn> switch, and takes effect immediately: |
305 | effect as using the C<-fn> switch, and takes effect immediately: |
306 | |
306 | |
307 | printf '\e]50;%s\007' "9x15bold,xft:Kochi Gothic" |
307 | printf '\33]50;%s\007' "9x15bold,xft:Kochi Gothic" |
308 | |
308 | |
309 | This is useful if you e.g. work primarily with japanese (and prefer a |
309 | This is useful if you e.g. work primarily with japanese (and prefer a |
310 | japanese font), but you have to switch to chinese temporarily, where |
310 | japanese font), but you have to switch to chinese temporarily, where |
311 | japanese fonts would only be in your way. |
311 | japanese fonts would only be in your way. |
312 | |
312 | |
… | |
… | |
960 | something else, e.g. C<en_GB.UTF-8>. Needless to say, this is not going to work. |
960 | something else, e.g. C<en_GB.UTF-8>. Needless to say, this is not going to work. |
961 | |
961 | |
962 | The best thing is to fix your startup environment, as you will likely run |
962 | The best thing is to fix your startup environment, as you will likely run |
963 | into other problems. If nothing works you can try this in your .profile. |
963 | into other problems. If nothing works you can try this in your .profile. |
964 | |
964 | |
965 | printf '\e]701;%s\007' "$LC_CTYPE" |
965 | printf '\33]701;%s\007' "$LC_CTYPE" |
966 | |
966 | |
967 | If this doesn't work, then maybe you use a C<LC_CTYPE> specification not |
967 | If this doesn't work, then maybe you use a C<LC_CTYPE> specification not |
968 | supported on your systems. Some systems have a C<locale> command which |
968 | supported on your systems. Some systems have a C<locale> command which |
969 | displays this (also, C<perl -e0> can be used to check locale settings, as |
969 | displays this (also, C<perl -e0> can be used to check locale settings, as |
970 | it will complain loudly if it cannot set the locale). If it displays something |
970 | it will complain loudly if it cannot set the locale). If it displays something |
… | |
… | |
1020 | =head3 Can I switch locales at runtime? |
1020 | =head3 Can I switch locales at runtime? |
1021 | |
1021 | |
1022 | Yes, using an escape sequence. Try something like this, which sets |
1022 | Yes, using an escape sequence. Try something like this, which sets |
1023 | rxvt-unicode's idea of C<LC_CTYPE>. |
1023 | rxvt-unicode's idea of C<LC_CTYPE>. |
1024 | |
1024 | |
1025 | printf '\e]701;%s\007' ja_JP.SJIS |
1025 | printf '\33]701;%s\007' ja_JP.SJIS |
1026 | |
1026 | |
1027 | See also the previous answer. |
1027 | See also the previous answer. |
1028 | |
1028 | |
1029 | Sometimes this capability is rather handy when you want to work in |
1029 | Sometimes this capability is rather handy when you want to work in |
1030 | one locale (e.g. C<de_DE.UTF-8>) but some programs don't support it |
1030 | one locale (e.g. C<de_DE.UTF-8>) but some programs don't support it |
1031 | (e.g. UTF-8). For example, I use this script to start C<xjdic>, which |
1031 | (e.g. UTF-8). For example, I use this script to start C<xjdic>, which |
1032 | first switches to a locale supported by xjdic and back later: |
1032 | first switches to a locale supported by xjdic and back later: |
1033 | |
1033 | |
1034 | printf '\e]701;%s\007' ja_JP.SJIS |
1034 | printf '\33]701;%s\007' ja_JP.SJIS |
1035 | xjdic -js |
1035 | xjdic -js |
1036 | printf '\e]701;%s\007' de_DE.UTF-8 |
1036 | printf '\33]701;%s\007' de_DE.UTF-8 |
1037 | |
1037 | |
1038 | You can also use xterm's C<luit> program, which usually works fine, except |
1038 | You can also use xterm's C<luit> program, which usually works fine, except |
1039 | for some locales where character width differs between program- and |
1039 | for some locales where character width differs between program- and |
1040 | rxvt-unicode-locales. |
1040 | rxvt-unicode-locales. |
1041 | |
1041 | |