Skip to contentSkip to conversation

unicode_start should not call setfont

kbd Michael Schutte 2 participants 3 messages May 31, 2008 – Jun 1, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

I think that unicode_start should not mess with the user’s console font. It should only put the console into Unicode mode and be done with it. The problem with the current approach is that the default Unicode fonts considered by the script are often not what the user wants to see. Every font should be fine to display enough characters to be readable, anyway, and users who need a larger subset of Unicode characters can run setfont manually. It would also make sense because unicode_stop never changes font.

The obvious counter-argument is backwards compatibility, but then, most users will not call unicode_start themselves but leave it to their distribution’s init scripts. What do you think?

Signature · 1 line
Michael Schutte <[email protected]>
#1 lore raw
Quoted 11 lines · Michael Schutte

Hi,

I think that unicode_start should not mess with the user’s console font. It should only put the console into Unicode mode and be done with it. The problem with the current approach is that the default Unicode fonts considered by the script are often not what the user wants to see. Every font should be fine to display enough characters to be readable, anyway, and users who need a larger subset of Unicode characters can run setfont manually. It would also make sense because unicode_stop never changes font.

Quoted 3 lines

The obvious counter-argument is backwards compatibility, but then, most users will not call unicode_start themselves but leave it to their distribution’s init scripts. What do you think?

We could do another thing:

src/unicode_start +0 -1
index 82ef457..63c9967 100755
@@ -83,7 +83,6 @@ case "$#" in
                setfont "$1"
                ;;
        0)
-               setfont "$DEFAULT_UNICODE_FONT"
                ;;
        *)
                echo "usage: unicode_start [font [unicode map]]"

---

Most distributions load own fonts after executing unicode_start. I think we can remove the setting of default font.

Without any arguments unicode_start will only set unicode mode and will not set font.

How about that?

Signature · 1 line
Rgrds, legion
#2 lore raw
Quoted 16 lines · Alexey Gladkov

We could do another thing:

src/unicode_start +0 -2
index 82ef457..63c9967 100755
@@ -83,7 +83,6 @@ case "$#" in
                setfont "$1"
                ;;
        0)
-               setfont "$DEFAULT_UNICODE_FONT"
                ;;
        *)
                echo "usage: unicode_start [font [unicode map]]"
---
Quoted 7 lines

Most distributions load own fonts after executing unicode_start. I think we can remove the setting of default font.

Without any arguments unicode_start will only set unicode mode and will not set font.

How about that?

This is exactly what I had in mind, I just failed to express myself :-)

Just an addition to your patch, before it gets forgotten:

man/man1/unicode_start.1 +1 -1
index 7c2b939..b76ccb3 100644
@@ -26,7 +26,7 @@ The parameter
 .I font
 is a font that is loaded. It should have a built-in Unicode map,
 or, if it hasn't, such a map can be given explicitly as second parameter.
-When no font was specified, some default font is loaded.
+When no font was specified, the current font is kept.
 .SH NOTE
 Unicode mode is a parameter with a value per virtual console.
 However, usually the font and keymap is common to all consoles.
src/unicode_start +0 -12
index cfa19f8..7351fe0 100755
@@ -85,18 +85,6 @@ stty iutf8
 # have a Unicode map attached, or explicitly specified, e.g.,
 # by giving `def.uni' as a second argument.
 
-# Also drdos8x16 is a good candidate.
-for DEFAULT_UNICODE_FONT in \
-       /usr/share/consolefonts/Uni1-VGA16.psf* \
-       /usr/share/consolefonts/LatArCyrHeb-16.psf* \
-       /usr/share/consolefonts/default*.psf* \
-       /usr/share/consolefonts/*.psf*
-do
-       if [ -f "$DEFAULT_UNICODE_FONT" ]; then
-               break
-       fi
-done
-
 case "$#" in
        2)
                setfont "$1" -u "$2"

---

I’ll apply this for the next Debian revision of kbd.

Regards,

Signature · 1 line
Michael Schutte <[email protected]>