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

How to rotate text easily ? #639

Open
xucs007 opened this issue Nov 23, 2022 · 5 comments
Open

How to rotate text easily ? #639

xucs007 opened this issue Nov 23, 2022 · 5 comments

Comments

@xucs007
Copy link
Contributor

xucs007 commented Nov 23, 2022

If I draw a square MCU pad, with pins on 4 sides. Some pins I might want to label horizontally, others vertically. What's the best way to rotate text?

@GrimMaple
Copy link
Collaborator

I don't think dlangui features such a thing. I'm gonna have a closer look, but I don't think there's a solution out of hte box. Just to clarify, do you want a Widget (eg TextWidget) to draw vertically, or do you want a canvas to be able to draw vertical text?

@xucs007
Copy link
Contributor Author

xucs007 commented Nov 24, 2022

Either way is fine. If you think TextWidget is easier to implement, just do it first.

In fact, C# WPF has a "transform" function, which can be applied to many widgets. But I guess that's more complicated to implement.

@GrimMaple
Copy link
Collaborator

I'm going to give this an enchancement label and I'll think about how to implement this. If you have ideas - I"ll be more than glad to accept a PR :)

@xucs007
Copy link
Contributor Author

xucs007 commented Nov 28, 2022

Maybe the 2 draw() functions in graphics/fonts.d, can be added with a "direction" parameter, but I still don't know how to realize.

@GrimMaple
Copy link
Collaborator

I have investigated a bit. TextWidget uses DrawBuf anyway, so I think both should be updated at the same time. No idea when though

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