-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Without proper default fonts, emojis crash st #284
Comments
I personally do not use your configs, but I was also having this exact issue after receiving an emoji in the subject of an email... This problem seems to be a recurring one for st in the last few years. |
I have all these fonts installed and the LARBS fontconfig file, and i still get crashes from time to time when running |
Also related
By the way - I'm experiencing this issue and the provided solutions, sadly, do not help.. |
Update - I finally made it work for myself with some HUGE help from @pat-s! Everything was discussed in the LukeSmithxyz/LARBS#119 issue, but since Luke made LARBS read-only, the issue's no longer there... I'm discussing the solution with @pat-s right now - we'll will provide it very soon - hopefully it works not only for us, but for all of you! |
This post should serve as a summary for what has been discussed in LukeSmithxyz/LARBS#119 and via mail between @sarpik and me. IntroductionThe reason why A "fallback" font is used when a specific glyph is requested that is not found within the font used by The default font used by LARBS installs Possible reasons for crashes
Solutions
How to still get colored emoji support without
|
@pat-s Frankly speaking I just don't understand the logic of fontconfig so if you've done the research, it might be better for you to give it a try. As long as st can render what monospace emojis exist and won't crash, it's fine with me. I would like to avoid adding dependencies though (including noto emojis), but if we have to, I can. |
I guess the most robust approach would be to add <!-- This sets Symbola as the final fallback font for the monospace font family. -->
<match target="pattern">
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append"><string>Symbola</string></edit>
</match> to |
This still happens to me even with the latest update of LARBS and having #293? |
|
|
Did you also follow all points in #284 (comment)? My <?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias>
<family>serif</family>
<prefer><family>Fira Sans</family></prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer><family>Fira Sans</family></prefer>
</alias>
<alias>
<family>sans</family>
<prefer><family>Fira Sans</family></prefer>
</alias>
<alias>
<family>monospace</family>
<prefer><family>Mononoki</family></prefer>
</alias>
<!-- This sets Symbola as the final fallback font for the monospace font family. -->
<match target="pattern">
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append"><string>Symbola</string></edit>
</match>
</fontconfig> |
If you really can't get it to work, you can try using another terminal in the meantime, like gnome-terminal (color emoji support). Although I'm sure the keybindings will screw up the setup. |
Mine looks like this <?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias>
<family>serif</family>
<prefer><family>Linux Libertine</family></prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer><family>Linux Biolinum</family></prefer>
</alias>
<alias>
<family>sans</family>
<prefer><family>Linux Biolinum</family></prefer>
</alias>
<alias>
<family>monospace</family>
<prefer><family>Inconsolata</family></prefer>
</alias>
<!-- This sets Symbola as the final fallback font for the monospace font family. -->
<match target="pattern">
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append"><string>Symbola</string></edit>
</match>
</fontconfig> |
The presise cause of the issue is not st itself but xft. Xterm had the same issue a while back. And dmenu and DWM also has the same issue. There is a work around for DWM in the mailing list. Maybe the patch can be ported to st. The link is below https://lists.suckless.org/dev/1610/30720.html EDIT: spelling error due to autocorrect |
I changed |
Are there any other people for whom this eliminates the problem? If so, I might make the change @kvannotten has in my st repository. |
Don't merge this change, it has some weird downsides with certain shortcuts no longer working. |
Update. Should be solved in line 1289 |
@LukeSmithxyz you can close this one, a patch has been added for those who haven't fixed it yet |
For anyone ending up here I found a very hacky solution to avoid crashes in st (LukeSmithxyz/st#37): In the function xdrawglyphfontspecs (in x.c), change: XftDrawGlyphFontSpec(xw.draw, fg, specs, len); into: FcBool b = FcFalse;
FcPatternGetBool(specs->font->pattern, FC_COLOR, 0, &b);
if (!b) {
XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
} The change prevents that any colorized glypth (character) to be rendered and will only fill a blank space. The other (discussed above) avoid the mapping of colorized glyphs. I think this could be optimized, but I lack time to investigate this. Bit confused how the caching mechanism works in st. |
This doesn't fix the crashes for me. |
@tbergeron there have been some important updates on this issue just recently - see https://youtu.be/f9qNXV01yzg. I've had my crashes fixed prior to the video, but it should now help you not get them in the first place. It also allows you to have colorful emoji in xorg (including st, dmenu etc.), but I myself have not managed to get them to work.. I think there might be some important steps Luke might've forgotten to mention, or I'm messing stuff up myself. Either way, no colorful emoji for me so far :c |
I manage to make it work the emoji
then
this will add a fallback to all emoji .... then i edit my st build
i remove the conditionals for rendering the glyp to just render it and i change my .config/font-config/fonts.conf
then i edited dmenuunicode script , and change font to Dmenu Shows None Colored Emoji while St , VSCODE allows you to see emojis @LukeSmithxyz can u confirm this is the same process as you did? The only problem im facing now is the initial dmenuunicode options shows no emoji Hope we can find better solution to this .... for now i will revert back to the old config i have its better and faster even if no color emoji |
thank you very much, |
Just installing joypixels-android.ttf and Symbola.ttf solved the problem on Ubuntu 20.04 LTS for me. There are plenty registration stuff on joypixels site, so archlinux link is better, but I did not compare their checksums. Also, the Symbola could be downloaded directly from author's site: https://dn-works.com/wp-content/uploads/2020/UFAS-Fonts/Symbola.zip |
For Gentoo users, |
@ollintzinlab or you can just add this patch uditkarode/libxft-bgra@72e54c0 to |
#284 (comment) worked for me, but @pat-s please edit your link to https://pat-s.me/emoji-support-for-notion-so-on-linux/ |
Just commenting, in case anyone still had the issue in Ubuntu 22.04 - this post explains how to install libXft the latest version, as well as how to properly install it. It aims at making Luke's st build to work. |
On some systems, the terminal,
st
will crash when trying to render emojis and other unique unicode characters. This problem generally arises when users lack emoji fonts or a bad emoji font is default; at least, that seems to be the cause.The font packages below are installed by LARBS to give pretty much full unicode overage. If you are having terminal crashes when you clone and run my dotfiles, you will want to install these. That will in most cases solve the problem:
You might also want to install
noto-fonts
; I don't think that's necessary, but I have it on my machine.If the problem persists, you should probably explicitly state what fonts to use. Here is the LARBS fontconfig file, which with these fonts seems to avoid this crash.
I'm making this issue here because there are at least a half dozen other issues on my repos about this. I'm aware of the issue, but the original cause might be something out of my control or ken.
I suspect it has something to do with how st or one of its libraries handles fontconfig errors. If that problem persists, I might drop fontconfig usage by st and have it manually specify fonts.
The text was updated successfully, but these errors were encountered: