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

Graphics bitmap font size in X and Y #2044

Closed
gfwilliams opened this issue Sep 2, 2021 · 4 comments
Closed

Graphics bitmap font size in X and Y #2044

gfwilliams opened this issue Sep 2, 2021 · 4 comments

Comments

@gfwilliams
Copy link
Member

Currently we allow bitmap fonts to be scaled up by a factor of 2/3/4/etc

We could allow them to be scaled up by a different factor in each dimension, without too many painful changes.

Is this something that would be useful? I can imagine that maybe in menus on Bangle.js 1 it might be better to triple the height but only double the width...

@gfwilliams
Copy link
Member Author

Just a note to say I made some initial tweaks and it doesn't look too bad.

The only issue is how we set the font up... I guess we could just extend setFont to setFont("FontName",x,y) although I recently added g.setFont("FontName:size") which is nice in that the font is just one text string, which is easily changed.

So we could just tweak it to allow g.setFont("FontName:XxY") like g.setFont("6x8:1x2")

What does everyone think?

@MaBecker
Copy link
Contributor

my choice is g.setFont("6x8:1x2")

@MaBecker
Copy link
Contributor

Could this be available for vector font too?

@gfwilliams
Copy link
Member Author

Yes, it works for that too. Only gotcha is it's max of 63x63 pixel size when you scale separately because we've had to pack all the font info into 16 bits.

Still, it's pretty handy.

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

No branches or pull requests

2 participants