unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#73752: 29.4; Ligatures are randomly rendered with extra spaces
@ 2024-10-11 16:18 xuan
  2024-10-12  8:02 ` Eli Zaretskii
  2024-10-29 23:14 ` Tim Ruffing
  0 siblings, 2 replies; 90+ messages in thread
From: xuan @ 2024-10-11 16:18 UTC (permalink / raw)
  To: 73752

[-- Attachment #1: Type: text/plain, Size: 5970 bytes --]


Setup:

1. install `ligature.el` from melpa.

2. start `emacs -Q` and execute the attached script or simply use the attached script as the `init.el`.

3. open the attached `init.el` file and execute `init-faces` or hit "C-#" to start randomizing the font faces,

4. eventually you will see some characters gets rendered with extra spaces (sample screenshots provided below), hit "C-!" to stop the randomization,



5. hitting "C-return" will randomize font once, which might be useful for you find debug,



Expected behavior:

the fonts are rendered consistently without extra spacing,



Observed behavior:

the fonts are rendered with extra spacing randomly,



Related information:

I previously reported this bug here: https://github.com/mickeynp/ligature.el/issues/56.



In GNU Emacs 29.4 (build 1, x86_64-redhat-linux-gnu, GTK+ Version

3.24.42, cairo version 1.18.0) of 2024-07-16 built on 
27527c2e06f843c0962737354e0b3cf7 
System Description: Fedora Linux 40 (Sway) 

Configured using: 
'configure --build=x86_64-redhat-linux-gnu 
--host=x86_64-redhat-linux-gnu --program-prefix= 
--disable-dependency-tracking --prefix=/usr --exec-prefix=/usr 
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc 
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 
--libexecdir=/usr/libexec --localstatedir=/var --runstatedir=/run 
--sharedstatedir=/var/lib --mandir=/usr/share/man 
--infodir=/usr/share/info --with-cairo --with-dbus --with-gif 
--with-gpm=no --with-harfbuzz --with-jpeg --with-json --with-modules 
--with-native-compilation=aot --with-pgtk --with-png --with-rsvg 
--with-sqlite3 --with-tiff --with-tree-sitter --with-webp --with-xpm 
--with-xwidgets build_alias=x86_64-redhat-linux-gnu 
host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2 
-flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches 
-pipe -Wall -Werror=format-security 
-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 
-mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection 
-fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' 
LDFLAGS=-Wl,-z,relro 
PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig CXX=g++ 
'CXXFLAGS=-O2 -flto=auto -ffat-lto-objects -fexceptions -g 
-grecord-gcc-switches -pipe -Wall -Werror=format-security 
-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 
-mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection 
-fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '' 

Configured features: 
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON 
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY 
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF 
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB 

Important settings: 
value of $LANG: en_US.UTF-8 
locale-coding-system: utf-8-unix 

Major mode: ELisp/l 

Minor modes in effect: 
global-ligature-mode: t 
ligature-mode: t 
tooltip-mode: t 
global-eldoc-mode: t 
eldoc-mode: t 
show-paren-mode: t 
electric-indent-mode: t 
mouse-wheel-mode: t 
tool-bar-mode: t 
menu-bar-mode: t 
file-name-shadow-mode: t 
global-font-lock-mode: t 
font-lock-mode: t 
blink-cursor-mode: t 
line-number-mode: t 
indent-tabs-mode: t 
transient-mark-mode: t 
auto-composition-mode: t 
auto-encryption-mode: t 
auto-compression-mode: t 

Load-path shadows: 
None found. 

Features: 
(shadow sort mail-extr emacsbug message yank-media puny dired 
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config 
gnus-util text-property-search time-date mm-decode mm-bodies mm-encode 
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 
rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp comp-cstr warnings 
icons rx ligature cl-extra help-mode use-package-core ligature-autoloads 
package browse-url url url-proxy url-privacy url-expand url-methods 
url-history url-cookie generate-lisp-file url-domsuf url-util mailcap 
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs 
password-cache json subr-x map byte-opt gv bytecomp byte-compile 
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren 
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel 
term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset 
image regexp-opt fringe tabulated-list replace newcomment text-mode 
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch 
easymenu timer select scroll-bar mouse jit-lock font-lock syntax 
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic 
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese 
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek 
romanian slovak czech european ethiopic indian cyrillic chinese 
composite emoji-zwj charscript charprop case-table epa-hook 
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs 
theme-loaddefs faces cus-face macroexp files window text-properties 
overlay sha1 md5 base64 format env code-pages mule custom widget keymap 
hashtable-print-readable backquote threads xwidget-internal dbusbind 
inotify dynamic-setting system-font-setting font-render-setting cairo 
gtk pgtk multi-tty make-network-process native-compile emacs) 

Memory information: 
((conses 16 108675 14724) 
(symbols 48 8830 0) 
(strings 32 27784 2658) 
(string-bytes 1 906120) 
(vectors 16 22224) 
(vector-slots 8 441624 17378) 
(floats 8 45 30) 
(intervals 56 736 1) 
(buffers 984 12))  

[-- Attachment #2.1: Type: text/html, Size: 748 bytes --]

[-- Attachment #2.2: 83k2iR0RkF0vUnlj.png --]
[-- Type: image/png, Size: 5035 bytes --]

[-- Attachment #2.3: Type: text/html, Size: 189 bytes --]

[-- Attachment #2.4: vj0A4vBxR2UgLHU2.png --]
[-- Type: image/png, Size: 1199 bytes --]

[-- Attachment #2.5: Type: text/html, Size: 189 bytes --]

[-- Attachment #2.6: dknFd3G9YDiGAGQ9.png --]
[-- Type: image/png, Size: 1323 bytes --]

[-- Attachment #2.7: Type: text/html, Size: 189 bytes --]

[-- Attachment #2.8: uM000GtbhXhDurze.png --]
[-- Type: image/png, Size: 1330 bytes --]

[-- Attachment #2.9: Type: text/html, Size: 6959 bytes --]

[-- Attachment #2.10: init.el --]
[-- Type: application/octet-stream, Size: 3667 bytes --]

;; -*- lexical-binding: t; -*-
(setq inhibit-startup-screen t)

;; starting font
(setq default-font (font-spec :family "JetBrains Mono" :size 16 :weight 'regular))
(set-face-attribute 'default nil :width 'normal :weight 'normal :slant 'normal :font default-font)

(use-package ligature
  :config
  (ligature-set-ligatures 'prog-mode '("--" "---" "==" "===" "!=" "!==" "=!="
                              "=:=" "=/=" "<=" ">=" "&&" "&&&" "&=" "++" "+++" "***" ";;" "!!"
                              "??" "???" "?:" "?." "?=" "<:" ":<" ":>" ">:" "<:<" "<>" "<<<" ">>>"
                              "<<" ">>" "||" "-|" "_|_" "|-" "||-" "|=" "||=" "##" "###" "####"
                              "#{" "#[" "]#" "#(" "#?" "#_" "#_(" "#:" "#!" "#=" "^=" "<$>" "<$"
                              "$>" "<+>" "<+" "+>" "<*>" "<*" "*>" "</" "</>" "/>" "<!--" "<#--"
                              "-->" "->" "->>" "<<-" "<-" "<=<" "=<<" "<<=" "<==" "<=>" "<==>"
                              "==>" "=>" "=>>" ">=>" ">>=" ">>-" ">-" "-<" "-<<" ">->" "<-<" "<-|"
                              "<=|" "|=>" "|->" "<->" "<~~" "<~" "<~>" "~~" "~~>" "~>" "~-" "-~"
                              "~@" "[||]" "|]" "[|" "|}" "{|" "[<" ">]" "|>" "<|" "||>" "<||"
                              "|||>" "<|||" "<|>" "..." ".." ".=" "..<" ".?" "::" ":::" ":=" "::="
                              ":?" ":?>" "//" "///" "/*" "*/" "/=" "//=" "/==" "@_" "__" "???"
                              "<:<" ";;;"))
  (global-ligature-mode t))

;; ("\\\"o" ?ö)
;; ("^^+" ?⁺) ("__+" ?₊) ("^^-" ?⁻)
;; ("__0" ?₀) ("__1" ?₁) ("__2" ?₂) ("__3" ?₃) ("__4" ?₄)
;; ("__5" ?₅) ("__6" ?₆) ("__7" ?₇) ("__8" ?₈) ("__9" ?₉)
;; ("__a" ?ₐ) ("__e" ?ₑ) ("__h" ?ₕ) ("__i" ?ᵢ) ("__k" ?ₖ)
;; ("__l" ?ₗ) ("__m" ?ₘ) ("__n" ?ₙ) ("__o" ?ₒ) ("__p" ?ₚ)
;; ("__r" ?ᵣ) ("__s" ?ₛ) ("__t" ?ₜ) ("__u" ?ᵤ) ("__v" ?ᵥ) ("__x" ?ₓ))

(setq faces '((face1 . "--")
	      (face2 . "__")
	      (face3 . "=:=")
	      (face4 . "??")
	      (face5 . "<<")
	      (face6 . "#{")
	      (face7 . "$>")
	      (face8 . "-->")
	      (face9 . "==>")
	      (face10 . "<=|")
	      (face11 . "~@")
	      (face12 . "||>")
	      (face13 . "<:<")))

(defun init-faces ()
  (interactive)
  (dolist (face faces)
    (make-face (car face))
    (highlight-lines-matching-regexp (cdr face) (car face))
    (run-at-time nil 1 #'random-faces)))
  
(defun random-from-list (l)
  (nth (random (length l)) l))

(defun random-face (face)
  (interactive)
  (let* ((weight (random-from-list '(light normal medium bold)))
	 (slant (random-from-list '(normal italic)))
	 (height (random-from-list '(120 125 115 110 130)))
	 )
    (set-face-attribute face nil :weight weight :slant slant :height height)))

(defun random-faces ()
  (interactive)
  (dolist (face faces)
    (random-face (car face))))

(global-set-key (kbd "C-#") #'init-faces)
(global-set-key (kbd "C-!") (lambda () (interactive) (cancel-function-timers #'random-faces)))
(global-set-key (kbd "<C-return>") #'random-faces)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages '(ligature)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

[-- Attachment #2.11: Type: text/html, Size: 162 bytes --]

^ permalink raw reply	[flat|nested] 90+ messages in thread

end of thread, other threads:[~2024-11-08  8:08 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 16:18 bug#73752: 29.4; Ligatures are randomly rendered with extra spaces xuan
2024-10-12  8:02 ` Eli Zaretskii
2024-10-12 16:09   ` Yixuan Chen
2024-10-27 10:21     ` Eli Zaretskii
2024-10-27 16:19       ` Visuwesh
2024-10-27 17:19         ` Eli Zaretskii
2024-10-27 17:27           ` Eli Zaretskii
2024-10-27 17:39             ` Yixuan Chen
2024-10-27 17:43               ` Eli Zaretskii
2024-10-27 17:46                 ` Yixuan Chen
2024-10-27 19:14                   ` Eli Zaretskii
2024-10-27 19:36                     ` Yixuan Chen
2024-10-27 19:44                       ` Eli Zaretskii
2024-10-27 19:47                         ` Yixuan Chen
2024-10-27 20:11                           ` Eli Zaretskii
2024-10-27 19:41                     ` Yixuan Chen
2024-10-27 20:07                       ` Eli Zaretskii
2024-10-27 20:32                         ` Yixuan Chen
2024-10-28 14:25                           ` Eli Zaretskii
2024-10-28 14:44                             ` Yixuan Chen
2024-10-28 14:47                               ` Yixuan Chen
2024-10-28 15:05                               ` Eli Zaretskii
2024-10-28 15:20                                 ` Yixuan Chen
2024-10-28 17:19                                   ` Eli Zaretskii
2024-10-28 17:26                                     ` Eli Zaretskii
2024-10-28 17:28                                     ` Yixuan Chen
2024-10-28 18:41                                       ` Eli Zaretskii
2024-10-28  4:26             ` Visuwesh
2024-10-28 14:59               ` Eli Zaretskii
2024-10-28 15:24                 ` Yixuan Chen
2024-10-28 16:18                 ` Visuwesh
2024-10-28 17:13                   ` Eli Zaretskii
2024-10-29 10:59                     ` Visuwesh
2024-10-29 13:04                       ` Eli Zaretskii
2024-10-29 13:54                         ` Visuwesh
2024-10-29 14:00                           ` Visuwesh
2024-10-29 15:38                           ` Eli Zaretskii
2024-10-29 16:46                             ` Visuwesh
2024-10-29 17:45                               ` Eli Zaretskii
2024-10-30  5:43                                 ` Visuwesh
2024-10-29 16:51                             ` Eli Zaretskii
2024-10-27 17:29           ` Yixuan Chen
2024-10-29 23:14 ` Tim Ruffing
2024-10-30 15:12   ` Eli Zaretskii
2024-10-30 15:45     ` Eli Zaretskii
     [not found]     ` <mvmikt9zkcq.fsf@suse.de>
2024-10-30 15:47       ` Eli Zaretskii
2024-10-30 17:34         ` Tim Ruffing
2024-10-30 17:46           ` Eli Zaretskii
2024-10-30 18:00             ` Tim Ruffing
2024-10-30 18:57               ` Eli Zaretskii
2024-10-31  1:39                 ` Tim Ruffing
2024-10-31  2:36                   ` Yixuan Chen
2024-10-31  2:46                     ` Yixuan Chen
2024-10-31  7:44                       ` Eli Zaretskii
2024-10-31  9:42                   ` Eli Zaretskii
2024-11-01 17:05                     ` Eli Zaretskii
2024-11-02  3:34                       ` Tim Ruffing
2024-11-02  9:52                         ` Eli Zaretskii
2024-11-02 10:39                           ` Visuwesh
2024-11-02 12:07                             ` Eli Zaretskii
2024-11-02 13:29                               ` Visuwesh
2024-11-02 16:47                                 ` Eli Zaretskii
2024-11-02 17:04                                   ` Visuwesh
2024-11-02 17:18                                     ` Eli Zaretskii
2024-11-02 17:31                                       ` Visuwesh
2024-11-02 17:34                                         ` Eli Zaretskii
2024-11-02 17:39                                           ` Visuwesh
2024-11-02 17:44                                             ` Eli Zaretskii
2024-11-02 17:54                                               ` Visuwesh
2024-11-02 18:02                                                 ` Visuwesh
2024-11-02 18:27                                                   ` Eli Zaretskii
2024-11-04  0:11                                                     ` Tim Ruffing
2024-11-04 17:45                                                       ` Eli Zaretskii
2024-11-04 18:02                                                         ` Visuwesh
2024-11-04 23:33                                                         ` Tim Ruffing
2024-11-04 23:47                                                           ` Tim Ruffing
2024-11-06 12:02                                                           ` Tim Ruffing
2024-11-06 13:11                                                             ` Eli Zaretskii
2024-11-07  2:12                                                               ` Tim Ruffing
2024-11-07  7:05                                                                 ` Eli Zaretskii
2024-11-07 13:45                                                                   ` Visuwesh
2024-11-07 14:40                                                                     ` Eli Zaretskii
2024-11-07 15:13                                                                       ` Visuwesh
2024-11-07 15:49                                                                         ` Eli Zaretskii
2024-11-07 16:00                                                                           ` Visuwesh
2024-11-08  8:08                                                                       ` Eli Zaretskii
2024-11-06 14:50                                                         ` Visuwesh
2024-11-02 10:32                       ` Visuwesh
2024-10-31  8:12             ` Visuwesh
2024-10-31  9:43               ` Eli Zaretskii

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).