Unit of measure of the font

Hi everyone!
I’ve been looking for this information in other topics but I couldn’t find it so I hope someone can help.
In one of the screens of my app I have a webview, and at the bottom of the webview there will be a button. Just under the webview there will be another button, this time from the app, so I would like to give them a similar style, but here is the problem: the font inside the Kodular button doesn’t show a unit of measure, I tried to see if it was pixels, or percentage, but I couldn’t understand it! If I set the font size of the kodular button to 25 and then I code the button within the webview and give 25 pixels, or 25%, or 25vw, they always look different so it’s clear that I’m using different units of measure.
Is there someone that could help solve this doubt?

Thank you in advance!

I think kodular uses “px/pixels” to measure fonts and you are getting the different because the px depends on the resolution of screen and as you are using webview it is possible to get different results.

Provide a test aia.

thank you!

25% is different than 25px

No.

Font unit is sp

SP is similar to the DP unit but additionally it is also scaled according to the font size preference of the user. SP is important as it provides a link between the users chosen text and the text in the application. A user can increase or decrease the size of text according to his own requirement. These SP or scaled pixels take care of this issue.

DP and SP are both density independent but they are not of the same sizes on every device.

2 Likes

Sorry I didn’t knew modular uses sp. I learnt something new today, thanks.

One more thing to learn

It’s Kodular

:sweat_smile:… You know… Keyboard corrections

Thank you so much @Boban!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.