From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andrew Hyatt Newsgroups: gmane.emacs.bugs Subject: bug#5503: Font choice in Emacs 23 does not match weight/traits Date: Thu, 18 Aug 2016 01:04:39 -0400 Message-ID: References: <5E320729-F909-4BEA-ACD1-0A23E35552A7@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1471496724 13498 195.159.176.226 (18 Aug 2016 05:05:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Aug 2016 05:05:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin) Cc: 5503@debbugs.gnu.org To: David Reitter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 18 07:05:20 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1baFW1-0003Bg-TF for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Aug 2016 07:05:18 +0200 Original-Received: from localhost ([::1]:50758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baFVz-0005Z7-5e for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Aug 2016 01:05:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baFVs-0005Wk-Gy for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2016 01:05:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1baFVm-0004Q2-EG for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2016 01:05:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baFVm-0004PQ-AE for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2016 01:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1baFVl-00088O-KV for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2016 01:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Hyatt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Aug 2016 05:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5503 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5503-submit@debbugs.gnu.org id=B5503.147149668731243 (code B ref 5503); Thu, 18 Aug 2016 05:05:01 +0000 Original-Received: (at 5503) by debbugs.gnu.org; 18 Aug 2016 05:04:47 +0000 Original-Received: from localhost ([127.0.0.1]:60717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1baFVX-00087q-DL for submit@debbugs.gnu.org; Thu, 18 Aug 2016 01:04:47 -0400 Original-Received: from mail-qk0-f176.google.com ([209.85.220.176]:36775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1baFVW-00087d-Kf for 5503@debbugs.gnu.org; Thu, 18 Aug 2016 01:04:46 -0400 Original-Received: by mail-qk0-f176.google.com with SMTP id l2so7052382qkf.3 for <5503@debbugs.gnu.org>; Wed, 17 Aug 2016 22:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=7/rsnVSCmGaPhCSxk8CpRG2aTF2nvVX/5yUEWLmWSxo=; b=AY3XKPRTEGxmTKqwYxYGJGe9mzx1vHLg7Pb6pKGQsTzCNj4a4HfdWfvfGpxN/llplI EINwZBOkfBt9Ko0U2R+E+RKN4NyS8IaXa45eZialcW9s5KpboOvPPUTzwwMmcA29vwkK JnP4a5gpkcg3vdXlbRB1DLDxN2KHs2NG5G9x6x4/QDK67MU9dKwMjETJHjtb6f+KuaO4 xTq3eXCsbWooFQSb+O1mKpoaCn6DDAkiDfMnt/9HcacZDVaPcBj00a4r2LZLbKe7UYCx pvdHWv2bxltwK07Xhb72LXVyUB5sGhZal4jcgxABMtzmiIsOws0OoT/m0R2uc7uPm4Jv lIdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=7/rsnVSCmGaPhCSxk8CpRG2aTF2nvVX/5yUEWLmWSxo=; b=ay8qBtpCQFFsHIPLH1w3hvTCcbZDXXJyMtbN98h9YjvsdWpeiyU6g5nl/dVcSiYL0B +rKBxNQY8QuMSE6G3AZ4VQP1uyZqZnKtWAW3IrKK6vLa8sGhj6ltP9Y19cg2I7351Fkp tfDRTBt8q+38zriEZvJWgbA3ByGhAjmcQBtLnQHnDtF1vY7pAR7TAaWpAytRRPbIVk/l IbIXilT5JNc5kcJ7//5r2o1WfkOGjCQ+VxvSVuJz14fNvlIYVuAfzovQ6WVUlt/sbcqV a6lVG4/T0OQ9O1dtiH3RvuiN+28foiM53jW4BtdCCmLixuOI8OCPtwv/b36o713Aal8p sA+A== X-Gm-Message-State: AEkoouvaqY4Gv00eqYhRxrvtiyWDjQfc7DaFu+F9vhAE5S7RGWxoAxqpKTmi01ms5ysApQ== X-Received: by 10.55.127.197 with SMTP id a188mr307429qkd.150.1471496681247; Wed, 17 Aug 2016 22:04:41 -0700 (PDT) Original-Received: from Andrews-MacBook-Pro.local (cpe-74-73-128-199.nyc.res.rr.com. [74.73.128.199]) by smtp.gmail.com with ESMTPSA id o131sm177862qke.20.2016.08.17.22.04.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Aug 2016 22:04:40 -0700 (PDT) In-Reply-To: <5E320729-F909-4BEA-ACD1-0A23E35552A7@gmail.com> (David Reitter's message of "Sun, 31 Jan 2010 23:44:49 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122343 Archived-At: David Reitter writes: > The fonts chosen for non-latin (here: Asian) characters are not very simi= lar to the face font. > > For example, if "Lucida Grande" is selected as the frame's default font, = the following: > > DOUBLET=E3=81=AF=E3=81=82=E3=81=AA=E3=81=9F=E3=81=A8->=E4=B8=96 =E7=95=8C= =E3=82=92=E3=81=A4=E3=81=AA=E3=81=92=E3=82=8B=E7=BF=BB=E8=A8=B3=E4=BC=9A=E7= =A4=BE=E3=81=A7=E3=81=99=E3=80=82 > > is displayed using a much to lightweight (skinny) font for all the non-La= tin glyphs. The Hiragana portion at the beginning is set in PMingLiU, whil= e 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 u= sing Emacs 23 because of that.=20=20 > The user also said that matching the font according to further traits (se= rif/sans) would be desirable/expected. > > I advised the user of setting Osaka directly (which works), and of fontse= ts (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 am= ong 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 av= ailable to Emacs by the NS font driver (e.g., nsfont.m:532, call to ns_desc= riptor_to_entity, last argument is NULL). Font weight should go into "ADST= YLE", 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 matchi= ng 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 wro= te: 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.