Changing font of text error
I have a textbox control inside of a software app which has some text in it. That software is using a custom font which doesn't exist anywhere else and is just specific to this program. I don't have it's source or access to it's creators. Now I want to copy that text inside of a notepad or MS word but when I do the text is no more readable unless I change the font of word processor to the font that the software is using (the font that text is written with). So I want the text to be readable anywhere and not to depend on a specific font. So is it possible?
I'm a c# programmer. Here is an example of unreadable text:
ý¶† ±øõœ ý¶† –ý¾‡¨ ÿ†°†¬ ñð‡ì úÞ±¶ Ä쇤 ½±”
à¥ì ±øõœ þ·ñœŒ Ý稆Œ ô±º±” (.ì)
[þü‡íý‘†õø]
ý¶†
[þ¶ñùì ïõéÎ]
±øõœ ý¶† ‡º±”
[þíýº]
ý¶†
[úð‡ýì‡Î —‡¤çȾ†] ÿ¬.¹†.ë† °©ì ÿû¬‡ì ²† þÎõð.ÿ¬.¹†.ë†"
The interesting thing is that it's showing up like this in almost all the f开发者_Python百科onts except the one that text is originally written with. By the way the text is in Arabic and all of fonts that I tested the text with are supporting Arabic chars.
Now if I type some text that consist of English and Arabic in that font then change the font of notepad to some other font it's looks OK and works normal! So the problem only appears when the text is pasted into the word processor.
EDIT: I think I found the problem! The custom font is a raster font (bitmap font) which has a .fon
extension and in the following thread someone wanted to convert the bitmap font to ttf since he was having a problem in printing the documents. I want to copy and paste, so maybe I have to convert the font ?
The discussion: how to convert a bitmap font .fon into a truetype font ttf
Any kind of help is really appreciated. thank you.
any kind of help is really appreciated.
If I had seen this question on superuser.com my answer would have been:
You can change the font of text from font A to Arial.
For example in Microsoft Word
- Open the Replace dialog box (Edit >> Replace or Ctrl + H)
- Make sure no text is specified in the Find what or Replace with boxes
- Click in the Find what box, then click Format (If you don’t see the Format button, click More to expand the search options)
- Select Font from the pop up list
- In the Find Font dialog box, select the text formatting options you would like to replace
- Click OK
- Click in the Replace with box
- Click Format
- Select Font from the pop up list
- In the Replace Font dialog box, select the new text formatting options you would like to apply
- Click OK
- Click Replace all
- Click OK
- Click Close
(from http://wordprocessing.about.com/cs/quicktips/qt/fontreplace.htm)
As an aside: If the document uses styles, it is actually much easier to change the font. For this reason I try to always use styles and never directly apply fonts to text.
If you are not referring to Word documents, please amend your question to say exactly what software was used to create the text - or exactly what file-format the text is stored in.
Since you asked on stackoverflow.com I slowly deduced you may be writing a program in some unspecified programming language. I suggest you edit your question and specify what programming language you are using and give some example code to illustrate the problem.
For example, in Java you might do something like
JLabel label = new JLabel("hello world"); label.setFont(new Font("Arial", Font.PLAIN, 12));
It sounds very much as though the author of the original program has invented their own character encoding and provided a font to go with it. Maybe the development tools were restricted to ANSI text and the developers came up with this extreme solution.
Test out the hypothesis by writing some English text in the custom font and see if Arabic characters appear.
If this is so then you will have to work out what the encoding is and translate the strings character by character.
精彩评论