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 a开发者_运维问答nd 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?
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
I don't think you can have the font automatically in the text area. You could give them a WYSIWYG editor that has access to fonts and then you would have to upload all of the wordpad font's to your server (if that's even legal; you'd have to check on the EULA of wordpad), then I believe you would have to create a reference to the font in a dll or on that page. Here's a link that talks about using fonts.
http://randsco.com/index.php/2009/07/04/p680
In truth it's more headache than you want to deal with.
精彩评论