The problem is next:
- I have an empty
textarea. - Then I paste some outside text inside it with specific
font. - I select (highlight) some part of this text.
- I need to detect, what is the
fontof theselection.
Note, that textarea’s text is plain, there is no HTML formatting inside it.
A textarea will only render in the font the page specifies, so you could get the font using jQuery by doing something like:
However it sounds like you want to know the font that the text was in originally. Unfortunately that isn’t possible as the font information is lost when pasting into the browser.