Re: [Tuxpaint-devel] Font scoring method
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Pere P. i C. <per...@gm...> - 2022-12-17 12:58:05
|
El ds. 17 de 12 de 2022 a les 11:03 +0900, en/na Shin-ichi TOYAMA va escriure: > Hi! > > I've looked into the font scoring method in 'dirwalk.c' and 'fonts.c'. > > The function 'charset_works()' scores up the given font if ALL > characters passed to it are correctely rendered. > > However, it seems to have nothing to do with checking if the font > renders given characters distinctly. I was not able to understand what > qsort() in charset_works() do. charset_works() passes or fails a font given all characters passed to it render and render different. Sometimes a font substitutes lacking characters by "unknown rectangle", that dont count as a fail as the font renders the character, to catch this, you need to make 2 characters rendering as "unknow rectangle" > > > I confirmed that adding Japanese characters to the translations for the > strings used for scoring works to place the font supporting Japanese > characters on top. > > The result is good but I am not so confident it is a correct way as > originaly intended in font scoring method. In plus of the font quality translation scoring, there is more score in fonts.c based on font name and bold/italic, so is harder for a font that has the needed character set but lacks bold/italic variants to raise on top. > > I suppose it is more reasonable to have additional string for scoreing > to score up the fonts supporting locale specific characters. > > For example; > > user_font_styles[num_font_styles]->score += 10 * > charset_works( > font, > /* put locale specific characters to the translation for this > string to score up the fonts supporting those characters. */ > gettext("ABCXYZ") > ); > All in all I am for this addition, it would raise fonts supporting the locale charset and left place for quality font scoring with the current system. Pere |