From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rodrigo Morales Newsgroups: gmane.emacs.help Subject: Re: [Question] How to change the height of the box for unprintable glyphs? Date: Wed, 15 May 2024 14:26:01 -0500 Message-ID: <87seyilvw6.fsf@rodrigomorales.site> References: <6aad61b5057ea92af6fd5f9daef953bc@rodrigomorales.site> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18370"; mail-complaints-to="usenet@ciao.gmane.io" To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 15 21:27:12 2024 Return-path: Envelope-to: geh-help-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 1s7KHQ-0004Vx-Iu for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 15 May 2024 21:27:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7KGX-0008DC-5C; Wed, 15 May 2024 15:26:17 -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 1s7KGU-0008Ci-A8 for help-gnu-emacs@gnu.org; Wed, 15 May 2024 15:26:14 -0400 Original-Received: from smtpout1.mo12.mail-out.ovh.ca ([51.161.45.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7KGP-0001Pu-P4 for help-gnu-emacs@gnu.org; Wed, 15 May 2024 15:26:14 -0400 Original-Received: from mxplan1.mail.ovh.ca (unknown [10.111.58.195]) by mo12.mail-out.ovh.ca (Postfix) with ESMTPS id 4VfjrD0kMXzHpvv for ; Wed, 15 May 2024 16:26:04 -0300 (ADT) Original-Received: from rodrigomorales.site (54.39.251.57) by DAG2EX1.mxpca1.local (172.16.2.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 15 May 2024 15:26:03 -0400 Authentication-Results: garm.ovh; auth=pass (GARM-95B002bfa9b478-2836-4d6a-877a-3c169bb897dc, 9430FB427A4A35C8BA01D3BD7E876FFBC3E15BA8) smtp.auth=me@rodrigomorales.site X-OVh-ClientIp: 190.232.101.8 In-Reply-To: <6aad61b5057ea92af6fd5f9daef953bc@rodrigomorales.site> X-Originating-IP: [54.39.251.57] X-ClientProxiedBy: DAG2EX1.mxpca1.local (172.16.2.11) To DAG2EX1.mxpca1.local (172.16.2.11) X-Ovh-Tracer-GUID: 9c96f899-727a-4ff1-af2c-e4d0608e4e3b X-Ovh-Tracer-Id: 885801755385142807 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdegkedgudefudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvufgjfhffkfggtgfgihesthhqredttddtjeenucfhrhhomheptfhoughrihhgohcuofhorhgrlhgvshcuoehmvgesrhhoughrihhgohhmohhrrghlvghsrdhsihhtvgeqnecuggftrfgrthhtvghrnhepieevfeejgfeutddvtdehffekleefffefheejleeggeffgfejvefhveekffduffegnecuffhomhgrihhnpegrrhgthhhivhgvrdhorhhgpddtgidtrdhsthenucfkphepuddvjedrtddrtddruddpheegrdefledrvdehuddrheejpdduledtrddvfedvrddutddurdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehmvgesrhhoughrihhgohhmohhrrghlvghsrdhsihhtvgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehhvghlphdqghhnuhdqvghmrggtshesghhnuhdrohhrghdpoffvtefjohhsthepmhhouddvpdhmohguvgepshhmthhp ohhuth Received-SPF: pass client-ip=51.161.45.254; envelope-from=me@rodrigomorales.site; helo=smtpout1.mo12.mail-out.ovh.ca X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146760 Archived-At: I think I have found what I was looking for. I searched occurences of the word =3Dglyphless=3D in the source code of Ema= cs and I found the variable =3Dglyphless-char-display-control=3D. This vari= able controls the handling of characters for which there is no font that ca= n display them. #+BEGIN_SRC text glyphless-char-display-control is a variable defined in =E2=80=98characters= .el=E2=80=99. Its value is ((format-control . thin-space) (variation-selectors . thin-space) (no-font . hex-code)) #+END_SRC I changed the cdr of =3Dno-font=3D from =3Dhex-code=3D to =3Dempty-box=3D a= s shown in the minimal Emacs configuration below. I used =3Dcustomize-set-v= ariable=3D because in the docstring of =3Dglyphless-char-display-control=3D= , I read that I should not set its value directly from Lisp because the var= iable takes effect via a custom =3D:set=3D. #+HEADER: :tangle ~/.config/emacs/init.el #+BEGIN_SRC elisp (set-fontset-font "fontset-startup" '(#x000000 . #x3FFFFF) "Unifont") (set-fontset-font "fontset-default" '(#x000000 . #x3FFFFF) "Unifont") (customize-set-variable 'glyphless-char-display-control '((format-control . thin-space) (variation-selectors . thin-space) (no-font . empty-box))) #+END_SRC I launched emacs using =3Demacs /tmp/a.txt=3D. The content of =3D/tmp/a.txt= =3D is shown below. #+HEADER: :tangle /tmp/a.txt #+BEGIN_SRC text Line 1: Hello! Line 2: =E4=BD=A0=E5=A5=BD=EF=BC=81 Line 3: =F0=91=82=A9=F0=91=82=B0=F0=91=82=A7=F0=91=82=A9=F0=91=82=B0=F0=91= =82=A7 ("Hello" in Kaithi, retrieved from HELLO buffer in GNU Emacs 29.3) #+END_SRC I evaluated =3D(line-pixel-height)=3D in the three lines and it returned = =3D16=3D in every line. [[http://web.archive.org/web/20240515192102/http://0x0.st/XKRd.png][This sc= reenshot]] shows the results returned by =3Dline-pixel-height=3D in the thr= ee lines with the following configuration: #+HEADER: :tangle ~/.config/emacs/init.el #+BEGIN_SRC elisp (set-fontset-font "fontset-startup" '(#x000000 . #x3FFFFF) "Unifont") (set-fontset-font "fontset-default" '(#x000000 . #x3FFFFF) "Unifont") #+END_SRC [[http://web.archive.org/web/20240515192227/http://0x0.st/XKRn.png][This sc= reenshot]] shows the results returned by =3Dline-pixel-height=3D in the thr= ee lines with the following configuration: #+HEADER: :tangle ~/.config/emacs/init.el #+BEGIN_SRC elisp (set-fontset-font "fontset-startup" '(#x000000 . #x3FFFFF) "Unifont") (set-fontset-font "fontset-default" '(#x000000 . #x3FFFFF) "Unifont") (customize-set-variable 'glyphless-char-display-control '((format-control . thin-space) (variation-selectors . thin-space) (no-font . empty-box))) #+END_SRC These are the sexps that I used in the two screenshots above: #+BEGIN_SRC elisp (with-selected-window (get-buffer-window "a.txt") (goto-line 1) (line-pixel= -height)) (with-selected-window (get-buffer-window "a.txt") (goto-line 2) (line-pixel= -height)) (with-selected-window (get-buffer-window "a.txt") (goto-line 3) (line-pixel= -height)) #+END_SRC