CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    May 2000
    Location
    England
    Posts
    574

    Using Unicode Characters in a DC ?

    Hi
    What character set should i use to display Unicode characters in a DC ?

    ie - Arial or courier ?

    thanks

    P

  2. #2
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688
    Deppends on the type of Unicode characters.

    You should select an appropiate font which supports those characters.

    Also if you application is not UNICODE you should call the Unicode versions of the DC text functions.

  3. #3
    Join Date
    May 2000
    Location
    England
    Posts
    574
    Hi
    how can i find out what the font is for the appropriate Unicode characters ?

    also is there a Unicode version of dc->TextOut() ???

    thanks

  4. #4
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688
    Deppends on the unicode characters you want to write.

    What kind of characters are?

    And yes, TextOut has both Ansi (TextOutA) and Unicode (TextOutW) implementations.

    If your program is not UNICODE you might need to call TextOutW with wchat_t[] strings as parameter.

  5. #5
    Join Date
    May 2000
    Location
    England
    Posts
    574
    This is the literal value of one of them L'\x2500' basicaly it is a corner of a box !

    thanks

  6. #6
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688
    Use Arial for example.

    It should not be any problem because that symbols is shown correctly in the character map at that location.

  7. #7
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    Search this forum for "DrawTextW" and "TextOutW" (but not both at the same time). It will probably work better if you combine those with "Japanese" and "Chinese". There have been previous questions with many useful answers. I am not sure what would be the best combination of keywords to use to search so it is worthwhile to try a few different combinations.

    There is a KB article about Chinese that has a small peice of sample code that would help for other languages and you could find the KB article by searching the MS KB for it but there are previous answers in this forum that link to it and such.
    Last edited by Sam Hobbs; August 27th, 2003 at 08:53 AM.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  8. #8
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688
    I think that on Windows 95,98,Me systems DrawTextW will require the aid of the Microsoft Layer for Unicode to work. However TextOutW will work "always".

    Maybe is also a good idea to search MSDN for a detailed information about these topics.

  9. #9
    Join Date
    May 2000
    Location
    England
    Posts
    574
    Will do
    thanks one and all

  10. #10
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    Originally posted by Doctor Luz
    I think that on Windows 95,98,Me systems DrawTextW will require the aid of the Microsoft Layer for Unicode to work. However TextOutW will work "always".

    Maybe is also a good idea to search MSDN for a detailed information about these topics.
    There is a KB article explaining that some Unicode support is installed by Internet Explorer.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  11. #11
    Join Date
    Jan 2001
    Location
    Toronto
    Posts
    118

    If you are going to use Far East character, then

    Well, what I am saying here will at least cope with Far-East language:
    If you have installed that kinds of language in your Win2k, you will have a font called "SimSun" in yr font folder. Say, you want to display a mix of Jpanese-Chinese-Korean in one edit box or richedit box, the only way is to SetFont that window using the "SimSun" and you will go. Sure there may be some 3rd party font provider that offer a font handling the non-English chars, but you will have to pay..
    You can find an example of my article in codeguru here:
    http://www.codeguru.com/system/KeyLoggerMore2.html

    Note: Even you DrawText, your selected font must be able to handle these chars.

    Help this help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured