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

Cannot change font size #20

Open
matthjes opened this issue Aug 19, 2017 · 8 comments
Open

Cannot change font size #20

matthjes opened this issue Aug 19, 2017 · 8 comments

Comments

@matthjes
Copy link

Hi,

I'm trying to increase the font size for tiles (specifically: the bar chart tile). I'm using the TileBuilder and I call customFontEnabled(true) and customFont(Fonts.latoRegular(25.0)), but the font size does not change.

How can I change the font size for the text elements on tiles?

@HanSolo
Copy link
Owner

HanSolo commented Aug 19, 2017

That is correct, the font size will be calculated automtically. You can just define a custom font.

@matthjes
Copy link
Author

matthjes commented Aug 19, 2017

Argh, that's unfortunate. I'm working on a kind of visualization for a simulation that is shown on a touch screen device. Currently the font is too small to be usable.

Edit: Ah, I see, I get a bigger font if I increase the size of the tile. Maybe I can change my layout to include larger tiles.

@HanSolo
Copy link
Owner

HanSolo commented Aug 19, 2017

I could also add custom font size but that could lead to terrible effects if the text is too long. The main problem is how to resize the font when resizing the tile if you use a custom font size.

@matthjes
Copy link
Author

See the edit above, I can increase the tile size.

Letting the user change the font size as an option could be a good idea in some instances. For example, in my case the layout is fixed and I do not have to worry about resizing, so I could adjust the font size by hand.

@matthjes
Copy link
Author

Though I don't like asking questions not related to the topic I also don't want to open a new issue: How can I add a unit the a bar chart item? I tried setting a format string ("%g kWh"), but this does nothing.

@HanSolo
Copy link
Owner

HanSolo commented Aug 28, 2017

You are right, setting the formatString was not working correctly. Should work now...

@matthjes
Copy link
Author

Could you please remove the System.out.println(formatString) call in your code? Or change it into a log output with debug level.

@HanSolo
Copy link
Owner

HanSolo commented Aug 29, 2017

Ups...removed, thx for the hint :)

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