[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Polish characters in emacs
From: |
Peter Dyballa |
Subject: |
Re: Polish characters in emacs |
Date: |
Fri, 19 Oct 2007 21:38:05 +0200 |
Am 19.10.2007 um 18:36 schrieb Wojtek:
I should add that I am running emacs 21.4 on Fedora 5 and emacs 22.1
on Fedora 7.
This explains why C-u C-x = returns different "numbers." They really
don't mean a thing for us users. They are some kind of representation
of the way GNU Emacs stores these characters in the buffer you're
visiting. Of importance is the last value, U+<four hex digits>. This
corresponds to the position of the character in Unicode. So it's not
true that different "key codes" are transmitted. See below!
Have you found the lines in which the font is named from which the
glyph is taken to display the character?
The reason that the behaviour puzzles me is that I
understand that both of the emacses are getting their fonts from the
same place and hence it is (based on my understanding) a matter of
emacs displaying the font.
Right. IMO much progress happened between 21.4 and 22.1, GNU Emacs
learned some encodings, what-cursor-position gives much more and
valuable information. You can press the mode-line in many places and
you get information instead of errors. Many tool-tips appear ...
When I ask emacs to describe-coding-system I get that it is utf-8 for
terminal output in both emacses.
OK, but then your tests are incorrect. To test what is input to GNU
Emacs just type in *scratch* buffer or such:
C-q <some key press event on the keyboard>
(This is quite nice when you press a function or cursor key!) This
*input* problem is one area, which probably works without fault.
You won't believe this because you don't *see* it. So your problem is
merely an *output* problem. When you write that the mode-line starts
with ``--:´´ then you could have already found that this stands for
an undecided encoding (by pressing the second - in mode-line). Or:
what you see is not what you've got. So make precise tests. For
example with the test file I sent to the list. Its first line *will*
set the buffer's encoding to the proper value to see the characters
as described. Then it's up to you and your system to find the
adequate fonts or fontsets. For this latter purpose you might write
an ELisp file that lets you choose another font (or fontset) from
those (monospaced) fonts (S-mouse-1) (you can, of course, leave out
completely uninteresting font encodings):
(if (fboundp 'new-fontset)
(progn
(create-fontset-from-fontset-spec "-b&h-lucidatypewriter-medium-
r-*-*-10-*-*-*-*-*-fontset-10pt_lucidatypewriter" t 'noerror)
(set-fontset-font "fontset-10pt_lucidatypewriter" 'latin-
iso8859-1 '("lucidatypewriter" . "iso8859-1"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'latin-
iso8859-2 '("lucidatypewriter" . "iso8859-2"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'latin-
iso8859-3 '("lucidatypewriter" . "iso8859-3"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'latin-
iso8859-4 '("lucidatypewriter" . "iso8859-4"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'cyrillic-
iso8859-5 '("lucidatypewriter" . "iso8859-5"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'arabic-
iso8859-6 '("lucidatypewriter" . "iso8859-6"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'greek-
iso8859-7 '("lucidatypewriter" . "iso8859-7"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'hebrew-
iso8859-8 '("lucidatypewriter" . "iso8859-8"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'latin-
iso8859-9 '("lucidatypewriter" . "iso8859-9"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'latin-
iso8859-10 '("lucidatypewriter" . "iso8859-10"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'latin-
iso8859-13 '("lucidatypewriter" . "iso8859-13"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'latin-
iso8859-15 '("lucidatypewriter" . "iso8859-15"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'mule-
unicode-0100-24ff '("lucidatypewriter" . "iso10646-1"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'mule-
unicode-2500-33ff '("lucidatypewriter" . "iso10646-1"))
(set-fontset-font "fontset-10pt_lucidatypewriter" 'mule-
unicode-e000-ffff '("lucidatypewriter" . "iso10646-1"))
(set-fontset-font
"fontset-10pt_lucidatypewriter" 'ascii
'("lucidatypewriter" . "iso10646-1"))
(set-fontset-font "fontset-10pt_lucidatypewriter"
'iso10646-1 '("lucidatypewriter" . "iso10646-1"))
))
(provide 'site-fontsets-x11)
or (again, you can leave out variants and sizes and concentrate on
those encodings that have ÓóĄąĆćĘꣳŃńŚśŹźŻż):
(setq x-fixed-font-alist
'("X11 Font Menu"
("Test fixed"
("Courier @ 75 DPI"
;; For these, we specify the point height and the DPIs.
( "8" "-adobe-courier-medium-r-normal--*-80-75-75-m-*-
iso10646-1" "8")
("10" "-adobe-courier-medium-r-normal--*-100-75-75-m-
*-iso10646-1" "10")
("12" "-adobe-courier-medium-r-normal--*-120-75-75-m-
*-iso10646-1" "12")
( "8 bold" "-adobe-courier-bold-r-normal--*-80-75-75-m-
*-iso10646-1" "8 bold")
("10 bold" "-adobe-courier-bold-r-normal--*-100-75-75-m-
*-iso10646-1" "10 bold")
("12 bold" "-adobe-courier-bold-r-normal--*-120-75-75-m-
*-iso10646-1" "12 bold")
( "8 slant" "-adobe-courier-medium-o-normal--*-80-75-75-
m-*-iso10646-1" "8 slant")
("10 slant" "-adobe-courier-medium-o-normal--*-100-75-75-
m-*-iso10646-1" "10 slant")
("12 slant" "-adobe-courier-medium-o-normal--*-120-75-75-
m-*-iso10646-1" "12 slant")
( "8 bold slant" "-adobe-courier-bold-o-normal--*-80-75-75-m-
*-iso10646-1" "8 bold slant")
("10 bold slant" "-adobe-courier-bold-o-normal--*-100-75-75-m-
*-iso10646-1" "10 bold slant")
("12 bold slant" "-adobe-courier-bold-o-normal--*-120-75-75-m-
*-iso10646-1" "12 bold slant")
)
("ISO 8859-15 medium"
("B&H LucidaSans Typewriter med" "-*-lucida sans typewriter-
medium-r-*--0-0-0-0-m-0-iso8859-15")
("B&H Luxi Mono med" "-*-luxi mono-medium-r-
*--0-0-0-0-m-0-iso8859-15")
("Bitstream Vera Sans Mono med" "-*-bitstream vera sans mono-
medium-r-*--0-0-0-0-m-0-iso8859-15")
("ProFont med" "-misc-profontwindows-medium-
r-*--0-0-0-0-m-0-iso8859-15")
("Monotype Andale Mono med" "-monotype-andale mono-medium-r-
*--0-0-0-0-m-0-iso8859-15")
("Monotype Courier New med" "-monotype-courier new-medium-r-
*--0-0-0-0-m-0-iso8859-15")
("urw++ Courier med" "-urw-courier-medium-r-
*--0-0-0-0-m-0-iso8859-15")
("urw++ Nimbus Mono l med" "-urw-nimbus mono l-medium-r-
*--0-0-0-0-m-0-iso8859-15")
)
))
(provide 'site-fonts-x11)
In an init file you can load these extra font definitions via:
(require 'site-fontsets-x11)
or
(require 'site-fonts-x11)
and use them for the tests: in one window my test file is open and
you switch through all the fonts to see whether at some time you see
the Polish characters. Of course you can sort the 18 or 20 lines to
become one Polish character block.
Once you've accomplished to see the the right shapes from the test
file, you can start to enter yourself Polish characters into this
test file (and kill the buffer without saving your changes).
Remember: only in the right encoding you can see the right characters
because one byte value represents dozens of different characters in
dozens of different encodings.
BTW, what diacritic did you enter on Fedora 5? I can't see anything.
--
Greetings
Pete
One-Shot Case Study, n.:
The scientific equivalent of the four-leaf clover, from
which it is concluded all clovers possess four leaves
and are sometimes green.