Closed tagoh closed 1 year ago
Well, I guess this is a sort of the logic bug. Pango explicitly ignores the non-scalable fonts because it isn't useful. So you couldn't get the name from the list of fonts on the font chooser. that may be why I saw this.
You should also drop a font from the result when they have "PCF" in "fontformat".
Sorry, the above fix has ineffective and redundant code.
As I mentioned on Chat, "PCF" nor "fontformat" isn't a font family name. "fontformat" is a prioerty name available in fontconfig cache which contains a font format such as PCF, CFF, TrueType and so on. If a font has "PCF" as "fontformat" property, that would means they are a PCF font. In most cases, Pango doesn't care.
So I suggested you should simply drop such fonts from the list.
And what I also suggested on Chat is, you can get scalable fonts only by fc-list :scalable=true
. In this case, you don't need to go through the list and check if they are PCF or not because fc-list will filter it out.
What you need was to change this line:
[fc_list_binary, f':lang={lang}', 'family', 'style', 'familylang'],
To
[fc_list_binary, f':lang={lang}:scalable=true', 'family', 'style', 'familylang'],
That's it.
same way I did it indirectly like
from output of fc-list :lang={lang} family style familylang
, I removed the fonts that are the output of fc-list :scalable=false family style familylang
Thanks for the information
changing with fc-list :lang={lang}:scalable=true family
Here is the login:
firstly, it checks for output of fc-list :lang=en:scalable=true family
, which are scalable.
Secondly, it checks for fc-list :fontformat=PCF family
, which fonts have "PCF" as "fontformat" property
removing second output from the first output.
Secondly, it checks for
fc-list :fontformat=PCF family
, which fonts have "PCF" as "fontformat" property removing second output from the first output.
No. you don't need it! PCF is a bitmap font format and it is non-scalable font. As I said at https://github.com/sudipshil9862/fonts-compare/issues/33#issuecomment-1453925112, "you don't need to go through the list and check if they are PCF or not because fc-list will filter it out." that works enough.
fc-list :lang=en:scalable=true family style
will remove non-scalable fonts and PCF is non-scalable fonts. So, no need to check for "PCF" as "fontformat" property.
Thanks for the info @tagoh .. means a lot
When fonts-compare grabs a font "Biwidth" which is available from
efont-unicode-bdf
package on Fedora, the label of the font button displays "None".The debugging logs are attached: