all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#36014: Allow console-font service to use fonts other than those packaged with kbd
@ 2019-05-30 19:21 John Soo
  2019-07-11 14:27 ` bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed John Soo
  0 siblings, 1 reply; 8+ messages in thread
From: John Soo @ 2019-05-30 19:21 UTC (permalink / raw)
  To: 36014

The console font service only allows fonts installed by default in the kbd package (tamzen, for instance, has a nice bitmap font available). I don’t know what the solution might be. I do know that setfont looks in the default font directory only for fonts and the available fonts are those that come packaged with the kbd package. 

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

* bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed
  2019-05-30 19:21 bug#36014: Allow console-font service to use fonts other than those packaged with kbd John Soo
@ 2019-07-11 14:27 ` John Soo
  2019-07-11 20:49   ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: John Soo @ 2019-07-11 14:27 UTC (permalink / raw)
  To: 36014


[-- Attachment #1.1: Type: text/plain, Size: 360 bytes --]

Hi maintainers,

I looked hard at a nicer way to provide a flag to start kbd pointing to a
directory or file. There is a flag to point to a file for a font which
could be nice. However setfont also prioritizes the current directory over
the kbd directory. The following patch attempts to chdir to a directory
where more console fonts may be installed.

- John

[-- Attachment #1.2: Type: text/html, Size: 441 bytes --]

[-- Attachment #2: 0001-gnu-Try-using-any-system-installed-console-fonts.patch --]
[-- Type: text/x-patch, Size: 1112 bytes --]

From 15aa08d212ecea31adcd86f922c0f68297cd423a Mon Sep 17 00:00:00 2001
From: John Soo <jsoo@panosoft.com>
Date: Wed, 10 Jul 2019 06:51:41 -0700
Subject: [PATCH] gnu: Try using any system installed console fonts.

---
 gnu/services/base.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 537d30add5..60d03df9ed 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -775,6 +775,13 @@ to add @var{device} to the kernel's entropy pool.  The service will fail if
                             (usleep 500)
                             (loop (- i 1))))
 
+                        ;; Try to use any other installed system fonts.
+                        (catch #t
+                          (lambda _
+                            (chdir
+                             "/run/current-system/profile/share/kbd/consolefonts"))
+                          (lambda _ #t))
+
                         ;; Assume the VT is already in UTF-8 mode, thanks to
                         ;; the 'virtual-terminal' service.
                         ;;
-- 
2.22.0


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

* bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed
  2019-07-11 14:27 ` bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed John Soo
@ 2019-07-11 20:49   ` Ludovic Courtès
  2019-07-11 22:29     ` John Soo
  2019-07-12 16:05     ` John Soo
  0 siblings, 2 replies; 8+ messages in thread
From: Ludovic Courtès @ 2019-07-11 20:49 UTC (permalink / raw)
  To: John Soo; +Cc: 36014

Hi John,

John Soo <jsoo1@asu.edu> skribis:

> I looked hard at a nicer way to provide a flag to start kbd pointing to a
> directory or file. There is a flag to point to a file for a font which
> could be nice. However setfont also prioritizes the current directory over
> the kbd directory. The following patch attempts to chdir to a directory
> where more console fonts may be installed.

What about doing something like this in your config

  (console-font-service "tty1"
                        (file-append some-font-package
                                     "/share/consolefonts/whatever"))

?

Does it work for you?

This approach has the advantage that the service doesn’t need to be
changed, and it doesn’t need to change the current directory of PID 1
either.

Thanks,
Ludo’.

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

* bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed
  2019-07-11 20:49   ` Ludovic Courtès
@ 2019-07-11 22:29     ` John Soo
  2019-07-12 16:05     ` John Soo
  1 sibling, 0 replies; 8+ messages in thread
From: John Soo @ 2019-07-11 22:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 36014

Thanks Ludo!

I really appreciate how engaged you are btw. Thanks so much. But yes I agree I’d rather not change the directory either. I will see what I can do and report back. 

John

> On Jul 11, 2019, at 1:49 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> 
> Hi John,
> 
> John Soo <jsoo1@asu.edu> skribis:
> 
>> I looked hard at a nicer way to provide a flag to start kbd pointing to a
>> directory or file. There is a flag to point to a file for a font which
>> could be nice. However setfont also prioritizes the current directory over
>> the kbd directory. The following patch attempts to chdir to a directory
>> where more console fonts may be installed.
> 
> What about doing something like this in your config
> 
>  (console-font-service "tty1"
>                        (file-append some-font-package
>                                     "/share/consolefonts/whatever"))
> 
> ?
> 
> Does it work for you?
> 
> This approach has the advantage that the service doesn’t need to be
> changed, and it doesn’t need to change the current directory of PID 1
> either.
> 
> Thanks,
> Ludo’.

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

* bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed
  2019-07-11 20:49   ` Ludovic Courtès
  2019-07-11 22:29     ` John Soo
@ 2019-07-12 16:05     ` John Soo
  2019-07-12 20:40       ` Ludovic Courtès
  1 sibling, 1 reply; 8+ messages in thread
From: John Soo @ 2019-07-12 16:05 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 36014

Ok so I tried your suggestion and it works! I’m so surprised but I think I’ll update the docs to reflect this possibility instead of the current patch.

- John

> On Jul 11, 2019, at 1:49 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> 
> Hi John,
> 
> John Soo <jsoo1@asu.edu> skribis:
> 
>> I looked hard at a nicer way to provide a flag to start kbd pointing to a
>> directory or file. There is a flag to point to a file for a font which
>> could be nice. However setfont also prioritizes the current directory over
>> the kbd directory. The following patch attempts to chdir to a directory
>> where more console fonts may be installed.
> 
> What about doing something like this in your config
> 
>  (console-font-service "tty1"
>                        (file-append some-font-package
>                                     "/share/consolefonts/whatever"))
> 
> ?
> 
> Does it work for you?
> 
> This approach has the advantage that the service doesn’t need to be
> changed, and it doesn’t need to change the current directory of PID 1
> either.
> 
> Thanks,
> Ludo’.

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

* bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed
  2019-07-12 16:05     ` John Soo
@ 2019-07-12 20:40       ` Ludovic Courtès
  2019-08-16 18:01         ` John Soo
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2019-07-12 20:40 UTC (permalink / raw)
  To: John Soo; +Cc: 36014

Hi John,

John Soo <jsoo1@asu.edu> skribis:

> Ok so I tried your suggestion and it works! I’m so surprised but I think I’ll update the docs to reflect this possibility instead of the current patch.

That’s a good idea, thank you!

Ludo’.

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

* bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed
  2019-07-12 20:40       ` Ludovic Courtès
@ 2019-08-16 18:01         ` John Soo
  2019-08-22 16:00           ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: John Soo @ 2019-08-16 18:01 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 36014


[-- Attachment #1.1: Type: text/plain, Size: 123 bytes --]

Hi Ludo,

I am not familiar with the info and html documentation build process. Will
this patch suffice?

Thank you,

John

[-- Attachment #1.2: Type: text/html, Size: 231 bytes --]

[-- Attachment #2: 0001-gnu-Update-console-font-service-docstring.patch --]
[-- Type: text/x-patch, Size: 1583 bytes --]

From 681d6e2f81b4cf46501c2312edcef4c98284675b Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Fri, 16 Aug 2019 10:45:43 -0700
Subject: [PATCH] gnu: Update console-font-service docstring.

* gnu/services/base (console-font-service-type):
  Add documentation about valid arguments.
---
 gnu/services/base.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 537d30add5..363cb20c06 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -801,10 +802,14 @@ to add @var{device} to the kernel's entropy pool.  The service will fail if
                 (description
                  "Install the given fonts on the specified ttys (fonts are per
 virtual console on GNU/Linux).  The value of this service is a list of
-tty/font pairs like:
+tty/font pairs. The font can be the name of a font provided by the kbd package
+or any valid argument to setfont. For example:
 
 @example
-'((\"tty1\" . \"LatGrkCyr-8x16\"))
+'((\"tty1\" . \"LatGrkCyr-8x16\")
+  (\"tty2\" . (file-append
+                font-tamzen
+                \"/share/kbd/consolefonts/TamzenForPowerline10x20.psf\")))
 @end example\n")))
 
 (define* (console-font-service tty #:optional (font "LatGrkCyr-8x16"))
-- 
2.22.0


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

* bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed
  2019-08-16 18:01         ` John Soo
@ 2019-08-22 16:00           ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2019-08-22 16:00 UTC (permalink / raw)
  To: John Soo; +Cc: 36014-done

Hello,

John Soo <jsoo1@asu.edu> skribis:

> I am not familiar with the info and html documentation build process. Will
> this patch suffice?

Sure; I pushed a slightly modified variant as commit
74a98b5cddd0430dd7229d4045f4885191c624b7.

Thanks,
Ludo’.

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

end of thread, other threads:[~2019-08-22 16:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-30 19:21 bug#36014: Allow console-font service to use fonts other than those packaged with kbd John Soo
2019-07-11 14:27 ` bug#36014: [PATCH] Attempt to use console-fonts not provided by kbd if they are installed John Soo
2019-07-11 20:49   ` Ludovic Courtès
2019-07-11 22:29     ` John Soo
2019-07-12 16:05     ` John Soo
2019-07-12 20:40       ` Ludovic Courtès
2019-08-16 18:01         ` John Soo
2019-08-22 16:00           ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.