LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   'I' cannot see the std console text and need to change it (https://www.linuxquestions.org/questions/linux-newbie-8/i-cannot-see-the-std-console-text-and-need-to-change-it-4175656594/)

someone else 06-29-2019 08:49 AM

'I' cannot see the std console text and need to change it
 
pleased see my next reply for hopefully better description

any help will be great...and thank you.

business_kid 06-29-2019 12:41 PM

I grappled with tiny fonts
  1. In the console, you can use any font from /usr/share/kbd/consolefonts. To change it, use the 'setfont' program. I have installed terminus fonts and have a 'setfont' command for a 28pt font. Terminus fonts go up to 32, but 30 or 32 don't work well here. It's 'setfont <new font>'
  2. In XFCE, use xterm which has a settings tab and do clever stuff there.

ondoho 06-30-2019 03:31 AM

Quote:

Originally Posted by someone else (Post 6010279)
was using sw10.something up from 4.something... and recently moved to sw64.14.2. loaded up fine but the text was smaller than the other versions. chose std console no custom fonts, and rebooted. loading text was still small. i made a change in the boot script and rebooted. the text was much larger (and on two machines much much larger, double line big), but at a point in the load and configure portion lines are rolling up the screen suddenly the text goes back to i believe is the tiny utf-8 font that the setup program stated was the standard now.
i though this was an environment variable and there was a bash command to exec, but i have spend a good amount of time trying to find where/how to change this because i want to figure stuff out on my own, but i simply cannot find any reference how to change the console lines to 25 and the columns to 80 i have had for way to long. the one place i did find a column and row pair mentioned 100/48 respectively. i did not want to change these until i asked on lq just in case that setting is configured by or used with the xface system which is my dte and am not sure of that.
any help will be great...and thank you.

What a confusing description.
Please, you need to show us the commands issued, files edited etc.
Use CODE tags for code.

someone else 07-07-2019 08:21 AM

first sorry for the delay, i looked forward to peoples answer/help and did type a reply but apparently did not post it? worse... then kept checking email for a reply not realizing i had never answered the last post. oops?!


my problem simply stated:

i typed "set" and in the listing there is a "COLUMNS" and "LINES". mine is equal to 128 and 48 respectively. i type "set COLUMNS=80" and "set LINES=25" in two separate commands

then type set again. the listing shows that both vars are as i set them.

i logout and back in and literally nothing has changed. type set again and both vars are back to the original values 128 and 48 respectively.

i even list the two variables in .bash_profile, logout/login, but the COLUMNS/LINES appearance does not change.

i have tried this a bunch of times on installs on three different machines of this sw64.14.2 but the settings revert to the original values each time on each machine.

when i loaded the system setup stated that the tiny utf-8 was the "standard default". does this mean that it is hard coded in the kernel when compiled? is that now where i need to change this variable? which just seems silly but...

also after-the-fact i realize this may be two separate items i am asking about, but for the moment i am trying to work on the columns/lines situation.

berndbausch 07-07-2019 08:27 PM

Quote:

Originally Posted by someone else (Post 6012798)
i logout and back in and literally nothing has changed. type set again and both vars are back to the original values 128 and 48 respectively.

Shell variables, more correctly environment variables, exist in the environment of a process. When that process disappears, so does its environment and the variables it contains.

In your case, the process is your shell. When you log out, this shell process exists, and all variables disappear.

When you log in again, another shell process is created. It initializes its environment from various places, including files like /etc/profile, .bash_profile, .bashrc.
Quote:

i even list the two variables in .bash_profile, logout/login, but the COLUMNS/LINES appearance does not change.
I am not sure what you did. Listing variables doesn't change anything.

I have a Ubuntu 18.04 server where COLUMNS and LINES are set in the .bashrc script, as follows:
Code:

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS
shopt -s checkwinsize

In this case, LINES and COLUMNS are reset dynamically and automatically each time the terminal window size changes.
Quote:

i have tried this a bunch of times on installs on three different machines of this sw64.14.2 but the settings revert to the original values each time on each machine.
What is sw64.14.2?

EDIT: It seems to be a Slackware version. I can't tell how Slackware configures LINES and COLUMNS, but .bashrc is probably a good guess.

In any case, you could, for example, set LINES and COLUMNS in the .bashrc file.
Code:

LINES=24
COLUMNS=80

This way, each time your shell starts, the variables are initialized from that file.
Quote:

when i loaded the system setup stated that the tiny utf-8 was the "standard default". does this mean that it is hard coded in the kernel when compiled? is that now where i need to change this variable? which just seems silly but...

also after-the-fact i realize this may be two separate items i am asking about, but for the moment i am trying to work on the columns/lines situation.
Yes, these are two different questions. Carla Schroeder's instructions how to change the console font might be helpful.

EDIT: I don't know to what extent Carla's instructions apply to Slackware. The systemd paragraph at the end certainly doesn't.

business_kid 07-08-2019 04:02 AM

If you're using terminals outside X windows with the console thrown up by the linux kernel, the font directory is /usr/share/kbd/consolefonts, and you can set any fonts from that directory. I like big fonts, so I installed the terminus fonts and put a setting in /etc/rc.d/rc.font
Code:

setfont -v ter-928n.psf.gz

If you are using X consoles, laziest way is to use xterm, which has a visible Edit/Preferences menu where you can set font size.

someone else 07-09-2019 03:49 AM

berndbausch i tried putting COLUMNS/LINES in the .bashrc file and that did not work either. that has to be being set from somewhere/how else...

business kid indeed i am using the kernel console and at the moment am just trying to set the COLUMNS=80 and LINES=25, then i will get to the fonts. just trying not to confuse the issue more than i have. i do appreciate the command suggestion and will try that.

business_kid 07-09-2019 01:40 PM

Quote:

Originally Posted by someone else (Post 6013325)
business kid indeed i am using the kernel console and at the moment am just trying to set the COLUMNS=80 and LINES=25, then i will get to the fonts. just trying not to confuse the issue more than i have. i do appreciate the command suggestion and will try that.

No dice. The kernel sets the lines and columns for the fonts once the video driver gets loaded. Maybe a 'nomodeset' boot parameter would get you out of that, but it has other associated problems.

ehartman 07-09-2019 05:42 PM

Quote:

Originally Posted by berndbausch (Post 6012944)
In this case, LINES and COLUMNS are reset dynamically and automatically each time the terminal window size changes.

What is sw64.14.2?

EDIT: It seems to be a Slackware version. I can't tell how Slackware configures LINES and COLUMNS, but .bashrc is probably a good guess.

LINES and COLUMNS are set by the terminal application itself, when it starts the shell, to inform future children how BIG the window is.
Changing the values will NOT change the window size itself, so the child will get wrong values. Changing the size of the window will automatically change them, so after the resize these values have been set to the new window size.
You can set the right values too with the 'eval `resize`' command when the window of the shell doesn't do so automatically. This assume your terminal window interpretes VT100-style commands:
Quote:

The VT100-style escape sequence used to determine the screen size always works for VT100-compatible terminals. VT100s have no corresponding way to modify the screensize.
(from man resize)

berndbausch 07-09-2019 06:56 PM

Quote:

Originally Posted by ehartman (Post 6013575)
LINES and COLUMNS are set by the terminal application itself, when it starts the shell, to inform future children how BIG the window is.

True but the original poster asked for console terminals, which you can't resize that easily.

someone else 07-10-2019 03:44 AM

Quote:

Originally Posted by business_kid (Post 6013519)
No dice. The kernel sets the lines and columns for the fonts once the video driver gets loaded. Maybe a 'nomodeset' boot parameter would get you out of that, but it has other associated problems.

so the COLUMNS=128 LINES=48 is set in the kernel when it compiles? or does the video driver (or kernel) choose the COLUMNS/LINES settings based on the font chosen by the user?

and if the latter is true how does one know what font results in the COLUMNS=80 and LINES=25 that i am used to having?

business_kid 07-10-2019 04:47 AM

AFAIK, on boot the kernel comes up in a default mode, common to all video cards. It used to be 640x480, but aspect ratios have changed and itr's 16:9 monitors now. The old 80x25 was the product of a 640x480 screen res (4:3 aspect ratio).

When the driver loads, max resolution is set and the fonts go tiny. When the screen font is loaded an appropriate mode is set. I have a 17.3" or thereabouts screen and my lines/columns on the ter-928n font is 114x30/31. It looks much like the 80/25 of old, and is quite readable. Terminus fonts go up to 32, but 30 & 32 pt. fonts do strange things to the console here.
Then we come back to your init program. I have old-fashioned sysvinit, and one can fiddle init scripts. Systemd does have scripts buried in it's depths, but you are definitely on your own there. There is /etc/profile.d for running login commands and I have /etc/rc.d/rc.local for system-wide startup commands but with systemd, you're on your own. Knock yourself out.
At any stage you can run 'setfont <some-font>' and it will switch that terminal to that particular font, adjusting lines/cols accordingly. Or 'setfont' with no options restores the default (IIRC).

someone else 07-11-2019 01:41 PM

[QUOTE=business_kid;6013712]AFAIK, on boot the kernel comes up in a default mode, common to all video cards. It used to be 640x480, but aspect ratios have changed and itr's 16:9 monitors now. The old 80x25 was the product of a 640x480 screen res (4:3 aspect ratio).

that makes sense. so the font then will dictate the columns/lines pair on the the screen, bigger font takes up more space per character.

i looked through the fonts directory and well there is probably more than 100,000 of them so it will take a while to try each of them and see if i like it.


now this is still just the std console and not the frame buffer correct? setup stated the frame buffer was slower.

Shadow_7 07-11-2019 06:53 PM

You could (if only in theory) control $COLUMNS x $LINES by controlling your font.

$ echo $(( 1920 / 80 ))
24
$ echo $(( 1080 / 25 ))
43

A bit hard to come by a console font of that size. But an old 8x14 px font at 3x's the size mostly fits that bill.

$ echo $(( 80 * 8 * 3 ))
1920
$ echo $(( 25 * 14 * 3 ))
1050

Something that I do in X anyway. Also *3 when scaled to 640x360 is a *1 in terms of px scaling. As in good for youtube videos that show a fullscreen terminal. Not that that does much good in a console. There's actual code for the fonts in the kernel source tree. Not that one wants to start there when it comes to "custom"izations.

someone else 07-12-2019 04:20 AM

well, i tried three different fonts 7 times.

all three .gz packages unpacked no problem.

the first font was a "tech14.pcf" that with the command "setfont /usr/share/font/100dpi/tech14.pcf" did not complain. but after logging out/ back in the characters did maybe seem different "possibly", i did not see any difference, so i rebooted and still the same as before, nothing stands out.

so i have tried two other fonts, they unpack great...

but when i tried the above command with the name of the two different fonts and "timB18" and the "timB24.pcf" the complaint is "bad input file size" and will do anything else

not sure what else to do.

business_kid 07-12-2019 02:11 PM

Get Terminus fonts.

Red Hat have them, and slackware.

Shadow_7 07-12-2019 10:48 PM

You shouldn't need to unpack them for starters. I've got some bash scripts that create .bdf fonts from old bitmap fonts. Then bdftopcf them to .pcf. Then gzip's them. Which is how most fonts are stored on the system. In X I need to do a few steps to use them. A bit dated, but still works.

$ xset fp+ /home/user/.fonts/
$ xset fp rehash
$ fc-cache -f -v

Since they're custom and not provided / automated by the distro. In a console you are more likely to be limited. Perhaps .ttf fonts only. Or terminus, or whatever that official *nix one is.

mrmazda 07-12-2019 11:32 PM

Quote:

Originally Posted by someone else (Post 6012798)
i typed "set" and in the listing there is a "COLUMNS" and "LINES". mine is equal to 128 and 48 respectively. i type "set COLUMNS=80" and "set LINES=25" in two separate commands

The Linux kernel computes rows and columns based upon configured font and display resolution. The standard font is 16px high by 8px wide. This produces the following:
Code:

resolution        characters
horiz        vert        cols        rows
640        400        80        25
640        480        80        30
1024        600        128        37
1024        768        128        48
1280        720        160        45
1280        1024        160        48
1440        900        180        56
1680        1050        210        65
1920        1080        240        67
1920        1200        240        75
2560        1440        320        90

I get the size fonts I prefer on the vttys by retaining the standard 16x8 font and changing the screen resolution via Grub's linux line using video=<mode>, typically video=1440x900. Whether it works the same in Slack I don't know, but it does work in all distros I have working familiarity with. For 80x25 with standard font you would append to kernel cmdline at boot:
Code:

video=640x400
If you are using Intel's DDX driver, Xorg will inherit the vtty mode. Modesetting, nouveau, amdgpu and radeon DDX drivers are more sensible by ignoring video=.

someone else 07-15-2019 04:04 AM

i have terminus-font... on my system and apparently i have to install it. the package is bundled with the 14.2 and current gathering of slackware. so i will have to play with that.

business_kid 07-16-2019 04:14 AM

Great if you have terminus font.

Install it, and run setfont <any 28pt font> e.g. ter-928n

someone else 07-17-2019 10:05 AM

well...that was easier than i made it out to be. and business kid you were correct two pages ago with your ter-928n... that one is right on the nose. i also like the 924n...that might be a bit more appropriate now, but still...

they were both already installed in the /usr/share/kbd/consolefonts dir. all i did was setfont with the .gz and just like that it was auto read and changed as i hit enter. no logout needed. nice


well i thank all of you who looked and posted some help and information again.

business_kid 07-18-2019 04:45 AM

Glad you're sorted. Mark the thread solved.

This makes little sense because a lot of the gnu stuff goes back to when 640x480 was "Really high resolution." There was still 80x25 consoles just printing ascii on the end of serial ports all talking to some pretty lowlife cpu. CP/M was like that, on 8 bit 8080s & Z80s @ 4Mhz. Then Z80s got up to 6Mhz, but that was really straining the TTL logic of the day. Unix & Macs took hold of the 68000, but the PC used the inferior 8088 (16 bit internal but an 8 bit bus), and Hercules video cards.

someone else 07-26-2019 04:20 AM

btw business kid the ter932 looks great on a 32 inch monitor, and on a 43 inch covers two-thirds of the screen. i have some sitting around.

Quote:

Originally Posted by business_kid (Post 6016150)

This makes little sense because a lot of the gnu stuff goes back to when 640x480 was "Really high resolution." There was still 80x25 consoles just printing ascii on the end of serial ports all talking to some pretty lowlife cpu. CP/M was like that, on 8 bit 8080s & Z80s @ 4Mhz. Then Z80s got up to 6Mhz, but that was really straining the TTL logic of the day. Unix & Macs took hold of the 68000, but the PC used the inferior 8088 (16 bit internal but an 8 bit bus), and Hercules video cards.

well that just shows how old the equipment i am working with is. i seem to end up with everyone's older stuff. but now that stuff is slowly dying off.


so thanks again to all...

business_kid 07-27-2019 01:22 PM

Have you counted the rows/columns?

Shadow_7 07-28-2019 04:55 AM

Quote:

Originally Posted by business_kid (Post 6019082)
Have you counted the rows/columns?

No need to count them.

$ echo $COLUMNS x $LINES

113 x 32 with Terminus 24x12

136 x 38 with Terminus 20x10

170 x 96 with VGA8

85 x 24 with VGA32x16

But that's not fullscreen on the external monitor with a 1366x768 LCD on the laptop. All Lat15- prefixed fonts.


All times are GMT -5. The time now is 08:30 AM.