-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86b84c0
commit e6fe6b8
Showing
3 changed files
with
69 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from fontbro import Font | ||
from tests import AbstractTestCase | ||
|
||
|
||
class ItalicAngleTestCase(AbstractTestCase): | ||
""" | ||
This class describes an italic angle test case. | ||
""" | ||
|
||
def _test_font_italic_angle(self, filepath, **kwargs): | ||
font = self._get_font(filepath) | ||
italic_angle = font.get_italic_angle() | ||
# print(filepath, weight) | ||
expected_italic_angle = { | ||
"backslant": False, | ||
"italic": False, | ||
"roman": False, | ||
"value": 0.0, | ||
} | ||
expected_italic_angle.update(**kwargs) | ||
self.assertEqual(italic_angle, expected_italic_angle) | ||
|
||
def test_get_italic_angle_with_roman_font(self): | ||
self._test_font_italic_angle( | ||
filepath="/Roboto_Mono/static/RobotoMono-Regular.ttf", | ||
value=0, | ||
roman=True, | ||
) | ||
|
||
def test_get_italic_angle_with_italic_font(self): | ||
self._test_font_italic_angle( | ||
filepath="/Roboto_Mono/static/RobotoMono-Italic.ttf", | ||
value=-10, | ||
italic=True, | ||
) |