Commit c546627
committed
Improve font weight guessing.
Previously, we would guess that "Times New Roman Bold" is a regular
weight font because its name contains the substring "Roman", even though
the font correctly sets the BOLD flag (FT_STYLE_FLAG_BOLD). Invert the
logic to give priority to the flag, as its presence is clearly more
robust than a substring check.
`s.find(w) >= 0` is just an obfuscated way to write `w in s`, so change
that.1 parent 1c06de3 commit c546627
2 files changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
404 | 402 | | |
405 | 403 | | |
406 | 404 | | |
| |||
0 commit comments