4

Premise:

In a automotive gate automation scenario, I'm building a daemon, that I think to run in an Ubuntu headless server.

      linux headless host
    +----------------------+
    |                      |
    |                      |
    |                      |
    |   +--------------+   |
    |   | graphic card |   |
    +---+------+-------+---+
               | HDMI
               |
               |
+--------------v---------------+
|                              |
| Please contact the operator. |
| Push the emergency button    |
|                              |
|                              |
|                              |
|                              |
+------------------------------+
     high resolution screen

Goal:

The daemon program has to display some simple texts on a screen. Basically I just need to write text lines on a stdout, but with configurable BIG size fonts and geometry, as I could with a gnome terminal on a desktop environment. The point is that I would avoid to install a desktop environment just to solve the problem.

big text on terminal example

In the screenshot it's displayed the command clear && echo "Please contact operator" on a gnome terminal with different font size setting.

BTW, the reason of big font requirement is that displayed text will be read by truck drivers, at a distance of 1/2 meters from the computer monitor.

Notes:

  • A way I explored is to set the TTY character setting (at GRUB level). Unfortunately it doesn't appear to be a good option, because the font setting are very limited.

  • Reading Linux without graphical OS but with graphical resources, maybe framebuffer mode could be an option?

Question:

How can I display big front texts (so in a graphic mode) on a headless computer?

1 Answers1

4

I answer myself just to share 3 solutions I found, listed from the worst to the best IMMO:

  1. using programs like toilet or figlet
clear && printf "push the\nemergency\nbutton" | toilet -t --font=mono12
                           ▄▄                            ▄▄
                           ██                    ██      ██

██▄███▄ ██ ██ ▄▄█████▄ ██▄████▄ ███████ ██▄████▄ ▄████▄ ██▀ ▀██ ██ ██ ██▄▄▄▄ ▀ ██▀ ██ ██ ██▀ ██ ██▄▄▄▄██ ██ ██ ██ ██ ▀▀▀▀██▄ ██ ██ ██ ██ ██ ██▀▀▀▀▀▀ ███▄▄██▀ ██▄▄▄███ █▄▄▄▄▄██ ██ ██ ██▄▄▄ ██ ██ ▀██▄▄▄▄█ ██ ▀▀▀ ▀▀▀▀ ▀▀ ▀▀▀▀▀▀ ▀▀ ▀▀ ▀▀▀▀ ▀▀ ▀▀ ▀▀▀▀▀ ██

▄████▄ ████▄██▄ ▄████▄ ██▄████ ▄███▄██ ▄████▄ ██▄████▄ ▄█████▄ ▀██ ███ ██▄▄▄▄██ ██ ██ ██ ██▄▄▄▄██ ██▀ ██▀ ▀██ ██▄▄▄▄██ ██▀ ██ ██▀ ▀ ██▄ ██ ██▀▀▀▀▀▀ ██ ██ ██ ██▀▀▀▀▀▀ ██ ██ ██ ██▀▀▀▀▀▀ ██ ██ ██ ████▀ ▀██▄▄▄▄█ ██ ██ ██ ▀██▄▄▄▄█ ██ ▀██▄▄███ ▀██▄▄▄▄█ ██ ██ ▀██▄▄▄▄█ ███ ▀▀▀▀▀ ▀▀ ▀▀ ▀▀ ▀▀▀▀▀ ▀▀ ▄▀▀▀ ██ ▀▀▀▀▀ ▀▀ ▀▀ ▀▀▀▀▀ ██ ▀████▀▀ ███

▄▄ ██ ██ ██ ██▄███▄ ██ ██ ███████ ███████ ▄████▄ ██▄████▄ ██▀ ▀██ ██ ██ ██ ██ ██▀ ▀██ ██▀ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███▄▄██▀ ██▄▄▄███ ██▄▄▄ ██▄▄▄ ▀██▄▄██▀ ██ ██ ▀▀ ▀▀▀ ▀▀▀▀ ▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀ ▀▀


  1. Visualize an image on framebuffer

If the text is "static" (fixed) a solution is to display a bitmap on the framebuffer (an image containing the desired text).

An old but nice utility is fbi:

$ sudo apt install fbi

so having the image: fullscreen_text_image.PNG a fullscreen bitmap (e.g. in PNG format), here below the command (trick) to display the image for 5 seconds:

sudo fbi --noverbose --timeout 5 --once fullscreen_text_image.PNG

  1. framebuffer terminal emulation

fbterm is an old framebuffer terminal emulation program. The nice feature is that you can select a lot of options and by example you can have VERY HUGE font sizes:

sudo apt install fbterm

run the terminal emulation on the framebuffer

fbterm --font-size=300

remove prompt

PS1=''

remove cursor

setterm --cursor off

other settings (e.g. change background color)

setterm --background red

font change

setfont /usr/share/consolefonts/Uni3-Terminus32x16.psf.gz

Running fbterm as shown, one can have a "normal" stdout, but with VERY BIG texts in high graphical quality! See picture:

enter image description here

αғsнιη
  • 41,407