Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attribution text width (and font size) calculation [Cairo] #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion staticmaps/cairo_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def render_attribution(self, attribution: typing.Optional[str]) -> None:
while True:
self._context.set_font_size(font_size)
_, f_descent, f_height, _, _ = self._context.font_extents()
t_width = self._context.text_extents(attribution)[3]
t_width = self._context.text_extents(attribution).width
if t_width < width - 4:
break
font_size = font_size - 0.25
Expand Down