You are not logged in.

#1 2022-07-24 04:40:52

charper_flow
Member
Registered: 2022-07-15
Posts: 34

[Solved] Using a monospace font, but terminal spacing is still werid

I used pacman to install iosevka

sudo pacman -S ttc-iosevka

. I then set this as my default font in my foot.ini file trying the following two commands:

 
font =iosevka:size=8
font =Iosevka:size=8

in either case after refreshing my session the font spacing in my terminal is messed up, almost as if I weren't using a mono space font. What do you think is going wrong?  Strangely enough the spacing seems to be perfect when I vim into any file, its just in the shell that the display is messed up. Whatever I type looks ok, it is just what the console displays that seems off.

Last edited by charper_flow (2022-07-24 21:26:13)

Offline

#2 2022-07-24 06:55:20

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,533

Re: [Solved] Using a monospace font, but terminal spacing is still werid

Your $PS1?
But you should probably link a screenshot (don't embed large images) to give everyone an idea of what you're actually facing.

Offline

#3 2022-07-24 15:34:44

charper_flow
Member
Registered: 2022-07-15
Posts: 34

Re: [Solved] Using a monospace font, but terminal spacing is still werid

Here is an image of the issue. It really is only happening in response to the ls command. You will notice that some files are displayed int my set terminal font and other are displayed with the strange spacing!

Image of ls return

Offline

#4 2022-07-24 16:10:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: [Solved] Using a monospace font, but terminal spacing is still werid

That doesn't really look like the iosevka font in that image - but I only tested it briefly.

What's the output of `fc-match Iosevka`?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2022-07-24 16:28:01

charper_flow
Member
Registered: 2022-07-15
Posts: 34

Re: [Solved] Using a monospace font, but terminal spacing is still werid

[charper@vinho Pictures]$ fc-match Iosevka
iosevka-regular.ttc: "Iosevka" "Regular"

perhaps I am specifying it wrong in my foot.init file? I am running sway and I have the following command in my sway .config

font pango:SourceCodePro Medium 10

but my understanding was that was the font for window tiles and such. I also could be specifying the ioseva font wrong in my foot.init. It is surprisingly difficult to din any explicit reference to how you should name the iosevka font in your config file. I also have left most of my foot.ini file commented out (that was it's default setting). I have just uncommented the sections relevant to font.

Last edited by charper_flow (2022-07-24 16:31:39)

Offline

#6 2022-07-24 16:38:15

charper_flow
Member
Registered: 2022-07-15
Posts: 34

Re: [Solved] Using a monospace font, but terminal spacing is still werid

Another weird thing. When i set it to

font=Iosevka Regular

  or

font=Iosevka Regular

Everything looks much worse and the spacing gets messed up everywhere! but most importantly I get an error that "Noto-Sans" is not monospace. Why would I be getting that error by setting the font to Ioveska? I link to the error below

link to both errors

Offline

#7 2022-07-24 18:20:32

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 413
Website

Re: [Solved] Using a monospace font, but terminal spacing is still werid

Foot is an excellent terminal imo, but one thing to note is that in my experience it uses dpi of the screen in a different manner than you may be used to (read man foot.ini and look for the dpi-aware setting)- I only bring this up to say that explicitly setting a font size may not behave as you're used to in other terminals.

With that being said the font name should match whatever is provided by fc-match or fc-list. In my case I use "DejaVu Sans Mono"

~ $ grep -E "^font" .config/foot/foot.ini
font=DejaVu Sans Mono:style=Book:size 12
font-bold=DejaVu Sans Mono:style=Bold
font-italic=DejaVu Sans Mono:style=Oblique
font-bold-italic=DejaVu Sans Mono:style=Bold Oblique

~ $ fc-list | grep 'DejaVu Sans Mono'
/usr/share/fonts/TTF/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/TTF/DejaVuSansMono-Oblique.ttf: DejaVu Sans Mono:style=Oblique
/usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/TTF/DejaVuSansMono-BoldOblique.ttf: DejaVu Sans Mono:style=Bold Oblique

~ $ fc-match 'DejaVu Sans Mono'
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

So I think your last post is correct for the font name ("Iosevka", you just need to correct the options which should be colon-separated with no spaces in between (read the man foot.ini for more explicit examples and instructions)). So in short I think it should be

font=Iosevka:style=Regular

If a manually listed font is not found it falls back to the default which is just `monospace:size=8`. So check what `fc-match monospace` returns to find the fallback it's using if you've incorrectly specified a font (you can also manually list alternative fallbacks if you're interested again check the man page).

Foot is really a top notch emulator and I'm happy to see more people finding and using it.


"the wind-blown way, wanna win? don't play"

Offline

#8 2022-07-24 19:16:44

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,533

Re: [Solved] Using a monospace font, but terminal spacing is still werid

https://i.imgur.com/ziJ7wxz.png has two different fonts (look eg. at the "i")

One is monospace (perhaps it's Iosevka) but the other is clearly not
The problem is likely the bold variant for Iosevka, see https://wiki.archlinux.org/title/Font_c … lete_fonts but that'll likely have sub-par outcome for monospace fonts and also https://archlinux.org/packages/communit … c-iosevka/ seesm to contain bold variants.

So it's more likely about making foot use the proper bold font, you might have to explicitly configure them because foot fails to resolve them, https://man.archlinux.org/man/community … t.ini.5.en

Offline

#9 2022-07-24 20:17:41

charper_flow
Member
Registered: 2022-07-15
Posts: 34

Re: [Solved] Using a monospace font, but terminal spacing is still werid

Wow thanks to both of you, those were extremely helpful responses. I read through the links you posted and I feel close to figuring this out but still a few more questions.

This is what was returned when I queried the monospace font

[charper@vinho ~]$ fc-match monospace
NotoSansMono-Regular.ttf: "Noto Sans Mono" "Regular"

Where is this set? Where can I rechange the defualt monospace to just be the monospace font?

Second. I set all of the font options to regular to see if this would fix the problem of the bold font:

font=Iosevka:style=Term:size=10
font-bold=Ioveska:style=Regular
font-italic=Iosevka:style=Regular
font-bold-italic=Iosevka:style=Regular 
#line-height=<font metrics>
letter-spacing=0
horizontal-letter-offset=0
vertical-letter-offset=0
#underline-offset=<font metrics>
box-drawings-uses-font-glyphs=no
dpi-aware=auto

and I am still having the spacing issue.

Finally I installe DejaVu Sans Mono and copied your exact config. I made sure the grep command returned all of the same lines. Now my config looks like the following

font=DejaVu Sans Mono:style=Book:size 12
font-bold=font-bold=DejaVu Sans Mono:style=Bold
font-italic=font-italic=DejaVu Sans Mono:style=Oblique
font-bold-italic=font-bold-italic=DejaVu Sans Mono:style=Bold Oblique
#line-height=<font metrics>
letter-spacing=0
horizontal-letter-offset=0
vertical-letter-offset=0
#underline-offset=<font metrics>
box-drawings-uses-font-glyphs=no
dpi-aware=auto

still no luck , I updated an image of what it looks like to the link

Maybe its some setting further down in the foot.ini file. Would you mind sharing your foot config carbon?

Last edited by charper_flow (2022-07-24 20:18:18)

Offline

#10 2022-07-24 20:32:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: [Solved] Using a monospace font, but terminal spacing is still werid

Also lets get a cleaner test to minimize the other (admitedly remote) possibilities.  Test the output of the following with your selected font:

printf 'This line should be regular font and look fine\n\033[1mThis line should be a bold font and may look odd\n'

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#11 2022-07-24 20:44:47

charper_flow
Member
Registered: 2022-07-15
Posts: 34

Re: [Solved] Using a monospace font, but terminal spacing is still werid

That's a very useful test Trilby, I posted the results to the same link. It looks like the issue is with how my system is displaying bolded fonts!

Offline

#12 2022-07-24 20:45:35

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,533

Re: [Solved] Using a monospace font, but terminal spacing is still werid

Where is this set? Where can I rechange the defualt monospace to just be the monospace font?

https://wiki.archlinux.org/title/Font_c … ault_fonts
Ignore the "lang" comparism.
But you cannot set "monospace" to be the generic "monospace", it has to resolve some actual font at some point.

copied your exact config

Whos exact config?

font-bold=font-bold=DejaVu Sans Mono:style=Bold
font-italic=font-italic=DejaVu Sans Mono:style=Oblique
font-bold-italic=font-bold-italic=DejaVu Sans Mono:style=Bold Oblique

is most certainly wrong ("font-bold=font-bold=")

Offline

#13 2022-07-24 21:00:35

charper_flow
Member
Registered: 2022-07-15
Posts: 34

Re: [Solved] Using a monospace font, but terminal spacing is still werid

oh embarassing. I fixed it to

font=DejaVu Sans Mono:style=Book:size 12
font-bold=DejaVu Sans Mono:style=Bold
font-italic=DejaVu Sans Mono:style=Oblique
font-bold-italic=DejaVu Sans Mono:style=Bold Oblique
#line-height=<font metrics>
letter-spacing=0
horizontal-letter-offset=0
vertical-letter-offset=0
#underline-offset=<font metrics>
box-drawings-uses-font-glyphs=no
dpi-aware=auto

and now everything works fine! I guess It was having issues resolving iosevka's bold font. Well thank you everyone. I learned a lot about how fonts work and found some good resources to continue learning more about configuring font. I really appreciate all of the help smile

BONUS UPDATE: I was able to get it to work with Iosevka too !!

Offline

#14 2022-07-24 21:13:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,533

Re: [Solved] Using a monospace font, but terminal spacing is still werid

cool

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

For posteriority: future readers might benefit from a config that properly matches Iosevka when they find this thread on google.

Offline

#15 2022-07-24 21:29:05

charper_flow
Member
Registered: 2022-07-15
Posts: 34

Re: [Solved] Using a monospace font, but terminal spacing is still werid

Good points. I marked it as solved, here is what the font portion of my config looked like to make everything work with Iosevka

font=Iosevka:style=Regular:size=8
font-bold=Iosevka:style=Bold
font-italic=Iosevka:style=Oblique
font-bold-italic=Iosevka:style=Bold Oblique
#line-height=<font metrics>
letter-spacing=0
horizontal-letter-offset=0
vertical-letter-offset=0
#underline-offset=<font metrics>
box-drawings-uses-font-glyphs=no
dpi-aware=auto

Note that i think size 8 is the default size, if you change it make sure to add a size option to the bold and italic and bold-italic options which match otherwise you once gain get some funny looking spacing in terminal.

Offline

Board footer

Powered by FluxBB