forked from reingart/pyfpdf
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Showing
8 changed files
with
110 additions
and
8 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,15 @@ | ||
from fpdf.fonts import FontFace | ||
|
||
|
||
def test_combine_fontface(): | ||
font1 = FontFace(family="helvetica", size_pt=12) | ||
# providing None override should return the default style | ||
assert FontFace.combine(override_style=None, default_style=font1) == font1 | ||
# overriding a None style should return the override | ||
assert FontFace.combine(override_style=font1, default_style=None) == font1 | ||
font2 = FontFace(size_pt=14) | ||
combined = FontFace.combine(override_style=font2, default_style=font1) | ||
assert isinstance(combined, FontFace) | ||
assert combined.family == "helvetica" # wasn't overridden | ||
assert combined.emphasis is None # wasn't specified by either | ||
assert combined.size_pt == 14 # was overridden |
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