* bug#5503: Font choice in Emacs 23 does not match weight/traits
@ 2010-02-01 4:44 David Reitter
2016-08-18 5:04 ` Andrew Hyatt
0 siblings, 1 reply; 3+ messages in thread
From: David Reitter @ 2010-02-01 4:44 UTC (permalink / raw)
To: 5503
[-- Attachment #1: Type: text/plain, Size: 2436 bytes --]
The fonts chosen for non-latin (here: Asian) characters are not very similar to the face font.
For example, if "Lucida Grande" is selected as the frame's default font, the following:
DOUBLETはあなたと->世 界をつなげる翻訳会社です。
is displayed using a much to lightweight (skinny) font for all the non-Latin glyphs. The Hiragana portion at the beginning is set in PMingLiU, while the Kanji (Han script) is displayed in LiSung.
These fonts appear very thin compared to the Latin text.
This is despite there being the "Osaka" font present on my system, which is a medium-weight, very suitable font.
-apple-PMingLiU-medium-normal-normal-*-13-*-*-*-p-0-iso10646-1 (#x303)
-apple-Apple_LiSung-medium-normal-normal-*-13-*-*-*-p-0-iso10646-1 (#x7CD)
This is under NS, whereas I am not positive that this is actually due to NS.
This worked great on Emacs 22 - Osaka is chosen there [well, I have tried with Aquamacs].
I have received concrete complaints from users who say that they're not using Emacs 23 because of that.
The user also said that matching the font according to further traits (serif/sans) would be desirable/expected.
I advised the user of setting Osaka directly (which works), and of fontsets (which appear inappropriate for such simple use-cases in 2010).
For what it's worth, I have been trying to fix this myself.
So far I know that Osaka has 95% "han" script coverage and is returned among the list of (many) fonts in the font driver's "list" function.
It seems that exact weight and more specific traits are not being made available to Emacs by the NS font driver (e.g., nsfont.m:532, call to ns_descriptor_to_entity, last argument is NULL). Font weight should go into "ADSTYLE", which is one matching criterion in font_find_for_lface. font_select_entity() presumably doesn't have enough weight information.
ns_descriptor_to_entity() sets weight, but only to Qbold and Qmedium. If I comment some code in:
FONT_SET_STYLE (font_entity, FONT_WEIGHT_INDEX,
make_number (100 + 100
* ns_attribute_fvalue (desc, NSFontWeightTrait)));
.. then the "han" portion in the above examples is rendered with a matching font (LiGothic), but not any of the Hiragana text (still in PMingLiU).
FWIW, the AppKit port of 23 shows the same behavior as NS.
Again, Emacs 22 got it right - unfortunately I haven't managed to figure out how the Emacs 22 code works.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 203 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#5503: Font choice in Emacs 23 does not match weight/traits
2010-02-01 4:44 bug#5503: Font choice in Emacs 23 does not match weight/traits David Reitter
@ 2016-08-18 5:04 ` Andrew Hyatt
2016-08-18 8:51 ` David Reitter
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Hyatt @ 2016-08-18 5:04 UTC (permalink / raw)
To: David Reitter; +Cc: 5503
David Reitter <david.reitter@gmail.com> writes:
> The fonts chosen for non-latin (here: Asian) characters are not very similar to the face font.
>
> For example, if "Lucida Grande" is selected as the frame's default font, the following:
>
> DOUBLETはあなたと->世 界をつなげる翻訳会社です。
>
> is displayed using a much to lightweight (skinny) font for all the non-Latin glyphs. The Hiragana portion at the beginning is set in PMingLiU, while the Kanji (Han script) is displayed in LiSung.
>
> These fonts appear very thin compared to the Latin text.
> This is despite there being the "Osaka" font present on my system, which is a medium-weight, very suitable font.
>
> -apple-PMingLiU-medium-normal-normal-*-13-*-*-*-p-0-iso10646-1 (#x303)
> -apple-Apple_LiSung-medium-normal-normal-*-13-*-*-*-p-0-iso10646-1 (#x7CD)
>
> This is under NS, whereas I am not positive that this is actually due to NS.
>
> This worked great on Emacs 22 - Osaka is chosen there [well, I have tried with Aquamacs].
> I have received concrete complaints from users who say that they're not using Emacs 23 because of that.
> The user also said that matching the font according to further traits (serif/sans) would be desirable/expected.
>
> I advised the user of setting Osaka directly (which works), and of fontsets (which appear inappropriate for such simple use-cases in 2010).
>
> For what it's worth, I have been trying to fix this myself.
> So far I know that Osaka has 95% "han" script coverage and is returned among the list of (many) fonts in the font driver's "list" function.
>
> It seems that exact weight and more specific traits are not being made available to Emacs by the NS font driver (e.g., nsfont.m:532, call to ns_descriptor_to_entity, last argument is NULL). Font weight should go into "ADSTYLE", which is one matching criterion in font_find_for_lface. font_select_entity() presumably doesn't have enough weight information.
>
> ns_descriptor_to_entity() sets weight, but only to Qbold and Qmedium. If I comment some code in:
> FONT_SET_STYLE (font_entity, FONT_WEIGHT_INDEX,
> make_number (100 + 100
> * ns_attribute_fvalue (desc, NSFontWeightTrait)));
> .. then the "han" portion in the above examples is rendered with a matching font (LiGothic), but not any of the Hiragana text (still in PMingLiU).
>
> FWIW, the AppKit port of 23 shows the same behavior as NS.
> Again, Emacs 22 got it right - unfortunately I haven't managed to figure out how the Emacs 22 code works.
I actually responded to this bug several weeks ago, but for some reason
didn't reply-all, so it didn't get captured on this bug. Here's what I wrote:
I can't reproduce this in Emacs 25 on a Mac w / El Capitan. I get a nice
font for the Japanese - Hiragino Sans. Do you still see a problem when
you try?
I'll leave this bug open for a few more weeks to see if it gets any
response, but if no one can reproduce it I'll close it as
unreproducible.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#5503: Font choice in Emacs 23 does not match weight/traits
2016-08-18 5:04 ` Andrew Hyatt
@ 2016-08-18 8:51 ` David Reitter
0 siblings, 0 replies; 3+ messages in thread
From: David Reitter @ 2016-08-18 8:51 UTC (permalink / raw)
To: Andrew Hyatt; +Cc: 5503-done
On Aug 18, 2016, at 1:04 AM, Andrew Hyatt <ahyatt@gmail.com> wrote:
>> For example, if "Lucida Grande" is selected as the frame's default font, the following:
>>
>> DOUBLETはあなたと->世 界をつなげる翻訳会社です。
>>
>> is displayed using a much to lightweight (skinny) font for all the non-Latin glyphs. The Hiragana portion at the beginning is set in PMingLiU, while the Kanji (Han script) is displayed in LiSung.
> I can't reproduce this in Emacs 25 on a Mac w / El Capitan. I get a nice
> font for the Japanese - Hiragino Sans. Do you still see a problem when
> you try?
This bug was fixed since I originally reported it in 2010. The font engine in NS was replaced since then as far as I remember.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-18 8:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01 4:44 bug#5503: Font choice in Emacs 23 does not match weight/traits David Reitter
2016-08-18 5:04 ` Andrew Hyatt
2016-08-18 8:51 ` David Reitter
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).