Skip to content
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

Package reconfigures default font to Bitstream Vera #108

Open
WhyNotHugo opened this issue Aug 13, 2021 · 0 comments
Open

Package reconfigures default font to Bitstream Vera #108

WhyNotHugo opened this issue Aug 13, 2021 · 0 comments
Assignees

Comments

@WhyNotHugo
Copy link

The fontconfig conf file provide by this package changes the default system sans font to Bitstream Vera.

The comments(and readme) indicate that the intent here was to replace avoid DejaVu Sans being used to render some emojis. I guess the author used DejaVu Sans, so the replacement is fine is fine for that particular setup.

However, there's a cleaner way to achieve the desired result: configuring fontconfig to ignore all of DejaVu Sans' characters in the emoji character range.

The results is that DejaVu's built-in emoji are ignored when rendering, so Twemoji is used instead. This means that user's don't have to unconditionally use Bitstream Vera (I agree 99% of the users using DejaVu won't notice, but for any other font the difference is far more obvious).

Here's a snippet, which I actually copied from the config file provided by ArchLinux [unofficial] package for ttf-twemoji.

    <!--
    If other fonts contain emoji glyphs, they could interfere and make some emojis rendered in wrong font (often in black-and-white).
    For example, DejaVu Sans contains black-and-white emojis, which we can remove using the following trick:
    -->
    <match target="scan">
        <test name="family" compare="contains">
            <string>DejaVu</string>
        </test>
        <edit name="charset" mode="assign" binding="same">
            <minus>
                <name>charset</name>
                <charset>
                    <range>
                        <int>0x1f600</int>
                        <int>0x1f640</int>
                    </range>
                </charset>
            </minus>
        </edit>
    </match>

The above linked file really has a few improvements which would also make sense to include in the packaged config file,

The key difference it doesn't reconfigure the system's default font (or, rather, it doesn't assume that everyone uses DejaVu Sans.

In reallity, I believe this can be extended to ignore emoji-range characters for all fonts that are not Twemoji, with something like (haven't fully tested this snippet):

<test name="family" compare="not_contains">
    <string>Twemoji</string>
</test>

Do you think switching to this strategy makes sense/

@13rac1 13rac1 self-assigned this Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants