notofonts / noto-build

Scripts, data and libraries to work with Noto fonts and sources
Apache License 2.0
5 stars 2 forks source link

Calculating Fallback font #17

Closed marekjez86 closed 3 years ago

marekjez86 commented 3 years ago

This is a comment on seeing the merge to Black font with regular when bold is available.

Javanese has two weights: Regular (400) and Bold (700).

I'm merging it with NotoSans various weights. Looks to me that Regular is used to merge with everything but Bold.

An improvement would be to

  1. check the available weights of each font: Javanese has 400, 700 Sans has 100,200,..700,800,900 As a fallback font I'd use the smallest absolute value between the difference of the "main" font and the merged font e.g., for merging Sans 100 I'd use Javanese 400 because abs(100-400)=300 which is smaller than abs(100-700); for merging Sans 600 I'd use Javanese 700 because abs(600-700)=100 which is smaller than abs(600-400)
Screen Shot 2020-08-21 at 10 16 36

Just an idea

jbmorizot commented 3 years ago

Good point, I'm on it.

jbmorizot commented 3 years ago

@marekjez86 It's done.