sudipshil9862 / fonts-compare

fonts rendering and comparing
GNU General Public License v2.0
5 stars 2 forks source link

Replace use of python-fontconfig with fc-list #13

Closed mike-fabian closed 1 year ago

mike-fabian commented 1 year ago

Resolves: https://github.com/sudipshil9862/fonts-compare/issues/12

juhp commented 1 year ago

Btw I think the word "random" in the existing code is a misunderstanding: I wanted to suggest changing that naming, Sudip.

The idea isn't to select a random font, but a different font family to the default one (with its default weight, which one can't determine directly from fc-list (nor python-fontconfig of course) I think).

mike-fabian commented 1 year ago

The idea isn't to select a random font, but a different font family to the default one

Which different one should one choose?

(with its default weight, which one can't determine directly from fc-list (nor python-fontconfig of course) I think).

I think that is possible to filter out only the default weights. There are only a few names for default weights like Regular or Book, easy to filter the list for that and throw also the default family from the list.

From the remaining list choose which one? Sort alphabetically and choose the first?

mike-fabian commented 1 year ago

Or, instead of choosing alphabetically, one could choose the font family name which has the greatest Levenstein distance to the default family name to avoid to get another variant of the same font family.