[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does fontset work in emacs?

From: Peter Dyballa
Subject: Re: How does fontset work in emacs?
Date: Fri, 4 Jan 2013 22:31:40 +0100

Am 31.12.2012 um 03:14 schrieb winterTTr:

>   1. How to change the emacs default fontset to my own one, is it possible?

I wouldn't try that but create my own fontset – if necessary (because a good 
fonts service delivers what GNU Emacs requests). I created fontsets like this 
(and much more complicated):

    (create-fontset-from-fontset-spec "-b&h-lucida 
console-medium-r-*-*-9-*-*-*-*-*-fontset-09pt_lucida_console" t 'noerror)
        (set-fontset-font "fontset-09pt_lucida_console"       'latin-iso8859-1  
'("lucida console" . "iso8859-1"))
        (set-fontset-font "fontset-09pt_lucida_console"       'latin-iso8859-2  
'("lucida console" . "iso8859-2"))
        (set-fontset-font "fontset-09pt_lucida_console"       'latin-iso8859-3  
'("lucida console" . "iso8859-3"))
        (set-fontset-font "fontset-09pt_lucida_console"       'latin-iso8859-4  
'("lucida console" . "iso8859-4"))
        (set-fontset-font "fontset-09pt_lucida_console"    'cyrillic-iso8859-5  
'("lucida console" . "iso8859-5"))
        (set-fontset-font "fontset-09pt_lucida_console"       'latin-iso8859-9  
'("lucida console" . "iso8859-9"))
        (set-fontset-font "fontset-09pt_lucida_console"       'latin-iso8859-15 
'("lucida console" . "iso8859-15"))
        (set-fontset-font "fontset-09pt_lucida_console" 'mule-unicode-0100-24ff 
'("lucida console" . "iso10646-1"))
        (set-fontset-font "fontset-09pt_lucida_console" 'mule-unicode-2500-33ff 
'("lucida console" . "iso10646-1"))
        (set-fontset-font "fontset-09pt_lucida_console" 'mule-unicode-e000-ffff 
'("lucida console" . "iso10646-1"))

(I now rely on font service.) When you've done that you can then use 
initial-frame-alist and default-frame-alist to "bind" the fontset to the 
frames. (I do it now like that: (font . "Lucida Sans Typewriter-8").)

>   2. Is multi fontset works at the same time or only one fontset work? Why
>   my test code need to changedefault instead of mine?

At least it worked in GNU Emacsen 22 and 23 with more than one fontset. You 
just have to choose one and make it active in that frame. S-down-mouse-1 
(mouse-appearance-menu) will offer you a menu from which you can choose any of 
your defined fontsets.

>   3. The set-fontset-font second parameter is target, how can I know which
>   script name is suitable for the char under current cursor. I can use
>   describe-char to display the char information, but I don't find which
>   word in this description is the correct one for that target param.

I think the names, as based on the Character Blocks names in Unicode, are 
defined in the variable script-representative-chars.

>   4. Some points worthy of notice for font configuration in emacs?

Better use the well configured fonts service of your system!


                      ~  o
                      ~  O   O

reply via email to

[Prev in Thread] Current Thread [Next in Thread]