* Use 7x13 fixed X font for Cyrillic
@ 2016-02-27 1:59 Vladimir Panteleev
2016-02-27 7:59 ` Eli Zaretskii
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Vladimir Panteleev @ 2016-02-27 1:59 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
When I use:
(set-face-attribute 'default nil :font "7x13")
Emacs seems to use a different font for the Cyrillic (and some other non-ASCII) characters, apparently 12x13:
http://dump.thecybershadow.net/69ef3dd90f228f8989f5b0f11aa0b281/emacs-cyrillic.png
However, I can use 7x13 for Cyrillic in rxvt-unicode, so the font does exist and is usable.
I've tried variations of this, with no effect:
(set-fontset-font "fontset-default" 'cyrillic-iso8859-5 (font-spec :font "7x13"))
Can I get Emacs to use this font, or is it an Emacs bug?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Use 7x13 fixed X font for Cyrillic
2016-02-27 1:59 Use 7x13 fixed X font for Cyrillic Vladimir Panteleev
@ 2016-02-27 7:59 ` Eli Zaretskii
[not found] ` <mailman.6021.1456560027.843.help-gnu-emacs@gnu.org>
2016-02-27 20:46 ` Javier
2 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2016-02-27 7:59 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Fri, 26 Feb 2016 17:59:39 -0800 (PST)
> From: Vladimir Panteleev <thecybershadow@gmail.com>
>
> When I use:
>
> (set-face-attribute 'default nil :font "7x13")
>
> Emacs seems to use a different font for the Cyrillic (and some other non-ASCII) characters, apparently 12x13:
>
> http://dump.thecybershadow.net/69ef3dd90f228f8989f5b0f11aa0b281/emacs-cyrillic.png
>
> However, I can use 7x13 for Cyrillic in rxvt-unicode, so the font does exist and is usable.
What version of Emacs is that?
> I've tried variations of this, with no effect:
>
> (set-fontset-font "fontset-default" 'cyrillic-iso8859-5 (font-spec :font "7x13"))
What happens if you use the explicit name of the font? I think using
font-spec is not going to work in this case, because it just looks for
matching fonts, something that Emacs already did when it decided not
to use that font.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Use 7x13 fixed X font for Cyrillic
[not found] ` <mailman.6021.1456560027.843.help-gnu-emacs@gnu.org>
@ 2016-02-27 20:26 ` Vladimir Panteleev
0 siblings, 0 replies; 9+ messages in thread
From: Vladimir Panteleev @ 2016-02-27 20:26 UTC (permalink / raw)
To: help-gnu-emacs
On Saturday, February 27, 2016 at 8:00:31 AM UTC, Eli Zaretskii wrote:
> What version of Emacs is that?
GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
of 2015-09-10 on foutrelis
> > I've tried variations of this, with no effect:
> >
> > (set-fontset-font "fontset-default" 'cyrillic-iso8859-5 (font-spec :font "7x13"))
>
> What happens if you use the explicit name of the font? I think using
> font-spec is not going to work in this case, because it just looks for
> matching fonts, something that Emacs already did when it decided not
> to use that font.
I've also tried this with no visible change:
(set-fontset-font "fontset-default" 'cyrillic-iso8859-5 '("-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1" . "iso10646-1"))
(set-fontset-font "fontset-default" 'cyrillic-iso8859-5 '("-misc-fixed-medium-r-normal--13-120-75-75-c-70-koi8-r" . "koi8-r"))
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Use 7x13 fixed X font for Cyrillic
2016-02-27 1:59 Use 7x13 fixed X font for Cyrillic Vladimir Panteleev
2016-02-27 7:59 ` Eli Zaretskii
[not found] ` <mailman.6021.1456560027.843.help-gnu-emacs@gnu.org>
@ 2016-02-27 20:46 ` Javier
2016-02-27 22:53 ` Vladimir Panteleev
2 siblings, 1 reply; 9+ messages in thread
From: Javier @ 2016-02-27 20:46 UTC (permalink / raw)
To: help-gnu-emacs
Vladimir Panteleev <thecybershadow@gmail.com> wrote:
> However, I can use 7x13 for Cyrillic in rxvt-unicode, so the font does exist and is usable.
>
> I've tried variations of this, with no effect:
>
> (set-fontset-font "fontset-default" 'cyrillic-iso8859-5 (font-spec :font "7x13"))
>
> Can I get Emacs to use this font, or is it an Emacs bug?
From the command line font aliases are understood. 'emacs -Q -fn 7x13' should work
You can check the explicit name of the font in /usr/share/fonts/misc/fonts.alias
7x13 -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
7x13bold -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-1
7x13euro -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-15
7x13eurobold -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-15
What I have in .emacs is like:
(when (equal window-system 'x)
(set-face-font 'default "-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1"))
Since you want to display cyrillic I changed iso8859 (latin1) to
iso10646 (unicode) in the fontname.
PS: Not related to your question, but this is also worth checking for
setting a list of fonts and changing them on the fly with the keyboard:
Firefox-like zooming of fonts.
http://www.emacswiki.org/emacs/CycleFontSizes
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Use 7x13 fixed X font for Cyrillic
2016-02-27 20:46 ` Javier
@ 2016-02-27 22:53 ` Vladimir Panteleev
2016-02-27 23:23 ` Javier
0 siblings, 1 reply; 9+ messages in thread
From: Vladimir Panteleev @ 2016-02-27 22:53 UTC (permalink / raw)
To: help-gnu-emacs
On Saturday, February 27, 2016 at 8:46:49 PM UTC, Javier wrote:
> From the command line font aliases are understood. 'emacs -Q -fn 7x13' should work
Unfortunately that still produces 12x13 Cyrillic glyphs.
> You can check the explicit name of the font in /usr/share/fonts/misc/fonts.alias
>
> 7x13 -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
> 7x13bold -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-1
> 7x13euro -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-15
> 7x13eurobold -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-15
>
> What I have in .emacs is like:
>
> (when (equal window-system 'x)
> (set-face-font 'default "-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1"))
>
> Since you want to display cyrillic I changed iso8859 (latin1) to
> iso10646 (unicode) in the fontname.
I have the same in fonts.alias. However this still produces the same result:
emacs -Q -fn -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1
> PS: Not related to your question, but this is also worth checking for
> setting a list of fonts and changing them on the fly with the keyboard:
>
> Firefox-like zooming of fonts.
> http://www.emacswiki.org/emacs/CycleFontSizes
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Use 7x13 fixed X font for Cyrillic
2016-02-27 22:53 ` Vladimir Panteleev
@ 2016-02-27 23:23 ` Javier
2016-02-27 23:44 ` Javier
2016-02-28 5:20 ` Vladimir Panteleev
0 siblings, 2 replies; 9+ messages in thread
From: Javier @ 2016-02-27 23:23 UTC (permalink / raw)
To: help-gnu-emacs
> Unfortunately that still produces 12x13 Cyrillic glyphs.
Now I realize what it happens. Latin characters are in 7x13, but
Cyrillic appear in 12x13.
From (info "(emacs) Modifying Fontsets")
Fontsets do not always have to be created from scratch. If only minor
changes are required it may be easier to modify an existing fontset.
Modifying `fontset-default' will also affect other fontsets that use it
as a fallback, so can be an effective way of fixing problems with the
fonts that Emacs chooses for a particular script.
Fontsets can be modified using the function `set-fontset-font',
specifying a character, a charset, a script, or a range of characters
to modify the font for, and a font specification for the font to be
used. Some examples are:
This should do the job
;; Use 7x13 for unicode charset.
(set-fontset-font "fontset-default" 'unicode
"-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1")
In any case, it looks like a bug, emacs by default should not resort
by default to 12x13. The font 7x13 with iso10646-1 already contains
Cyrillic characters.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Use 7x13 fixed X font for Cyrillic
2016-02-27 23:23 ` Javier
@ 2016-02-27 23:44 ` Javier
2016-02-28 5:20 ` Vladimir Panteleev
1 sibling, 0 replies; 9+ messages in thread
From: Javier @ 2016-02-27 23:44 UTC (permalink / raw)
To: help-gnu-emacs
> In any case, it looks like a bug, emacs by default should not resort
> by default to 12x13. The font 7x13 with iso10646-1 already contains
> Cyrillic characters.
Or maybe it's not a bug. Emacs just does that because emacs has no
mechanism to tell which characters are missing in each of the hundreds
of fonts that come with the X distribution. Looks like a safe default
to be sure that non-latin characters are always displayed correctly
(at the cost of displaying them with a different size).
I don't know if there is a way to disable fallback fontsets and just
display everything with the same font.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Use 7x13 fixed X font for Cyrillic
2016-02-27 23:23 ` Javier
2016-02-27 23:44 ` Javier
@ 2016-02-28 5:20 ` Vladimir Panteleev
2016-02-28 15:52 ` Javier
1 sibling, 1 reply; 9+ messages in thread
From: Vladimir Panteleev @ 2016-02-28 5:20 UTC (permalink / raw)
To: help-gnu-emacs
On Saturday, February 27, 2016 at 11:23:58 PM UTC, Javier wrote:
> > Unfortunately that still produces 12x13 Cyrillic glyphs.
>
> Now I realize what it happens. Latin characters are in 7x13, but
> Cyrillic appear in 12x13.
>
> From (info "(emacs) Modifying Fontsets")
>
> Fontsets do not always have to be created from scratch. If only minor
> changes are required it may be easier to modify an existing fontset.
> Modifying `fontset-default' will also affect other fontsets that use it
> as a fallback, so can be an effective way of fixing problems with the
> fonts that Emacs chooses for a particular script.
>
> Fontsets can be modified using the function `set-fontset-font',
> specifying a character, a charset, a script, or a range of characters
> to modify the font for, and a font specification for the font to be
> used. Some examples are:
>
> This should do the job
>
> ;; Use 7x13 for unicode charset.
> (set-fontset-font "fontset-default" 'unicode
> "-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1")
Yes, thanks, that worked!
Is it possible to also apply this to characters such as », ·, ¢? They seem to have a similar problem, and they're all within the 128..255 code point range.
I've tried:
(set-fontset-font "fontset-default" '(128 . 255) "-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1")
..but that seems to have no effect.
I've discovered M-x describe-char, and for ¢ (the cent symbol) it shows:
position: 1669 of 2588 (64%), column: 0
character: ¢ (displayed as ¢) (codepoint 162, #o242, #xa2)
preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0xA2
script: latin
syntax: _ which means: symbol
category: .:Base, j:Japanese, l:Latin
to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
buffer code: #xC2 #xA2
file code: #xC2 #xA2 (encoded by coding system utf-8-unix)
display: by this font (glyph code)
xft:-Misc-Fixed-normal-normal-normal-ja-13-*-*-*-c-120-iso10646-1 (#x63)
Even though "preferred charset" is "unicode", it seems to prefer using a Japanese font for this symbol oddly enough.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Use 7x13 fixed X font for Cyrillic
2016-02-28 5:20 ` Vladimir Panteleev
@ 2016-02-28 15:52 ` Javier
0 siblings, 0 replies; 9+ messages in thread
From: Javier @ 2016-02-28 15:52 UTC (permalink / raw)
To: help-gnu-emacs
>> ;; Use 7x13 for unicode charset.
>> (set-fontset-font "fontset-default" 'unicode
>> "-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1")
>
> Yes, thanks, that worked!
>
> Is it possible to also apply this to characters such as », ·, ¢? They seem to have a similar problem, and they're all within the 128..255 code point range.
>
> I've tried:
>
> (set-fontset-font "fontset-default" '(128 . 255) "-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1")
>
> ..but that seems to have no effect.
You are right. Those characters (128-255) seem to be seen as not part
of unicode. And emacs displays them with another size.
https://en.wikipedia.org/wiki/Latin-1_Supplement_%28Unicode_block%29
There should be a way in graphical emacs to force the display of
*every* character with the same font, but I'm not aware of it.
But you can always use emacs -nw in a text window ;-)
rxvt -fn -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1 -e emacs -nw
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-02-28 15:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-27 1:59 Use 7x13 fixed X font for Cyrillic Vladimir Panteleev
2016-02-27 7:59 ` Eli Zaretskii
[not found] ` <mailman.6021.1456560027.843.help-gnu-emacs@gnu.org>
2016-02-27 20:26 ` Vladimir Panteleev
2016-02-27 20:46 ` Javier
2016-02-27 22:53 ` Vladimir Panteleev
2016-02-27 23:23 ` Javier
2016-02-27 23:44 ` Javier
2016-02-28 5:20 ` Vladimir Panteleev
2016-02-28 15:52 ` Javier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).