From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Greg A. Woods" Newsgroups: gmane.emacs.bugs Subject: bug#53924: 26.1; fontification sometimes fails for some characters despite available glyphs Date: Tue, 15 Feb 2022 18:32:23 -0800 Organization: Robo-Hacker Message-ID: References: <838ruitqu9.fsf@gnu.org> <834k55ub5u.fsf@gnu.org> <83k0dzq8y0.fsf@gnu.org> <83zgms2oso.fsf@gnu.org> Reply-To: "Greg A. Woods" , GNU Emacs Bug Reports <53924@debbugs.gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Tue_Feb_15_18:32:05_2022-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32533"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/26.1 (x86_64--netbsd) MULE/6.0 (HANACHIRUSATO) Cc: GNU Emacs Bug Reports <53924@debbugs.gnu.org> To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 16 03:33:10 2022 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 1nKA7x-0008BU-OH for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 16 Feb 2022 03:33:09 +0100 Original-Received: from localhost ([::1]:48718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKA7w-0007WI-Jm for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Feb 2022 21:33:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKA7q-0007W0-5w for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 21:33:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKA7p-0007P3-T4 for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 21:33:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKA7p-0007yo-P4 for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 21:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Greg A. Woods" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Feb 2022 02:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53924 X-GNU-PR-Package: emacs Original-Received: via spool by 53924-submit@debbugs.gnu.org id=B53924.164497875030624 (code B ref 53924); Wed, 16 Feb 2022 02:33:01 +0000 Original-Received: (at 53924) by debbugs.gnu.org; 16 Feb 2022 02:32:30 +0000 Original-Received: from localhost ([127.0.0.1]:47023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKA7J-0007xs-RF for submit@debbugs.gnu.org; Tue, 15 Feb 2022 21:32:30 -0500 Original-Received: from [198.96.117.51] (port=49258 helo=central.weird.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKA7H-0007xj-JQ for 53924@debbugs.gnu.org; Tue, 15 Feb 2022 21:32:27 -0500 Original-Received: from (invalid client hostname: bind: DNS error: DNS lookup for A for 'more.local': Unknown host)more.local ((no PTR matching greeting name)d207-6-82-137.bchsia.telus.net[207.6.82.137] port=56941) by central.weird.com([198.96.117.51] port=587) via TCP with esmtp (11348 bytes) (sender: ) (ident using UNIX) id for <53924@debbugs.gnu.org>; Tue, 15 Feb 2022 21:32:26 -0500 (EST) (Smail-3.2.0.122-Pre 2005-Nov-17 #1 built 2022-Feb-11) Original-Received: from more.local ([10.0.1.129] port=56942) by more.local([10.0.1.129] port=25) via TCP with esmtp (10862 bytes) (sender: ) id for <53924@debbugs.gnu.org>; Tue, 15 Feb 2022 18:32:23 -0800 (PST) (Smail-3.2.0.122-Pre 2005-Nov-17 #1 built 2022-Feb-11) In-Reply-To: <83zgms2oso.fsf@gnu.org> X-Face: ; j3Eth2XV8h1Yfu*uL{<:dQ$#E[DB0gemGZJ"J#4fH*][ lz; @-iwMv_u\6uIEKR0KY"=MzoQH#CrqBN`nG_5B@rrM8,f~Gr&h5a\= 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" Xref: news.gmane.io gmane.emacs.bugs:227022 Archived-At: --pgp-sign-Multipart_Tue_Feb_15_18:32:05_2022-1 Content-Type: text/plain; charset=ISO10646-1 Content-Transfer-Encoding: base64 Hopefully this message encodes properly, it should be text/plain, in the ISO10646-1 charset, with BASE64 encoding. Run "emacs -q" in the debugger, switch to the *scratch* buffer and insert the forms below, then: M-x eval-buffer Switch to the new *Font Families* buffer and scroll slowly through it. Depending on how many fonts you have installed, and how, and what kind of resources your system(s) have, this could take quite a long time. If that doesn't trigger a crash try going back to the beginning, increase the text scale with C-u C-x C-+ and scroll through again. This seems to reliably cause the crash for me, at least with the Git master version I have built using the lucid toolkit.. ================================================================ (defvar sample-text-history nil "History list for commands that read sample text.") (defvar ascii-sample-text ;; this default text is just ASCII ;; xxx should it be all of iso8859-1, but how to do that? ;; `encode-coding-string' ? "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 abcdefghijklmnopqrstuvwxyz `~!@#$%^&*()_+-={}|[]\\:\"\;'<>?,./" "all the ASCII printable characters for sample text.") (require 'faces) (setq list-faces-sample-text "~`´¨'\"1lIi|¦!¡/DØ0Oo{[(<«»>)]},.;:?¿ ©®aª2²3³8BuµpP¶#¤£$¢¥°.·,¸±+=¬~_-- ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789 abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ !\"#$%&'()*+,-./:;<->?[\\]^_`{|}~  ¡¢£¤¥¦§¨©ª«¬-®¯°±²³´µ¶·¸¹º»¼½¾¿ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ αβγδεζηθικλμνξοπρςτυφχψω АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ абвгдеёжзийклмнопрстуфхцчшщъыьэюя –―†‡•…‰™ᴂfiœᴈŠŸž€ ☺☹✝✚✡☥⎈☭☪∀∂∈ℝ∧∪∞π↑↗↨↻⇣┐┼╔╘►⑀₂ἠḂӥẄɐː⍎אԱა� ⌈⌉⌊⌋∏∑∫⊕⊖⊗⊘⊙⊚⊛∙∘′″‴∼∂√≔ⁱ⁰₀₁₂∧∨∃⊦∅∈∉⊂⊃⊆⊇⊄⋂⋃ ※◆░▒␉␌␍␊␤␋┘┐┌└┼⎺⎻─⎼⎽├┤┴┬│≤≥≮≯≠≈≡£₿₠∎ ‹›“”‘’„〖〗【】「」『』〈〉《》〔〕 •◦‣✓●■◆○□◇★☆♠♣♥♦♤♧♡♢♩♪♫♬♭♮♯☰☱☲☳☴☵☶☷ ←→↑↓↔↖↗↙↘⇐⇒⇑⇓⇔⇗⇦⇨⇧⇩↞↠↟↡↺↻☞☜☝☟ ☠☢☣☤♲♳⌬♨♿☉☼☾☽♀♂☯♔♕♖♗♘♙♚♛♜♝♞♟ に日本語を入れておくとよろしい。 林花謝了春紅 太匆匆, 無奈朝來寒雨 晚來風 胭脂淚 留人醉 幾時重, 自是人生長恨 水長東") (require 'seq) (defun show-all-font-families (&optional sample-text mono-only) "Show SAMPLE-TEXT (by default `list-faces-sample-text') in 'roman', 'bold', 'italic', and 'bold italic' for each font family known to `font-family-list'. If MONO-ONLY, include ':spacing m' in the `font-spec' parameters. Interactively, a negative prefix does the same. Note you can seem some strange results for fonts that don't have each of the requested weight and slant forms. Sometimes proportional glyphs will even be substituted for mono-spaced glyphs! Sometimes a glyph from a different font (the default font?) will be substituted even when the requested font is available with all the requested attributes, e.g. 'office code pro'. (Perhaps because it is _only_ avaliable with the requested attributes, but no others?) Also some proportional fonts will show up despite only mono-spaced fonts being selected. Perhaps spacing is ignored when requesting a font? Note even `x-list-fonts' warns that: Fonts Emacs can't use may or may not be excluded... N.B. WARNING: This code may try to display fonts that cannot be opened and as a result will crash Emacs! Worse yet it can get stuck rendering fonts and if killed cause the X11 server to go into a CPU-bound loop that may take hours to resolve! Kill it sooner than later! This is particularly true for Emacs-26.1 when the MONO-ONLY parameter is non-nil. See also the exclusion of the 'droid' fonts. Derived from an example on the EmacsWiki." (interactive (list ;; optional `sample-text': (if current-prefix-arg (read-string "Sample text: " ascii-sample-text 'sample-text-history)) ;; optional `mono-only': (cond ((eq current-prefix-arg '-) t) ((and (numberp current-prefix-arg) (< current-prefix-arg 0)) t) ((and (listp current-prefix-arg) (numberp (car current-prefix-arg)) (< (car current-prefix-arg) 0)) t) (t nil)))) (let ((str (if sample-text sample-text list-faces-sample-text)) (font-families (seq-uniq ;; note: the list is reversed so that font text is ;; inserted in the demo buffer the right order (sort (font-family-list) (lambda(x y) (string> (upcase x) (upcase y)))) (lambda(x y) (string= (upcase x) (upcase y)))))) (with-help-window "*Font Families*" (with-current-buffer standard-output (dolist (ff font-families) (let* ((fs (font-spec :family ff ; :weight 'medium :slant 'r ;; xxx :spacing is confusing ;; see below for additional test to confirm! (if mono-only :spacing) (if mono-only 'm) :dpi (round (/ (display-pixel-height) (/ (display-mm-height) 25.4))) :registry 'iso10646-1)) (fl (list-fonts fs)) (fe (car fl)) ; usually the cdr is non-scalable? (xlfd (if fe (font-xlfd-name fe) (font-xlfd-name fs))) ; xxx font may not be useable (fn (if (eq window-system 'x) (condition-case nil (x-resolve-font-name xlfd) (error (message "Invalid font family: %s" ff) nil)) nil)) (xlfd-fields (if fn (x-decompose-font-name fn) ; xxx not really an X11 function nil)) ) ;; XXX the "droid*" fonts are broken??? (if (and (not (string-match "droid" ff)) ; (not (string-equal "inconsolata" ff)) ; xxx may crash Emacs!!! (not (string-equal "nil" ff)) ; xxx never a useful font ; (not (string-match "italic" ff)) ; xxx rarely in all other styles ; (not (string-match "bold" ff)) ; xxx rarely in all other styles (not (string-match ".pcf" ff)) ; xxx usually bitmap cursors ;; ;; xxx some fonts, e.g. "inconsolata" (which xfontsel says ;; is both 'm' and 'p'), will return the "wrong" spacing in ;; the XLFD if the request has a wild-card (i.e. :spacing ;; unspecified), but then it can't be found with ;; `font-info' with the explicit ":spacing 'p". ;; (condition-case nil (if (font-info xlfd) ; xxx can this also return nil? t (message "Can't get font info for: %s" xlfd) nil) (error (message "Bad font: %s" xlfd) nil)) (if mono-only (if xlfd-fields ;; because `x-resolve-font-name' sometimes ignores ;; `:spacing' we must confirm the font matches ;; xxx `xlfd-regexp-spacing-subnum' is WRONG, for 20 years! (if (string-equal (aref xlfd-fields 9) "m") t (message "Font not actually monospaced: %s" xlfd) nil) ;; xxx try `font-get' on `fe', but that doesn't seem to ;; work properly for getting `:spacing'!?!?!?!? (if (eq window-system 'x) (message "Can't resolve X font for: %s" xlfd))) t)) (progn (message "Inserting text for font: %s" xlfd) ;; xxx XXX N.B.: without escaping the semicolons emacs can't ;; parse these expressions backwards!!! (insert "\; " ff ":" xlfd "\n\;\n" "\;\t" ff " (plain):\n\;\n" (propertize str 'font-lock-face `(:family ,ff :weight medium :slant r)) "\n\;\n\;\t" ff " [bold]:\n\;\n" (propertize str 'font-lock-face `(:family ,ff :weight bold :slant r)) "\n\;\n\;\t " ff " [italic]:\n\;\n" (propertize str 'font-lock-face `(:family ,ff :weight medium :slant italic)) "\n\;\n\;\t " ff " [bold italic]:\n\;\n" (propertize str 'font-lock-face `(:family ,ff :weight bold :slant italic)) "\n\;\n \n")) (message "Not showing font-family: %s" ff))) (goto-char (point-min)) (setq case-fold-search t) (if (fboundp 'form-feed-mode) (form-feed-mode nil))))))) (show-all-font-families nil t) ================================================================ -- Greg A. Woods Kelowna, BC +1 250 762-7675 RoboHack Planix, Inc. Avoncote Farms --pgp-sign-Multipart_Tue_Feb_15_18:32:05_2022-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit Content-Description: OpenPGP Digital Signature -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQTWEnAIIlcZX4oAawJie18UwlnHhQUCYgxiKAAKCRBie18UwlnH hVJhAKDKSTGWGzRc0rcNPi15Na+eKpu6VwCgrUHMBMnNZYhuHJpIMOt5XCfzgB0= =mia3 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Tue_Feb_15_18:32:05_2022-1--