You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 PR is a workaround fix for issue#10.
The root cause of the issue#10 is that when introducing the new feature which accept a font_path and font_size as args for add_text() broken the backward compatibility of passing an aggdraw Font object to the function.
This PR restore the compatibility to use font_obj as below, which is also presented in the document.
I consider it is just a workaround since there is still confusion in the code base that self.style[font] can be either a aggdraw font object or a path to the font file.
Thanks again @yufeizhu600. I would ask for tests but we don't even have real tests for this project yet and I'm not going to make this PR implement it.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a workaround fix for issue#10.
The root cause of the issue#10 is that when introducing the new feature which accept a font_path and font_size as args for add_text() broken the backward compatibility of passing an aggdraw Font object to the function.
This PR restore the compatibility to use font_obj as below, which is also presented in the document.
font_obj = aggdraw.Font('white', '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf', size=26)
dc.add_text("Some Text", font=font_obj)
I consider it is just a workaround since there is still confusion in the code base that self.style[font] can be either a aggdraw font object or a path to the font file.