help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: getting unicode chars to show on Windows


From: Florian Beck
Subject: Re: getting unicode chars to show on Windows
Date: Fri, 28 Aug 2009 12:40:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Xah Lee <xahlee@gmail.com> writes:

> On Aug 26, 3:09 pm, Jason Rumney <jasonrum...@gmail.com> wrote:
>> On Aug 26, 7:35 pm, Xah Lee <xah...@gmail.com> wrote:
>>
>> > humm... it show for you Eli out of the box. Strange.
>>
>> Some fonts, particularly CJK ones which tend to cover a substantial
>> part of the BMP but have many gaps, seem to get in the way of (nearly)
>> full coverage fonts like Arial Unicode MS by default.
>>
>> > am guessing the problem really needs to be solved by some sort of font
>> > substitution. Browsers apparantly are all doing it and perfectly on my
>> > machine since they show all chars without user needing to set fonts.
>>
>> I don't know how the browsers are doing it, perhaps they come with
>> predefined lists of fonts that are commonly installed on Windows to
>> cover different ranges.
>>
>> > i guess in emacs that is fontset? I'm not sure if it is just fontset,
>> > or emacs also calls the OS's font api to complete part of the
>> > display...
>>
>> Yes, in Emacs that is a fontset, and the difference between what
>> people are reporting is caused by the fact that the default fontset
>> defines rules that are based on information other than the font name
>> by default.  If you know what fonts best support different characters
>> on your system, I'd recommend redefining the default fontset to use
>> your preferred fonts using (set-fontset-font t ... ...). There are
>> many examples of using this function in lisp/international/fontset.el,
>> along with a list of scripts that Emacs recognizes as the third
>> argument (in script-representative-chars); another simple one below:
>>
>> (set-fontset-font t 'phonetic "Lucida Sans Unicode")
>
> Thanks. Spent a couple of hours reading about emacs fonts... am still
> pretty much nowhere.... agh emacs.

Not sure what exactly your problem is, but here are a couple of pointers:

To figure out what character ranges, fonts, etc I need, I use this site:

http://www.alanwood.net/unicode/fontsbyrange.html

Then you simply specify the font you want for specific characters (like
Jason wrote), e.g.

(set-fontset-font t 'cherokee
  (font-spec :family "MPH 2B Damase" :size 24))

Instead of the script name 'cherokee you can also use a range '(5024 .
5119) or '(#x13A0 . #x13FF) or specify the first and last character '(?Ꭰ
. ?᏿).

After you have done this for the most important characters you can use
something like

(set-fontset-font t nil (font-spec :family "Code2000") nil 'prepend)

Called with 'prepend, set-fontset-font will only affect characters that
had no font previously, so you can use Code2000 as a fallback.

If you want to use several fontsets or start from scratch, the easiest
way is to define a fontset

(create-fontset-from-fontset-spec
  "-*-DejaVu Sans Mono-medium-r-normal-*-14-*-*-*-*-*-fontset-mono")

This fontset will be called fontset-mono, so you would use

(set-fontset-font "fontset-mono" 'cherokee
  (font-spec :family "MPH 2B Damase" :size 24))

to modify it.

Hope that helps.



  
  
-- 
Florian Beck




reply via email to

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