From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eason Huang Newsgroups: gmane.emacs.bugs Subject: bug#64780: 30.0.50; set-face-attribute can not set the medium weight of IBM Plex Mono on Windows 10 Date: Sat, 22 Jul 2023 15:21:46 +0800 Message-ID: References: <83cz0ka449.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31678"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 64780@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 22 09:29:10 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qN737-000857-MV for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Jul 2023 09:29:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qN732-0006qQ-GZ; Sat, 22 Jul 2023 03:29:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qN730-0006q1-EP for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 03:29:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qN730-0002hj-6P for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 03:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qN730-0000LO-28 for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 03:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eason Huang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Jul 2023 07:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64780 X-GNU-PR-Package: emacs Original-Received: via spool by 64780-submit@debbugs.gnu.org id=B64780.16900108981273 (code B ref 64780); Sat, 22 Jul 2023 07:29:02 +0000 Original-Received: (at 64780) by debbugs.gnu.org; 22 Jul 2023 07:28:18 +0000 Original-Received: from localhost ([127.0.0.1]:35382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qN72I-0000KS-0S for submit@debbugs.gnu.org; Sat, 22 Jul 2023 03:28:18 -0400 Original-Received: from out203-205-221-221.mail.qq.com ([203.205.221.221]:51124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qN72C-0000KA-Q7 for 64780@debbugs.gnu.org; Sat, 22 Jul 2023 03:28:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1690010879; bh=nYwn/VxP1hsX6xfpXJFWhQawNvslk6PcAspw6vT85O8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=MI3SnksW9l+zJyArZ60m459hFfa0yl9vHNQutlakk1ejFej3aRJG0jt0lza/aiG36 6IcfDCkr5LyAvYvLBCDOjII5vvnGxvA1fZrOX3uLRSEK/F/fF7OEL/hXG1JZrfV6pn XOmgDnKVyVMBYAB73Pc86p3nbyrgP2JIvZXfxzxY= Original-Received: from macbook ([114.82.34.133]) by newxmesmtplogicsvrszc2-0.qq.com (NewEsmtp) with SMTP id 57199683; Sat, 22 Jul 2023 15:21:49 +0800 X-QQ-mid: xmsmtpt1690010509t1ihu6dph X-QQ-XMAILINFO: OZb8h1NDX1ukfNRFz7dbUQHRigYFgU/pP6krK86JjNbV2ztSaF2VzmNqwRyOQ+ NGKxvyhbJ9cUfr+eVNzqYjpmTalR9r9+7WcfVVfsAAiEtXEpsTRzghwRSnG8/HqwqDIkJ9PM9/am p2+3UBaNhSUYqGN4zYRHwNVI5I6NoWeqwTSwYfUV93mkLPZjRwK0U3HYhGAJbNs3Vtb0yECXFkJH iFmm+sU3iHuTSBxTkWQtaomC/re280EDt/3AQpLQJ2YCn1sIQNfEbM45/4B/YBQ15rU9skhyMEAe zxUeOD5Jbdws11cIgel/btzXx/6wnapMZv7VCcaW5DQEAdAMGg8BWGqGfnQJvPyELlL+SbgJhkG3 67qyAwoiFdiaW1mKh/XzsvafRrauJDmfE6dZweLZVBgC123Lenyiej8riDTp0a32I9kDkPDEUHfo A8zjMuXszUw5c+g94lcqu9uABCTKU+1iCRXWAKEjgSOKxnkgxByAarkfJQbYiovKjNjAi/3OpLZC ODhsaV03h/uG7XwW2qnMWs4EcsoZlm7pZbwa2ElEre/EmJjZrmUNcA168Z+iQ5N0Q2lQ8deTZrIR wHJD5hZUhXI16nq+aO1BZwkOiptPLVu+cXsyXnQYwaQWaFLU8tMDnVrrpn0RGuLInGNZgy3jrcip xGD5GkDX80HMBlmtiVxhRjZnT/nkgf8I9qQLwBqU2R7XMJQFlnbpingcKCUn89vruYzIc6G5DT2q +9Ge933LTSct2dUcD8YZI/+jXiueJV13jYLSOG4Rk+jodx3ZStksaaFJkwIzZKvVik58XUlyIkEf RBzH+Tat479cogrBjzXMwwC8lJNoZC+hWwFn49AC X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= In-Reply-To: <83cz0ka449.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 22 Jul 2023 08:48:22 +0300") Original-Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265786 Archived-At: Eli Zaretskii writes: >> From: Eason Huang >> Date: Sat, 22 Jul 2023 09:23:28 +0800 >> >> I tried to use the medium weight of IBM Plex Mono font on Windows 10, >> and find that `set-face-attribute` can not make it works as expectd. >> >> Steps to reproduce: >> >> 1. Download IBM Plex Mono font by this link: >> https://github.com/IBM/plex/releases/download/v6.3.0/TrueType.zip >> 2. Unzip the TrueType.zip and install the IBM Plex Mono >> 3. Start Emacs with `emacs -Q` >> 4. In the `*scratch*` buffer, eval the code below: >> ``` >> (set-face-attribute 'default nil :font (format >> "%s:pixelsize=%d:weight=medium" "IBM Plex Mono" 20)) >> >> ``` >> 5. `M-x describe-char`, will get info about font as below: >> harfbuzz:-outline-IBM Plex Mono-regular-normal-normal-mono-20-*-*-*-c-*-iso8859-1 (#x03) >> >> And you can see the regular weight is used instead. > > Emacs on MS-Windows doesn't fully support any weights except these 4 > standard ones: regular, italic, bold, bold-italic. AFAIU, it is a > limitation of the APIs we use on Windows to enumerate font families. Thanks for your explanation. >> The workaround recently I used: >> >> ``` >> (set-face-attribute 'default nil :font (format >> "%s:pixelsize=%d:weight=medium" "IBM Plex Mono Medm" 20)) >> ``` >> `M-x describe-char`, will get info about font as below: >> harfbuzz:-outline-IBM Plex Mono Medm-medium-normal-normal-mono-20-*-*-*-c-*-iso8859-1 (#x18) >> >> But use the `IBM Plex Mono Medm` name is not convenient for me, because >> I also want to switch to other weights sometimes, such as: >> >> ``` >> (set-face-attribute 'default nil :font (format "%s:pixelsize=%d:weight=regular" "IBM Plex Mono" 20)) >> (set-face-attribute 'default nil :font (format "%s:pixelsize=%d:weight=bold" "IBM Plex Mono" 20)) >> ``` >> It would be more consistent If we can use the `IBM Plex Mono` font name >> with all font weights. > > Yes, those are all aspects of the above limitation. You could > configure the other faces (bold, italic, and bold-italic) explicitly > to use the specific members of this font's family, like you did with > the default face and the medium weight, but the basic problem I > explained above will from time to time rear its ugly head and produce > some unexpected results, when Emacs mutates a font to produce another > weight of the same family. Thanks for mention the potential risk. So I will just use the regular weight on Windows if encounter issue. -- Eason Huang