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

Add support for text(s) #14

Open
sgraaf opened this issue Nov 10, 2022 · 1 comment
Open

Add support for text(s) #14

sgraaf opened this issue Nov 10, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@sgraaf
Copy link
Owner

sgraaf commented Nov 10, 2022

Add support for rendering text(s).

PaperMap uses fpdf2 for the generating of the paper map PDF document in general, and its .cell() method to add the attribution, scale and coordinate grid labels.

@sgraaf sgraaf added the enhancement New feature or request label Nov 10, 2022
@sgraaf
Copy link
Owner Author

sgraaf commented Nov 10, 2022

Here's the implementation for rendering the attribution and scale at the moment:

def render_attribution_and_scale(self) -> None:
text = f"{self.tile_server.attribution}. Created with {NAME}. Scale: 1:{self.scale}"
self.pdf.set_xy(
self.margin_left + self.pdf.epw - self.pdf.get_string_width(text),
self.margin_top + self.pdf.eph - pt_to_mm(self.pdf.font_size_pt),
)
self.pdf.cell(w=0, txt=text, align="R", fill=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant