elenapan / dotfiles

There is no place like ~/
GNU General Public License v2.0
3.51k stars 175 forks source link

font issue - typicons icons not appearing in terminal #121

Closed EllatharTheHalfling closed 3 years ago

EllatharTheHalfling commented 4 years ago

I'm back again with another slight issue that's really only a minor inconvenience. This time with something that was working prior (at least, was working after a file change), unfortunately that's no longer the case.

Kitty appearance shown with bunnyfetch: 2020 10 19-19 35 17 screenshot

Kitty.conf relevant section:

# Fonts
font_family      monospace
italic_font      auto
bold_font        auto
bold_italic_font auto
font_size        10.0

fontconfig:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <!-- set monospace font -->
    <match target="pattern">
        <test qual="any" name="family"><string>monospace</string></test>
        <edit name="family" mode="assign" binding="same">
            <string>Iosevka Custom</string>
            <string>Typicons</string>
            <string>icomoon</string>
            <string>Material Icons</string>
            <string>Noto Color Emoji</string>
        </edit>
    </match>
</fontconfig>
elenapan commented 4 years ago

Hi there,

The kitty font configuration seems good to me. The only difference I see with my setup is in your fontconfig section.

- <edit name="family" mode="assign" binding="same">
+ <edit name="family" mode="prepend" binding="strong">

Could you try this and let me know?

EllatharTheHalfling commented 4 years ago

Nothing changed with that edit. For now what I've done, for the sake of appearance, is use icons that I've copy/pasted into the bunnyfetch script from a document editor, using the FontAwesome icons and also changing the fonts.conf file to search for Font Awesome instead of Typicons.

It works for now, however I"m not sure if that's necessarily a fix and I am willing to continue trying as I do have backups of the original font.conf and bunnyfetch.

Something I forgot to mention is I'm currently on Ubuntu 19.10, so my current guess (given that searching for Font Awesome and using the icons copied from a document editor into the script does work) is that the OS is reading and displaying the font differently? this could very well also be a case of so many fonts in the system that the original icons that were intended to be there are being displayed using a different monospace font.

EllatharTheHalfling commented 4 years ago

Hey Lena,

Just wanting to update you on what I've found in my searching.

I installed another font labelled Typicons (where the font was searchable in a document editor as Typicons instead of Font Awesome)

using this font I was able to see the icons from typicons just fine, though the caveat here is that the symbols expected still isn't what is shown and they do need to be replaced either way, but this would simply be copy/pasting the symbols themselves from a document editor into bunnyfetch rather than doing that and editing fonts.conf.

Anyway, this is leading me to believe that for those on ubuntu (and possibly other debian based systems) the font provided gets installed as Font Awesome Regular, not Typicons, and therefore fonts.conf needs to reflect this differentiation.

where I happened upon the other font file that allowed me to use the original font.conf file is the following location https://materialsproject.org/static/fonts/typicons/

If you'd like I can at least provide the updated bunnyfetch and fonts.conf to show your intended glyphs (since I had chosen to change mine since I was in there anyway) and it could possibly be added in as a variant for those that might be in the same situation (though I imagine this is rare as from what i've seen few people use a WM on top of base ubuntu)

elenapan commented 4 years ago

Hi there, thank you very much for the update.

I was not aware that Typicons are now included in Font Awesome. You are right that, in this case, the font family should not be set as Typicons inside fonts.conf.

Regarding your issue with the stand-alone Typicons font, it could be that various updates to the font may have caused some glyphs to be displaced, so people who are using newer versions than me get different glyphs than the ones I intended.

In that case, have you tried the Typicons font uploaded on my dropbox? It is an older version which I have been using for more than a year and the bunnyfetch glyphs should render correctly with it.

Of course, I would also appreciate it if you you could post your updated bunnyfetch and fonts.conf. I will be redirecting anyone who has the same issue to your answer here. Thank you again!

EllatharTheHalfling commented 4 years ago

Sorry for the delay. I did try the Typicons font in your dropbox and it didn't resolve the issue.

There is another issue that I did notice, however. in that the icons will have colored blocks after them, seems to be reading the space as a character with typicons. I haven't found a fix for this and will continue looking in my spare time because it's an issue that i did have with the previous versions of all this. For this reason I really suggest the Font Awesome folder in the upload as it's the cleanest option. Have some other issues I've noticed and what I'll probably end up doing is making a bunch of variants to better work on 19.10 especially since these wouldn't just apply to me, but those with Pop!_OS as well.

So anyway here's the files. https://github.com/EllatharTheHalfling/Dotfile-variants/tree/main/Lena%20Variants

Oh, side note (unrelated to this) I did start playing around further and noticed some things that should be working in Awesome, but seemingly don't. will probably be opening issues for them if I honestly can't figure them out. Will probably need someone to test these to see if it's an issue with the build of Awesome or something else.

EllatharTheHalfling commented 4 years ago

Hey Lena,

Wanted to give a bit of news that may change things: I had a system failure that required a reinstall and rather than restore from a backup I chose to start over as there were some issues that plagued the system as well as some optimizations that I needed to make anyway. There is a chance the above becomes null due to some errors that were on the original install that are no longer present, so if we could keep this open for the time being until I know for sure. I should have everything finished by this weekend.

EllatharTheHalfling commented 3 years ago

came to give a small update: this is gonna take longer than the weekend. now it's not working at all, regardless of which font I use. not quite sure what's causing the issue this time. this is what i'm seeing now regardless of which font i've tried. 2020 11 07-15 59 11 screenshot

however, i'm also noticing that the devicons plugin for ranger produces the same lines 2020 11 07-16 00 50 screenshot

so i'm going to continue to look into this. i'm really starting to think that the system parses fonts differently, so once i have a definitive answer i'll update you.

i'll leave it up to you whether you want to close this issue or leave it open in hopes of someone else coming in and offering some insight. but as it stands i'm at a loss and will probably take a few days away from this issue while i work on the rest of the system.

EDIT: After a quick reboot icons are sorta working. Did double check with all configurations available previously. This time around, however, it does seem as though there is a conflict in unicode characters between Font Awesome, Typicons, and the patched Nerd Fonts used for ranger's devicons plugin. this is made more apparent by the fact that some of the icons that should appear using Font Awesome.

Current Bunnyfetch viewed in vim: 2020 11 07-23 47 41 screenshot

Bunnyfetch output in Kitty (one of the hearts is this weird squiggly, not really sure where that's coming from) 2020 11 07-23 49 13 screenshot

even though i know it's not a part of your dotfiles, nor does it really have anything to do with yours, here's devicons ranger plugin working beautifully. this is primarily to show that at least part of the issue has been resolved and that these two issues were, in fact, linked. 2020 11 07-23 45 06 screenshot

so on one hand I can say that the issue is resolved to an extent. they are showing, in that regard it is solved. however they are still not showing correctly and for the sake of fixing that I'd like to change the title. Opening a new issue seems redundant as it seems like much of this is related.

EDIT 2: 2020 11 08-14 35 30 screenshot

This is finally working again, after installing (yet another) fontawesome font with a different designation. I said I would take a break and totally didn't.

so some things I've noticed in trying to fix this (and what finally lead me to realizing I mighta been going about this the wrong way): the font config should not be located in ~/.fontconfig/fonts.conf but rather it should be in ~/.config/fontconfig/fonts.conf as stated in the manpages for font-config in ubuntu. wrong file location placement meant that i wasn't getting any of the fonts designated for use. I'll test again with typicons as I think this may have solved that issue entirely, but I want to do a few more tests.

using multiple fonts with overlapping characters will cause some characters to be displayed via whichever has a higher priority in the system. This is most apparent here with the devicons plugin for ranger showing the desktop symbol as much larger than the folder icons. 2020 11 08-14 43 38 screenshot

during the initial tests i realized Kitty was being launched via kitty -1 but I couldn't find this flag anywhere in the documentation (at least so far) and was wondering if you could maybe explain what this is? during testing I had to keep it at just kitty otherwise icons wouldn't show up anywhere and I was mostly using that visual indicator to determine if i was going in the right direction before going further in a given direction. launch of kitty is back to kitty -1 however, and working just fine.

elenapan commented 3 years ago

Oh hey, sorry for the delay, I did not get notifications for your edits.


Finally, I very much appreciate that you are going the extra mile by explaining what you are doing. I do not mind keeping the issue open. You are free to close it whenever you feel like the issue is resolved.

EllatharTheHalfling commented 3 years ago

Alright, well I still want to try to figure out a way to keep things without editing your dotfiles too much on ubuntu if possible. and yeah the heartbeat icon is a font awesome icon, but the regular heart is not strictly fontawesome and it would turn into a weird blob. pretty sure that's caused by multiple fonts using the same unicode character code and there's really no way around that other than specifying the exact font you want to load.

I'll keep it open for a few more days, if I still can't find a fix that is definitive I'll unfortunately have to consider this a problem that people on certain versions of ubuntu will have to sort out themselves. It's not too hard to do so, just frustrating (especially if you don't know where to start).

Lastly, I enjoy going through the extra effort of trying to explain things the best I can. I often find myself in git issue trackers if I have an issue and nothing bothers me more than seeing someone figure something out, but not share how, and then by the time I, or someone else, find it and go to ask, it's been months or years and they've forgotten how.

EllatharTheHalfling commented 3 years ago

Alright so, I'll be closing with this comment, but basically to sum up everything so far:

Ubuntu puts fontconfig in ~/.config/fontconfig/fonts.conf

The fonts installed at this point are: typicons.ttf (which is installed as Font Awesome) from the dotfiles here and fontawesome.ttf which is Font Awesome 4.7.0 from gabrielelana's repo for terminal awesome fonts. the font.conf configuration is currently as follows:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <!-- set monospace font -->
    <match target="pattern">
        <test qual="any" name="family"><string>monospace</string></test>
        <edit name="family" mode="assign" binding="same">
            <string>Iosevka Custom</string>
            <string>FontAwesome</string>
            <string>icomoon</string>
            <string>Material Icons</string>
            <string>Noto Color Emoji</string> 
        </edit>
    </match>
</fontconfig>

Bunnyfetch does need to be edited after installing fonts to use unicode characters that the user finds as I've now run into 5 different occasions where characters change places to prevent conflict where possible. bothersome, but it's the way it is it seems. At least on Ubuntu 19.10 (Won't be able to test on 20.04 until particular setup is viable to move over)

In the event that the person is using both these and the ranger devicons plugin, ranger needs to be loaded in kitty.launched without the single-instance flag otherwise there are conflicts with devicons where they will sometimes show and sometimes not, either way the fontawesome characters that would normally overlap with devicons will be given priority if ~/.config/fontconfig/fonts.conf has the fontawesome font designated in it.

no other conflicts to note as of this time.

I will be adding these files to the variant dotfiles I've uploaded previously which can be found here in hopes that at least one of them helps someone. But I cannot create files for every possible instance (nor do I want to try) and so it's a lot of tinkering to be done.

This has honestly been an experience and while I'm starting to regret using Ubuntu more and more each day I can't really say i don't enjoy the challenges I've been met with.