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

Grid not centered vertically #132

Open
SvenFackert opened this issue Sep 8, 2019 · 2 comments
Open

Grid not centered vertically #132

SvenFackert opened this issue Sep 8, 2019 · 2 comments

Comments

@SvenFackert
Copy link

SvenFackert commented Sep 8, 2019

I just wanted to point out that the character grid is not perfectly centered vertically. It is a bit too far to the bottom. Maybe the problem origins from the vertical alignment of font characters inside the SVG text elements. But I didn't have any time to dig deeper into that yet.

A quick and dirty fix that I just used would be to just offset each character by 4 pixels which will output an almost perfectly centered grid.

create_layout.py (only added the -4)

...
if mode == 'stencil':
    # Write only characters
    text_layout.add(layout.text((content[y].decode('utf-8')[x]),
                                insert=(coords[0], coords[1] + (float(font_size) / 2.0) - 4)))
...

Big thanks to all of you guys working on this awesome project and especially to @bk1285 !

@bk1285
Copy link
Owner

bk1285 commented Sep 15, 2019

Hi @SvenFackert

thanks for reporting. Can you detail, which viewer you were using? I'll check, if I can reproduce that.

Best,
Bernd

@SvenFackert
Copy link
Author

SvenFackert commented Sep 15, 2019

Hi Bernd,

I checked it using Google Chrome as well as Adobe Illustrator. The offset appeared in both of them. You can also see the offset in the exported png files within the wordclock_layout folders.

Kind regards,
Sven

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants