I have a textarea with 10 columns, but apparently that is not enough to display 10 emoji.
How do I calculate the exact amount of needed cols to display 10 emoji?
<textarea cols="10" rows="4"></textarea>
I have a textarea with 10 columns, but apparently that is not enough to display 10 emoji.
How do I calculate the exact amount of needed cols to display 10 emoji?
<textarea cols="10" rows="4"></textarea>
This is because for emojis, the computed font is falling back to the next on the font-family
, since the first font doesn't handle the emojis. See this answer.
See below the results rendered for this code [ubuntu 18.04] for Chrome and Firefox, and the fonts used in each case:
<textarea cols="10" rows="6">0123456789
</textarea>
Solution: add a emoji-capable font to your page and put it on the begining of the font-family
or add the emoji default font for each browser you want to work with:
<textarea rows="6" style="width:10ch;overflow:hidden;resize:none;font-family:Twemoji Mozilla,Noto Color Emoji">
0123456789
</textarea>