Solved Issue with awesome font in console, i3blocks and firefox

maxmoon

Member

Reaction score: 4
Messages: 32

I installed font-awesome, but it doesn't show up.

In the console I can only see squares. In i3blocks I see chinese-like symbols and if I visit this website I can only see 4 chars in a box (2 chars per line).

Are there any additional steps in FreeBSD to install all fonts correctly? I only executed pkg install font-awesome and restarted.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,050
Messages: 31,632

Check /var/log/Xorg.0.log and see which fonts have been loaded. You may need to add additional FontPath entries to your configuration to make it actually load the fonts.
 

abishai

Aspiring Daemon

Reaction score: 174
Messages: 743

Drop fonts.conf in /usr/local/etc/X11/xorg.conf.d
For example, my laptop has
Code:
Section "Files"
    FontPath    "/usr/local/share/fonts/dejavu/"
    FontPath    "/usr/local/share/fonts/hack-font/"
    FontPath    "/usr/local/share/fonts/GentiumBasic/"
    FontPath    "/usr/local/share/fonts/Liberation/"
    FontPath    "/usr/local/share/fonts/LinLibertineG/"
    FontPath    "/usr/local/share/fonts/Carlito/"
    FontPath    "/usr/local/share/fonts/Caladea/"
    FontPath    "/usr/local/share/fonts/font-awesome/"
EndSection
 
OP
OP
M

maxmoon

Member

Reaction score: 4
Messages: 32


╭─maxmoon@carboon /usr/local/share
╰─➤ ls | grep font | wc -l
zsh: correct 'font' to 'fonts' [nyae]? n
13


I have 13 directories which have "font" in their name


╭─maxmoon@carboon /usr/local/share/fonts
╰─➤ ls | wc -l
48


I have 48 fonts installed in /usr/local/share/fonts.

Does someone know a script, which can put all the fonts (from different locations [whereever a font can be]) to the fonts.conf file?

But I'll try the awesome font first, to check if it's working.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,050
Messages: 31,632

maxmoon look in /var/log/Xorg.0.log, most of those 13 directories are likely already loaded by default. You only need to add the ones that aren't loaded by default to a fonts.conf file.

Mine only has these:
Code:
Section "Files"
        FontPath "/usr/local/share/fonts/terminus-font/"
        FontPath "/usr/local/share/fonts/dejavu"
EndSection
 

getopt

Aspiring Daemon

Reaction score: 411
Messages: 609

Notice from /usr/local/etc/fonts/fonts.conf
Code:
        DO NOT EDIT THIS FILE.
        IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
        LOCAL CHANGES BELONG IN 'local.conf'.

        <!-- the following element will be removed in the future -->
        <dir>~/.fonts</dir>
From pkg info font-awesome
This package installs only free OTF fonts suitable for use in X.Org
applications. The corresponding web fonts aren't installed.

What does that mean?

And then from pkg info -D font-awesome
font-awesome-5.9.0:
Always:
Make sure that the freetype module is loaded. If it is not, add the following
line to the "Modules" section of your X Windows configuration file:

Load "freetype"

Add the following line to the "Files" section of X Windows configuration file:

FontPath "/usr/local/share/fonts/font-awesome/"
 
OP
OP
M

maxmoon

Member

Reaction score: 4
Messages: 32

Sometimes x11-fonts/font-awesome needs to be placed in the owner home dir (.fonts) to work correctly. Also after you install it, run fc-cache to build/rebuild font information cache.
I've created the directory ~/fonts and put a symlink to the fonts. But it didn't work and later I copied all otf files from awesome font in it

Font Awesome 5 Brands-Regular-400.otf
Font Awesome 5 Free-Regular-400.otf
Font Awesome 5 Free-Solid-900.otf


Then I executed fc-cache, but nothing happens. I rebooted the system to be sure, but still weird signs everywhere.

maxmoon look in /var/log/Xorg.0.log, most of those 13 directories are likely already loaded by default. You only need to add the ones that aren't loaded by default to a fonts.conf file.

Mine only has these:
Code:
Section "Files"
        FontPath "/usr/local/share/fonts/terminus-font/"
        FontPath "/usr/local/share/fonts/dejavu"
EndSection
/var/log/Xorg.0.log says:
Code:
[    30.682] (**) FontPath set to:
    /usr/local/share/fonts/dejavu/,
    /usr/local/share/fonts/hack-font/,
    /usr/local/share/fonts/GentiumBasic/,
    /usr/local/share/fonts/GentiumPlus/,
    /usr/local/share/fonts/Liberation/,
    /usr/local/share/fonts/LinLibertineG/,
    /usr/local/share/fonts/Carlito/,
    /usr/local/share/fonts/Caladea/,
    /usr/local/share/fonts/font-awesome/,
    /usr/local/share/fonts/misc/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/,
    /usr/local/share/fonts/Type1/,
    /usr/local/share/fonts/100dpi/,
    /usr/local/share/fonts/75dpi/
So what does it mean? Does it mean that Xorg loaded it correctly, but Firefox, urxvt and i3blocks still don't know what to do?

Notice from /usr/local/etc/fonts/fonts.conf
Code:
        DO NOT EDIT THIS FILE.
        IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
        LOCAL CHANGES BELONG IN 'local.conf'.

        <!-- the following element will be removed in the future -->
        <dir>~/.fonts</dir>
Ok, I've put everything in /etc/X11/xorg.conf. It looks like this now:

Code:
Section "Module"
    Load "dbe"
    Load "dri"
    Load "dri2"
    Load "extmod"
    Load "record"
    Load "freetype"
    Load "bitmap"
    Load "type1"
    Load "glx"
EndSection

Section "Files"
    FontPath    "/usr/local/share/fonts/dejavu/"
    FontPath    "/usr/local/share/fonts/hack-font/"
    FontPath    "/usr/local/share/fonts/GentiumBasic/"
    FontPath    "/usr/local/share/fonts/GentiumPlus/"
    FontPath    "/usr/local/share/fonts/Liberation/"
    FontPath    "/usr/local/share/fonts/LinLibertineG/"
    FontPath    "/usr/local/share/fonts/Carlito/"
    FontPath    "/usr/local/share/fonts/Caladea/"
    FontPath    "/usr/local/share/fonts/font-awesome/"
EndSection
From pkg info font-awesome
This package installs only free OTF fonts suitable for use in X.Org
applications. The corresponding web fonts aren't installed.

What does that mean?
Ok, that means that it doesn't work in Firefox. It would be a nice-to-have if they would work in Firefox, because seeing other configs in the browser is sometimes really hard with all the glyths, but I should focus on urxvt and i3blocks and maybe look for those webfonts later or do you know how to fix this by any chance?

And then from pkg info -D font-awesome
font-awesome-5.9.0:
Always:
Make sure that the freetype module is loaded. If it is not, add the following
line to the "Modules" section of your X Windows configuration file:

Load "freetype"

Add the following line to the "Files" section of X Windows configuration file:

FontPath "/usr/local/share/fonts/font-awesome/"
I did it, but still no success :(

What I tried is to get the special chars from LibreOffice and not from the Internet, because it could be even completely other chars (can't see them, because of glyths).

So in LibreOffice I can find all 3 awesome fonts by adding them with Insert -> Special Character and choose from all 3 one and even from other fonts like Twitter Color Emoji (I don't even now how this came to my system) and some asian fonts, just to get any special chars there.

I have chosen those: 恤兀🐕

In LibreOffice they look like I've chosen them, after copying it to the config file (in urxvt with vim) they are all squares in the console (except of the 2 asian signs) and after reloading i3, only the asian signs and the twitter dog look good in i3blocks. And the other signs, which were squares in urxvt/vim are completely other signs.
EDIT: I tried another terminal emulator (sakura) and it shows the same weird signs like i3locks do (but at least no squares), but it still doesn't solve the problem.

Is it possible that everything works just fine, but only font-awesome is broken?

I really thank all of you for your help. It might took the whole day and it still doesn't work and I hope some of you still have some motivation helping me :)
 

Minbari

Well-Known Member

Reaction score: 199
Messages: 373

I only have copied the *.otf in that folder and everything works OK. Check the Xorg.0.log to see if it load open type fonts (otf). Maybe the problem is from there.

001.png
 
OP
OP
M

maxmoon

Member

Reaction score: 4
Messages: 32

I only have copied the *.otf in that folder and everything works OK. Check the Xorg.0.log to see if it load open type fonts (otf). Maybe the problem is from there.

View attachment 6811
Does it mean it loads them, if the FontPath is set to the OTF directory?

Code:
grep -i otf /var/log/Xorg.0.log
    /usr/local/share/fonts/OTF/,
Maybe not, because there were no awesome fonts in this directory and even making symlinks to font-awesome didn't help.
How can I see in the logs if OTF fonts are loaded?

But there might be a general issue with OTF fonts here, because I tried something untypical.

I was looking for other awesome fonts on my system with the command find /usr -iname "*awesome*"and I found some:
Code:
..
/usr/local/share/doc/cyrus-sasl2/html/_static/fonts/fontawesome-webfont.ttf
/usr/local/share/doc/freetype2/reference/site/assets/fonts/specimen/FontAwesome.ttf
..
After copying the first one into ~./fonts and reloading i3, some new icons appeared. After doing it with the second one, all icons appeared :)

But this isn't a real or good fix, even if I am happy that it works, because if someone has the same problem, I couldn't even tell them from which package I got those awesome ttf fonts on my system?

Any idea why ttf works and otf not?
 

T-Daemon

Well-Known Member

Reaction score: 150
Messages: 436

... I couldn't even tell them from which package I got those awesome ttf fonts on my system?
Option 1:
Look at the subdirectory names, the port/package name is mentioned there:

/usr/local/share/doc/cyrus-sasl2/html/_static/fonts/fontawesome-webfont.ttf
/usr/local/share/doc/freetype2/reference/site/assets/fonts/specimen/FontAwesome.ttf

Option 2:
Run command
pkg which /usr/local/share/doc/cyrus-sasl2/html/_static/fonts/fontawesome-webfont.ttf

Option 3:
If what you are looking for is not on system, run within a internet search engine site:freshports.org "fontawesome-webfont.ttf"
or variations of the search term.
 
OP
OP
M

maxmoon

Member

Reaction score: 4
Messages: 32

I figured out that many icons in Font Awesome are just too big and that's causing the squares.

With the following fonts and sizes in .Xdefaults the symbols are showing up correctly:
Code:
URxvt*font: xft:DejaVu Sans Mono:pixelsize=32,xft:Font Awesome 5 Free Solid:size=12, xft:Font Awesome 5 Free Regular, xft:Font Awesome 5 Brands Regular:size=12
And because it was just too large for my high-res monitor, I had to put DPI down to Xft.dpi: 96 in .Xdefaults

I can see those icons now correctly in urxvt and vim and if I put the same names in my i3.conf it works with i3blocks too and the ttf fonts can be deleted, which I've used (see some posts above):
Code:
font xft:DejaVu Sans Mono, Font Awesome 5 Free Solid, Font Awesome 5 Free Regular, Font Awesome 5 Brands Regular 18
The icons are very small now, but at least I can recognize them now. So this might be not a final solution, but it isn't a flow blocker anymore.

So I think the problem that those awesome otfs wouldn't work is, because I didn't use their proper name. But how can one find out the name of the fonts, which can be used in .Xdefaults and in i3.conf? It isn't the file name, right? And maybe a stupid question, but what does xft and pango mean and then should they be used?

And I've solved the problem with the awesome fonts in Firefox, too. I just blocked fonts with the plugin uBlock Origin accidentally (it was a permanent setting). So the problem was the user, not the software :rolleyes:

I will mark this issue as solved, even if it would be very nice of you to get some answers of the questions which are a few lines above.

Thanks a lot to this awesome community 👍
 

getopt

Aspiring Daemon

Reaction score: 411
Messages: 609

And I've solved the problem with the awesome fonts in Firefox, too. I just blocked fonts with the plugin uBlock Origin accidentally (it was a permanent setting). So the problem was the user, not the software :rolleyes:
Did you toggle Block remote fonts in uBlock Origin?
If that is the case, you allowed the download of web fonts from the Internet. In that case you do not use the local installed fonts.
 
OP
OP
M

maxmoon

Member

Reaction score: 4
Messages: 32

Did you toggle Block remote fonts in uBlock Origin?
If that is the case, you allowed the download of web fonts from the Internet. In that case you do not use the local installed fonts.
Well, you are right! I can only load remote fonts. My local fonts aren't automatically detected. The only way to get local font awesome is to go to Firefoxes preferences and choose font awesome by hand. Then I can see all the icons on this website (without remote fonts).

But why isn't Firefox smart enough to select it by itself? Or am I missing something here?
 
Top