开发者

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

  1. Open the Replace dialog box (Edit >> Replace or Ctrl + H)
  2. Make sure no text is specified in the Find what or Replace with boxes
  3. Click in the Find what box, then click Format (If you don’t see the Format button, click More to expand the search options)
  4. Select Font from the pop up list
  5. In the Find Font dialog box, select the text formatting options you would like to replace
  6. Click OK
  7. Click in the Replace with box
  8. Click Format
  9. Select Font from the pop up list
  10. In the Replace Font dialog box, select the new text formatting options you would like to apply
  11. Click OK
  12. Click Replace all
  13. Click OK
  14. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜