Closed mike-fabian closed 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).
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?
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.
Resolves: https://github.com/sudipshil9862/fonts-compare/issues/12