-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct variable font and loading font via cmd (#14)
New feature: - Convert legacy weight into "new" weight. Corrected bugs: - Families and fullname would use the same set. - In very specific case, matplotlib.findSystemFonts can return non Font file. - The font would be considered like a variable font if it contain an fvar table. That was false, it need to contain an fvar table AND a stat table to be considered like a variable font (resolve Option --additional-fonts doesn't work #13) - Correct overloading fonts with --additional-fonts (resolve Option --additional-fonts doesn't work #13)
- Loading branch information
Showing
8 changed files
with
70 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "2.0.2" | ||
__version__ = "2.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
from font_collector import Font | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
font_without_os2_table = os.path.join(dir_path, "fonts", "BRUSHSTP.TTF") | ||
font_without_stat_table = os.path.join(dir_path, "fonts", "Cabin VF Beta Regular.ttf") | ||
|
||
def test_font_without_os2_table(): | ||
|
||
font = Font.from_font_path(font_without_os2_table) | ||
assert len(font) == 1 | ||
font = font[0] | ||
|
||
print(font) | ||
|
||
assert font.family_names == set(["brushstroke plain"]) | ||
assert font.weight == 400 | ||
assert font.italic == False | ||
assert font.exact_names == set() | ||
assert font.is_var == False | ||
|
||
def test_font_with_fvar_table_but_without_stat_table(): | ||
|
||
font = Font.from_font_path(font_without_stat_table) | ||
assert len(font) == 1 | ||
font = font[0] | ||
|
||
assert font.family_names == set(["cabin vf beta"]) | ||
assert font.weight == 400 | ||
assert font.italic == False | ||
assert font.exact_names == set(["cabin vf beta regular"]) | ||
assert font.is_var == False |