sudipshil9862 / fonts-compare

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

selecting some languages choosing same font for both fonts #50

Closed juhp closed 3 months ago

juhp commented 3 months ago

Observed

Start fonts-compare, select Tamil or Hindi or Arabic or Hebrew: then same font is chosen for both text fonts. eg Noto Sans Tamil, etc

Expected

Different fonts to be chosen: eg Noto and Lohit for Tamil, etc

juhp commented 3 months ago

Similarly if I edit the text to 日本 the fonts are both chosen to be Noto Sans CJK SC and no other choices appear in the selectors. (In this case it would actually be nice to have a way to disable language detection, since this text could also be Japanese for example, but that is a separate feature.)

But if I enter すし (which is detected as Japanese), Noto Sans CJK JP and Droid Sans Japanese are selected.

sudipshil9862 commented 3 months ago

Thanks for bringing it up @juhp . I checked with these languages: Tamil or Hindi or Arabic or Hebrew Seems like Tamil and Hindi is perfectly working fine and rendering Lohit Tamil/ Lohit Devenagari and Noto Sans Tamil/ Noto Sans Devenagri perfectly.

But in Arabic and Hebrew it is not selecting the default font. In Arabic, it should select "Paktype Naskh Basic" as first one and "Noto Sans Arabic/Noto Naskh Arabic" as second one, but it is not selecting the first one instead giving "None"

Need to check the priority of both.

juhp commented 3 months ago

Let's ignore Arabic for now, it is more complicated anyway.

Hindi doesn't for me - eg I just retested in a Live instance of Fedora 40 and it shows Noto Sans Devangari for both texts. (Similarly for various other scripts I think)

juhp commented 3 months ago

Interestingly Bangla is okay (Noto Sans and Noto Serif) - but Marathi also behaves like Hindi (and Tamil, Telugu etc) Also Gujarati is okay - I don't see a pattern yet...

(Though for Arabic I would rather see Noto Sans Arabic and Noto Naskh Arabic: I think they are more general styles I think)

sudipshil9862 commented 3 months ago

it's very frustrating to see your project giving bad result even if it was giving results perfectly. Do you it started become bad after rawhide shifted to f41 ? Below I uploaded the screenshots of fonts-compare in f39 and f40. [left - f39 || right - f40]

telegu-39-40 tamil-39-40 hindi-39-40 gujrati-39-40 bengali-39-40 arabic-39-40

juhp commented 3 months ago

Not sure what changed - we can try to retest on f39 etc

sudipshil9862 commented 3 months ago

two major problem I faced while dealing with the issue:

  1. A font name can be possible like: Noto Sans Tamil,Noto Sans Tamil
  2. sometimes fontconfig includes style in family name like Noto Sans Tamil Condensed so if first button already selects Noto Sans Tamil and second button's font is Noto Sans Tamil Condensed, then it will considered these two as different font. But we know Noto Sans Tamil and Noto Sans Tamil Condensed are same
sudipshil9862 commented 3 months ago

Also it't not random font, so I'm changing the random phrase to other

juhp commented 3 months ago

This seems to be working well, thanks

I suppose the other font selection could still be further refined in the future perhaps (eg Nuosu is probably not the most obvious 2nd choice for English) but this seems much better already.