Git Product home page Git Product logo

Comments (4)

l4l avatar l4l commented on August 25, 2024

Ugh, why font handling is such a mess. As a quick workaround: you may specify an absolute path (e.g /usr/share/fonts/inter/Inter-Regular.ttf).

I couldn't reproduce your case yet, for me output is the following:

[2022-10-01][10:11:38][yofi::font::fdue][INFO] The font Inter could not be found.
[2022-10-01][10:11:38][yofi::font::fdue][INFO] Best matches:
	Inter Bold
	Inter Thin
	Arial
	Inter Black
	Inter Light

Do you have some no-default path for this font? It seems rust-fontconfig that searches fc-cache doesn't handle xdg dirs properly, is it your case?

from yofi.

Pound-Hash avatar Pound-Hash commented on August 25, 2024

Okay, the absolute path works. (I thought I tried that before)

The fonts I want are located in $HOME/.local/share/fonts/

I leave /usr/share/fonts/ just for system fonts from my distro (Arch)

My other apps load the fonts fine.

It seems rust-fontconfig that searches fc-cache doesn't handle xdg dirs properly, is it your case?

Sorry, I don't know what you mean. I don't know rust. But fontconfig registers all my fonts fine. I can print all their information (For example, with fc-list --verbose)

from yofi.

l4l avatar l4l commented on August 25, 2024

Sorry, I don't know what you mean. I don't know rust. But fontconfig registers all my fonts fine. I can print all their information (For example, with fc-list --verbose)

Yeah, sure. The link is for the library I'm using for finding fonts, it's not a system fontconfig thus a different behavior. It doesn't handle XDG standard directories, in particular yours $HOME/.local/share/fonts/. You may find searched dirs with grep '<dir>' /etc/fonts/fonts.conf, for me it produces the following output:

	<dir>/usr/share/fonts</dir>
	<dir>/usr/local/share/fonts</dir>
	<dir>~/.fonts</dir>

So basically these 3 dirs are searched. There are also entries <dir prefix=..>..</dir> in that file but these are handled poorly (prefix=xdg in particular implies searching in $HOME/.local/share). Includes are not supported as well so anything in /etc/fonts/conf.d is not considered.

Unfortunately I didn't find any other libraries for that job and I don't really want to be bound to fontconfig system libs. Hopefully I make my own implementation soon.

from yofi.

Pound-Hash avatar Pound-Hash commented on August 25, 2024

I get the same output when grepping /etc/fonts/fonts.conf

I'm a novice coder, but to me it seems strange that the tilde (~) would be referenced here. I thought it was considered poor form to use the tilde anywhere outside of the command line, and that instead we should use $HOME.

Additionally, by only looking at the base of the home directory, we're inviting our home to be cluttered with dot files. Again, strange policy.

In any case, I'll go with the absolute path for now.

Thanks again

from yofi.

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.