Font prolem!!!
-
I use a RichTextBox to load a "*.txt" file. But I can't find out which font to use for the text to be display correctly!:doh: (the text is written in Vietnamese, and the true font name is "VNI-Times", but how to know it programatically?) And one more question: how can I read a Word file, and display it correctly? (can it displayed in RichTextBox control?) please help me, thanks!
-
I use a RichTextBox to load a "*.txt" file. But I can't find out which font to use for the text to be display correctly!:doh: (the text is written in Vietnamese, and the true font name is "VNI-Times", but how to know it programatically?) And one more question: how can I read a Word file, and display it correctly? (can it displayed in RichTextBox control?) please help me, thanks!
I'm not sure I understand what you mean here. A text file contains no information about any fonts or other formatting. A txt file only contains a bunch of characters so the font you choose to display the text with is completely up to you. There simply doesnt exist any information about a font to a text file.
-
I use a RichTextBox to load a "*.txt" file. But I can't find out which font to use for the text to be display correctly!:doh: (the text is written in Vietnamese, and the true font name is "VNI-Times", but how to know it programatically?) And one more question: how can I read a Word file, and display it correctly? (can it displayed in RichTextBox control?) please help me, thanks!
Text files don't contain ANY font information, so there's no way top tell what font was used to write the text file with. Word has an EXTREMELY complicated file using a multiple-stream file format. There is documentation on older versions of Word on the 'Net somewhere (I can't remember where through). Just Google for "Word File Format". Not everything is covered, so there will be parts of the file you cannot read, and therefore, cannot render correctly. A RichTextBox CANNOT be used to display a Word file. The RTB control knows nothing of the Word file format. You have a few options: 1) Use Word to load and display the file 2) Use a commerically available 3rd party component to load and display the file. (Don't know of any myself.) 3) Use Word to save the file in RTF format so it can be loaded into a RichTextBox. (Least desirable because some formatting is lost.) RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome