Android compose has textSize unit em, but no dp. What is "em"? What's difference between em, sp and dp and why no dp? How convert to em from other units?
Text(text = "Hello",fontSize = 5.em)
Android compose has textSize unit em, but no dp. What is "em"? What's difference between em, sp and dp and why no dp? How convert to em from other units?
Text(text = "Hello",fontSize = 5.em)
In fontSize, EM or em stands for "Relative font size". 1.em = 100% So in your case
Text(text = "Hello",fontSize = 5.em)
is 500% of normal text size i.e. original size x 5.
Similarly, SP or sp stands for "Scaled pixels" so you can write
Text(text = "Hello",fontSize = 30.sp)