Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Font prolem!!!

Font prolem!!!

Scheduled Pinned Locked Moved C#
questionhelptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Khoa Bui
    wrote on last edited by
    #1

    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!

    G D 2 Replies Last reply
    0
    • K Khoa Bui

      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!

      G Offline
      G Offline
      G Ringbom
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • K Khoa Bui

        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!

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups