Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have same font for the text that is copied from wordpad into textarea

I have a text area in my web application. My users can copy text from wordpad and paste it in textarea.

They want the same text font of the wordpad document to be appear in textarea too. How can we achieve this?

like image 484
TP_JAVA Avatar asked Sep 16 '11 02:09

TP_JAVA


People also ask

Why does the font change when I copy and paste in Word?

Text takes on the style of the recipient document So when you paste your text into the other document, it takes on the formatting of Normal style in that other document. If the Normal style in the other document is Arial 11pt, then that's how your text will appear.

How do I make the same font when I copy and paste?

Method 1: Add a shiftEvery time. On some — but not all — apps, when you press Ctrl-V (Win)/Cmd-V (Mac), you can press Shift too. This activates “Paste and Match Style”, which converts the text to the same style as the destination document. This is usually what you want.


1 Answers

You can retain some formatting by using a rich text editor like tinyMCE ( http://www.tinymce.com/ ). But you're pretty much limited to to sans-serif (arial-like) and serif (times-like) when it comes to fonts. Unless you use webfonts. But even with webfonts you're limited to the fonts you define, and as webfonts often has slightly different names than the desktop fonts (e.g. Meta MT becomes Meta Web) you will not get the correct font when pasting from WordPad

like image 104
elzapp Avatar answered Oct 21 '22 14:10

elzapp