Giter Club home page Giter Club logo

Comments (10)

13rac1 avatar 13rac1 commented on May 25, 2024

Ah, this will be better. I've got so much time in figuring out this fontconfig in the first place, I didn't think about the conf.d. Reference from 50-user.conf:

        <!--
            Load per-user customization files where stored on XDG Base Directory
            specification compliant places. it should be usually:
              $HOME/.config/fontconfig/conf.d
              $HOME/.config/fontconfig/fonts.conf
        -->
        <include ignore_missing="yes" prefix="xdg">fontconfig/conf.d</include>
        <include ignore_missing="yes" prefix="xdg">fontconfig/fonts.conf</include>

Looking at /etc/fonts/conf.d/README:

 Files begining with:   Contain:

 00 through 09      Font directories
 10 through 19      system rendering defaults (AA, etc)
 20 through 29      font rendering options
 30 through 39      family substitution
 40 through 49      generic identification, map family->generic
 50 through 59      alternate config file loading
 60 through 69      generic aliases, map generic->family
 70 through 79      select font (adjust which fonts are available)
 80 through 89      match target="scan" (modify scanned patterns)
 90 through 99      font synthesis

Starting the filename with 10 isn't correct. The Arch packages use a fontconfig starting with 35. I'd like to make the provided fontconfig file usable for both user-only and system-wide installs.

This blocks #9

from emojione-color-font.

13rac1 avatar 13rac1 commented on May 25, 2024

DejaVu uses 57 and 58:

57-dejavu-sans.conf
57-dejavu-sans-mono.conf
57-dejavu-serif.conf
58-dejavu-lgc-sans.conf
58-dejavu-lgc-sans-mono.conf
58-dejavu-lgc-serif.conf

Perhaps it should be 56? 59? 71? Since I created an "emoji" generic family, perhaps it makes sense to separate it into two files at 35 and 59?

@edgemaster: Any thoughts? Why did you select 35 for the fontconfig filename? I'm doing some tests now and 35 works with fc-match -s for "sans" and "emoji", but not correctly for "Bitstream Vera Sans". Well, I've figured a place to implement unit tests and/or travis.ci! Hmm... The current file works correctly at 56.

from emojione-color-font.

IgnoredAmbience avatar IgnoredAmbience commented on May 25, 2024

I picked 35 as a bit of a guess, and roughly following the hints given in the fontconfig system readme.
Arch ships the default font config files with the patches at https://projects.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/fontconfig
I'm not sure if other fonts diverge from other standard configs.

It is the priority of the config file I was referring to previously when I said that I needed to test the arch system install further. I didn't have the time you track down/run through test cases for each of the relevant configuration bugs though.
I seem to remember that there's some oddity with other font priorities relative to the user configuration priority also.
Need to compare with Debian/Ubuntu to see how the distributions differ.

from emojione-color-font.

13rac1 avatar 13rac1 commented on May 25, 2024

Ah ha! I will figure out a good way to do automated testing to make it easier to confirm.

from emojione-color-font.

13rac1 avatar 13rac1 commented on May 25, 2024

This looks good enough for confirming correct installation:

$ fc-match -s sans | head -n2
Vera.ttf: "Bitstream Vera Sans" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
$ fc-match -s serif | head -n2
VeraSe.ttf: "Bitstream Vera Serif" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
$ fc-match -s "Emoji One Color" | head -n2
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
Vera.ttf: "Bitstream Vera Sans" "Roman"
$ fc-match -s "Bitstream Vera Sans" | head -n2
Vera.ttf: "Bitstream Vera Sans" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
$ fc-match -s mono | head -n2
VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
$ fc-match -s monospace | head -n2
VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

I'm going to automate it into a tests.sh

from emojione-color-font.

13rac1 avatar 13rac1 commented on May 25, 2024

@edgemaster I've made a tests.sh to do some "unit tests". It compares a diff of current fc-match -s "$FONT" | head -n2 results to expected results. The output on my machine:

diff current-results.test expected-results.test
Font: sans                                                         Font: sans
Vera.ttf: "Bitstream Vera Sans" "Roman"                            Vera.ttf: "Bitstream Vera Sans" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: sans-serif                                                   Font: sans-serif
Vera.ttf: "Bitstream Vera Sans" "Roman"                            Vera.ttf: "Bitstream Vera Sans" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: serif                                                        Font: serif
VeraSe.ttf: "Bitstream Vera Serif" "Roman"                         VeraSe.ttf: "Bitstream Vera Serif" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: mono                                                         Font: mono
VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"                   VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: monospace                                                    Font: monospace
VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"                   VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: Bitstream Vera Sans                                          Font: Bitstream Vera Sans
Vera.ttf: "Bitstream Vera Sans" "Roman"                            Vera.ttf: "Bitstream Vera Sans" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: Bitstream Vera Serif                                         Font: Bitstream Vera Serif
VeraSe.ttf: "Bitstream Vera Serif" "Roman"                         VeraSe.ttf: "Bitstream Vera Serif" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: Bitstream Vera Sans Mono                                     Font: Bitstream Vera Sans Mono
VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"                   VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: Emoji One Color                                              Font: Emoji One Color
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
Vera.ttf: "Bitstream Vera Sans" "Roman"                            Vera.ttf: "Bitstream Vera Sans" "Roman"

Fontconfig tests: PASS

from emojione-color-font.

IgnoredAmbience avatar IgnoredAmbience commented on May 25, 2024

Awesome. I'll give it a whirl and see how tweaking the priority of the configuration file impacts things.

from emojione-color-font.

13rac1 avatar 13rac1 commented on May 25, 2024

I've changed the file to 56-emojione-color.conf since it passes all of the tests in test.sh correctly.

The user installer has been updated to put the file in $HOME/.config/fontconfig/conf.d/. This also works for system-wide install.

@frederik-elwert I still need to backup the user's existing font.conf for backwards compatibility. Let me know if you can think of any better way to handle the upgrade process. Maybe I could get crazy and hash the file? Seems overkill.

from emojione-color-font.

IgnoredAmbience avatar IgnoredAmbience commented on May 25, 2024

Installing at 56 causes many fonts in Firefox to become Bitstream, even when specified to be otherwise.

For example, the UI flow of the GitHub webpages is broken with Bitstream.

Trying to work out how CSS font selectors interact with the system fallbacks...

from emojione-color-font.

IgnoredAmbience avatar IgnoredAmbience commented on May 25, 2024

Apologies for the noise, I'm describing #31.

from emojione-color-font.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.