[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/show-font 0d35840ce2 28/54: Rework show-font--prepare-t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/show-font 0d35840ce2 28/54: Rework show-font--prepare-text in light of commit 19a95c1 |
Date: |
Tue, 10 Sep 2024 03:58:58 -0400 (EDT) |
branch: externals/show-font
commit 0d35840ce25b589cc65d06459c814f66f0fac732
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Rework show-font--prepare-text in light of commit 19a95c1
---
show-font.el | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/show-font.el b/show-font.el
index c722cb6e0c..d554d7358c 100644
--- a/show-font.el
+++ b/show-font.el
@@ -237,15 +237,18 @@ FAMILY is a string like those of
`show-font--get-installed-font-families'."
(t
"No string or acceptable symbol value for `show-font-pangram', but this
will do...")))
-(defun show-font--prepare-text ()
- "Prepare pangram text at varying font heights."
+(defun show-font--prepare-text (&optional family)
+ "Prepare pangram text at varying font heights for the current font file.
+With optional FAMILY, prepare a preview for the given font family
+instead of that of the file."
(let* ((pangram (show-font--get-pangram))
(appeasement-message (concat "But here is a pangram to make you
happy..." "\n\n" pangram)))
(cond
((not (display-graphic-p))
(concat (propertize "Fonts cannot be displayed in a terminal or TTY."
'face 'show-font-title)
"\n\n" appeasement-message))
- ((not (show-font--installed-p buffer-file-name))
+ ((and (not family)
+ (not (show-font-installed-file-p buffer-file-name)))
(concat (propertize "Cannot preview this font" 'face 'show-font-title)
"\n\n"
(propertize buffer-file-name 'face 'bold)
@@ -255,8 +258,8 @@ FAMILY is a string like those of
`show-font--get-installed-font-families'."
(let ((faces '(show-font-small show-font-regular show-font-medium
show-font-large))
(list-of-lines nil)
(list-of-blocks nil)
- (name (show-font--get-attribute "fullname"))
- (family (show-font--get-attribute "family")))
+ (name (or family (show-font--get-attribute "fullname")))
+ (family (or family (show-font--get-attribute "family"))))
(dolist (face faces)
(push (propertize pangram 'face (list face :family family))
list-of-lines)
(push (propertize show-font-character-sample 'face (list face
:family family)) list-of-blocks))
@@ -264,12 +267,15 @@ FAMILY is a string like those of
`show-font--get-installed-font-families'."
(propertize name 'face (list 'show-font-title :family family))
"\n"
(make-separator-line)
- "\n"
- (propertize "Rendered with parent family:" 'face (list
'show-font-regular :family family))
- "\n"
- (propertize family 'face (list 'show-font-subtitle :family family))
- "\n"
- (make-separator-line)
+ (if (not (equal name family))
+ (concat
+ "\n"
+ (propertize "Rendered with parent family:" 'face (list
'show-font-regular :family family))
+ "\n"
+ (propertize family 'face (list 'show-font-title-small :family
family))
+ "\n"
+ (make-separator-line))
+ "")
"\n"
;; Why not use `make-separator-line' here?
(mapconcat #'identity (nreverse list-of-lines) "\n") "\n"
- [elpa] externals/show-font 3be8056ae5 24/54: Stop using show-font-extensions-regexp; define regexp directly, (continued)
- [elpa] externals/show-font 3be8056ae5 24/54: Stop using show-font-extensions-regexp; define regexp directly, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font b1a9d8a5cc 07/54: Remove needless 'let' before the 'when-let', ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 2d04283d8e 31/54: Add revert-buffer-function for show-font-select-preview, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 7bd66d3105 39/54: Add FIXME to refine show-font-list output, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font ad30c77b06 42/54: Remove WIP notices, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 0f46562e42 51/54: Make sure to delete duplicates and sort fonts, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 683d5ab4d1 49/54: Mention links to the Info manual and web page in the defgroups, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font ff0251d565 19/54: Remove the function that shows the font from the major mode, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font c8f889d12a 11/54: Define helper functions to get installed fonts and check for one among them, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font a65e7a242a 27/54: Add more helpers to check for installed fonts, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 0d35840ce2 28/54: Rework show-font--prepare-text in light of commit 19a95c1,
ELPA Syncer <=
- [elpa] externals/show-font 67eff98c59 30/54: Remove outdated comment, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font e654040756 32/54: Fix a typo, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 3695bfb838 38/54: Add error condition to show-font-select-preview, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 3056fc8aed 41/54: Add doc string to show-font-select-preview-history, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 8ef7327eb2 37/54: Remove clarified FIXME, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 7d2145e5bf 46/54: Write the show-font manual, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font c66456b2f3 40/54: Autoload the show-font-list command, ELPA Syncer, 2024/09/10