-
Notifications
You must be signed in to change notification settings - Fork 46
Override/blacklist DejaVu emoji glyphs without making Emoji One Color the default font #17
Comments
Yes, still looks like the best solution. Microsoft and Apple probably ship emoji characters in a separate font for this reason. Short term goal: DejaVu Sans without emoji to ship with this font. Follow along here: https://github.com/eosrei/dejavu-fonts/tree/emoji |
This font: https://github.com/eosrei/dejavu-fonts/commit/46ba8581cd599b4e4e247c5d3d19e02aa99f73fa with the following
|
The DejaVu font family is based on the Bitstream Vera font family to provide greater unicode coverage. The only way to override the emoji it includes is to make the emoji font the primary system font. This shouldn't be a problem, but a number of programs do not correctly use font fallback resulting in font rendering errors everywhere: #1, #5, #16, #18, #19. This font.conf makes Bitstream Vera the default font for Serif, Sans-Serif, and Monospace font requests since it does not contain any Unicode Emoji characters. Emoji One Color font is the first fallback, followed by DejaVu to provide everything else. Test with: fc-match -s serif fc-match -s sans-serif fc-match -s monospace May be the solution for #17
I've found a much better solution to this issue: Bitstream Vera! It's the basis for DejaVu and doesn't include all of these characters needing to be overridden. Bitstream Vera is going to be the default install recommendation going forward. Noto can work if modified to remove a few emoji from the regular fonts which IMO should be moved to Noto Emoji I'll open on that project about it. |
Specifically add notdef, null, CR and space. Space is hardcoded to a width of 1024. Todo: Space width should be a config yaml option. The font rendering systems are supposed to fallback to the space width in the next available fallback font, but it doesn't work reliably. Workaround for: 13rac1/emojione-color-font#2 Caused by: https://bugzilla.gnome.org/show_bug.cgi?id=757785 Related: 13rac1/emojione-color-font#17
Requires Bitstream Vera as the default serif, sans-serif, and monospace font family since it contains no emoji characters. Any other emoji-less font can be used, but most systems include Bitstream Vera so it is used here as the example default. Noto works well except primarily for 0x2639 and 0x263a. See fonts.conf example: fontconfig/user-bitstream-vera-fonts.conf Workaround fix for #2 Related to #17
DejaVu is the default font family for Linux. My provided fontconfig is the solution for this. |
fonts.config installed with this tdistributio give result from this screenshot. |
Please open a new issue with the following details:
|
The Problem
The current readme recommends creating/modifying the user's fontconfig
fonts.conf
to make Emoji One Color the primary fallback font forsans-serif
,serif
and,monospace
font families. This causes a number of issues including #1, #5, and #16. Ideally the DejaVu font family would stay the default and Emoji One Color would override/replace the emoji included in DejaVu Sans.According to my tests in #16 (comment), only DejaVu Sans has the actual emoji characters which cause this problem:
which is what happens when the recommended
fonts.conf
is not installed.A nice solution would be to blacklist the DejaVu Sans glyphs...
Blacklisting glyphs
There has been a number of requests for an option to "blacklist glyphs" or "create virtual fonts" in fontconfig over the years, but there is no current implementation AFAIK. (Too much detail follows, but this is a good place to keep the research.) 😉
src: https://lists.freedesktop.org/archives/fontconfig/2004-October/001045.html
src: https://sourceforge.net/p/dejavu/mailman/message/9671050/
src: https://lists.freedesktop.org/archives/fontconfig/2008-January/002847.html
Followed up by:
src: https://lists.freedesktop.org/archives/fontconfig/2008-January/002850.html
src: https://mail.gnome.org/archives/gtk-i18n-list/2007-December/msg00007.html
Solutions
As much fun as it would be to go down another rabbit hole, I don't have the time to patch fontconfig right now. Plus, backwards compatibility would still be an issue. The recommended solution is to remove the offending glyphs.
src: https://lists.freedesktop.org/archives/fontconfig/2008-January/002846.html
This means a fork of DejaVu Sans is probably the answer. Any other ideas?! 😎
The text was updated successfully, but these errors were encountered: