From: Kenichi Handa <handa@m17n.org>
To: Jason Rumney <jasonr@gnu.org>
Cc: yujie052@gmail.com, emacs-devel@gnu.org
Subject: Re: Ntemacs chooses wrong font.
Date: Wed, 11 Jun 2008 22:11:34 +0900 [thread overview]
Message-ID: <E1K6Q6w-0006Lq-S8@etlken.m17n.org> (raw)
In-Reply-To: <484FC664.1070403@gnu.org> (message from Jason Rumney on Wed, 11 Jun 2008 13:34:44 +0100)
In article <484FC664.1070403@gnu.org>, Jason Rumney <jasonr@gnu.org> writes:
> Kenichi Handa wrote:
> > I currently explicitly generate a unibyte string for font
> > names just to avoid the font name encoding problem until the
> > font-backend codes gets stable.
> Does that mean that the encoding will eventually be done in generic
> code, so I should avoid fixing this in w32font.c?
No. The encoding and decoding must be done in each font
backend because only the backend knows how to do that.
> > Emacs at first checks if a charater is supported by the
> > frame font (here "Monaco-10") to avoid unnecessary looking
> > up of fontset table . If supported, the frame font is used.
> > And, in your case, the font backend on Windows says that the
> > frame font supports it. That is the problem.
> The problem appears to be that the system API used in one of the
> encode_char functions on Windows (I don't know whether it is uniscribe
> or gdi) seems to return a space glyph for unsupported characters in some
> fonts, instead of 0 (which is ".notdef" according to the truetype spec).
It seems that this is a serious problem, but it's
unbelievable that Windows doesn't have a proper API to check
whether a font supports a specific character or not.
> Perhaps C-u C-x = should also report which font backend a font belongs
> to, to make tracking these sorts of bugs down easier.
Ok, I'll add that soon.
> > It seems that you saved the file with some of legacy
> > encoding (e.g. euc-cn, big5). On reading such a file, Emacs
> > adds a charset text-property (e.g. chinese-gb2312, big5),
> > and if a character has such a property, Emacs doesn't try
> > the frame font, but does a normal fontset looking up
> > (because `charset' information may change the priority of
> > fonts). So, your fontset setting above takes effect.
> >
> Ah, that explains a lot.
> > Perhaps, we should not try the frame font for a certain
> > group of charcters (e.g. han, indic, ??).
> >
> Where is the has_char function used? On Windows, this should work to
> filter out unsuitable fonts, as it checks the character against the
> font's supported scripts.
The has_char method is called in fontset_find_font (in
fontset.c) to decide that the selected font is usable for
a specific character.
---
Kenichi Handa
handa@ni.aist.go.jp
next prev parent reply other threads:[~2008-06-11 13:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 12:52 Ntemacs chooses wrong font Kevin Yu
2008-06-06 21:23 ` Jason Rumney
2008-06-07 2:41 ` Kevin Yu
2008-06-11 2:32 ` Kevin Yu
2008-06-11 8:36 ` Jason Rumney
2008-06-11 10:51 ` Kevin Yu
2008-06-11 11:27 ` Jason Rumney
2008-06-11 12:05 ` Kevin Yu
2008-06-11 12:40 ` Jason Rumney
2008-06-11 11:50 ` Kenichi Handa
2008-06-11 12:09 ` Kevin Yu
2008-06-11 12:29 ` Kenichi Handa
2008-06-11 12:34 ` Jason Rumney
2008-06-11 13:11 ` Kenichi Handa [this message]
2008-06-11 13:48 ` Juanma Barranquero
2008-06-16 21:37 ` Jason Rumney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1K6Q6w-0006Lq-S8@etlken.m17n.org \
--to=handa@m17n.org \
--cc=emacs-devel@gnu.org \
--cc=jasonr@gnu.org \
--cc=yujie052@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.