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

Generate images for time conversions #87

Open
Phanabani opened this issue Aug 8, 2022 · 0 comments
Open

Generate images for time conversions #87

Phanabani opened this issue Aug 8, 2022 · 0 comments
Assignees
Labels
major feature A big new feature, probably the focus of a major version bump

Comments

@Phanabani
Copy link
Owner

Time conversions with lots of timezones tracked can get pretty unwieldy.

Discord has no way to display text in tabular formats, and even if it did, a taaaaall table would still be a bit unkind to look at. I think it would be nicer aesthetically to generate an image. Images are visually scaled down, so this would make Sandpiper less intrusive with her conversion blob.

I did some preliminary work with this earlier this year, attempting to use an image generation library Cairo and text layout library Pango, and they were a struggle to set up (they're C libraries) and incredibly difficult to get to do what I wanted. I was writing functions to manually position text, using contexts to change colors and positions, writing to an SVG and then converting that to PNG to get text antialiasing... it was not enjoyable at all.

After a bit of time to think about it, I've realized that everything I was doing is already a solved problem. There was no benefit to what I was doing, so I would like to instead use HTML and CSS to render these images. Layout, text rendering, and images are easy peasy with HTML/CSS, and also much more maintainable.

@Phanabani Phanabani added the major feature A big new feature, probably the focus of a major version bump label Aug 8, 2022
@Phanabani Phanabani self-assigned this Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major feature A big new feature, probably the focus of a major version bump
Development

No branches or pull requests

1 participant