silnrsi / langfontfinder

The Find A Font service code
Other
3 stars 2 forks source link

feat: support multiple fonts for a language #11

Open mcdurdin opened 8 months ago

mcdurdin commented 8 months ago

In order to make this useful for Keyman (see keymanapp/keyman#10947), we'd really like to have a list of common fonts for a language, not just a single font (family) per language. Some metadata on font styles may be helpful but not necessarily required initially.

We would probably want to download the fonts and present samples to the user so they can choose their preferred style. (How to best to do that is a whole new question!)

devosb commented 8 months ago

I created (and others have improved) such a list of common fonts for a language (well, for a script). There is a column for a suggested font. For other fonts, the general idea is that the most preferred fonts are towards the left side, and the least preferred fonts are towards the right side. For Arabic script in particular, which font is best really depends on the region of use. I thought all of this data would have already been reflected in the font finder service.

jvgaultney commented 8 months ago

Yes AFAIK that data is integrated into the data that the LFF draws upon - IOW we're no longer maintaining script2font.csv. However the LFF API currently returns only a single font family, not a list of all those in the data. We could change LFF to return more than one family if it's in the data.

imnasnainaec commented 7 months ago

@jvgaultney Yes, it would be very helpful for LFF to return the full list.

DavidLRowe commented 7 months ago

I think that the .csv file that @devosb cites is itself one of the data sources for LFF and is therefore maintained. (And we're grateful for any corrections / updates that users find.)

DavidLRowe commented 7 months ago

In addition, if we have an LDML file that applies to a specific locale (identified by BCP 47 code), that LDML file has font information. That font information may include specific features (for example, choosing which style of uppercase Eng is used).

Consider this scenario: LDML file xyz.xml has information specifying font Charis SIL with feature uppercase Eng set to 2. Additional font information from the table of fonts available by script says that Noto Sans and Noto Serif are additional fonts that support the Latin script. But we might not have any feature information for these additional fonts.

Question: Should we include these additional fonts, even though the feature set is not what we have recorded as what is preferred?

imnasnainaec commented 7 months ago

I think they should be included, yes, so that they can be offered to users, though not used for a default or recommended font.

A related thought: if LFF returns a list of fonts without any additional flag (e.g., status: recommended, hasFeatures: true, or alternate: false), then I expect we would by default recommend the first font and offer the rest as alternatives.