Results 1 to 4 of 4

Thread: About Chinese characters

  1. #1
    Senior Member Regular Contributor LangFox's Avatar
    Join Date
    Oct 2001
    Location
    Shen Zhen, Guangdong, China
    Posts
    102

    About Chinese characters

    Hello,everyone.
    I want to know if I can put Chinese characters in my OpenGL programs?And how to do it?
    Thanks!
    Best Regards,
    LangFox


    http://hi.baidu.com/lang_fox

  2. #2
    Senior Member Regular Contributor
    Join Date
    May 2001
    Location
    Germany, Hannover
    Posts
    160

    Re: About Chinese characters

    like you would do for other textoutput, if you want to have 3d-fonts you should have a true type font of the wanted charset, then do something like(my temp font class in c++...):

    class FONT3D{
    DWORD nFontList;
    public:
    FONT3D(HDC hDC){
    HFONT hFont;
    GLYPHMETRICSFLOAT agmf[128];
    LOGFONT logfont;

    logfont.lfHeight = -10;
    logfont.lfWeight = 0;
    logfont.lfEscapement = 0;
    logfont.lfOrientation = 0;
    logfont.lfWeight = FW_BOLD;
    logfont.lfItalic = FALSE;
    logfont.lfUnderline = FALSE;
    logfont.lfStrikeOut = FALSE;
    logfont.lfCharSet = ANSI_CHARSET;
    logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
    logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
    logfont.lfQuality = DEFAULT_QUALITY;
    logfont.lfPitchAndFamily= DEFAULT_PITCH;
    strcpy(logfont.lfFaceName, "ARIAL");//Here is the font to use

    hFont = CreateFontIndirect(&logfont);
    SelectObject(hDC, hFont);

    nFontList = glGenLists(12;
    wglUseFontOutlines(hDC, 0, 128, nFontList, 0.0f, 0.1f, WGL_FONT_POLYGONS, agmf);

    DeleteObject(hFont);
    };
    ~FONT3D(){
    glDeleteLists(nFontList, 12;//Font
    };

    inline void Draw(const char *txt, const long size){
    glListBase(nFontList);
    glCallLists( size, GL_UNSIGNED_BYTE, txt);
    };
    };

    or if you want to use 2d fonts, you have to gen some image (via photoshop, not paint or paintshop ),load em as texture and then draw quads textured with the right coords...

  3. #3
    Senior Member Regular Contributor LangFox's Avatar
    Join Date
    Oct 2001
    Location
    Shen Zhen, Guangdong, China
    Posts
    102

    Re: About Chinese characters

    Thanks!
    But Chinese are not the same as English which all are made up of 26 characters.
    The number of Chinese characters often used
    is 3000~5000.And they are entirely different.
    So I can't use a image as a texture to utput Chinese.
    But thanks again.I will try more.
    Best Regards,
    LangFox


    http://hi.baidu.com/lang_fox

  4. #4
    Member Newbie
    Join Date
    Oct 2001
    Location
    beijing/China
    Posts
    46

    Re: About Chinese characters

    i have the same question as u ,can u give some help,thank u very much
    btw,i use the wglUseFontOutlines(...),i think there must have some methords
    your friendly ruixp^!^

Similar Threads

  1. How to draw chinese characters with OpenGL
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-07-2004, 09:48 PM
  2. How to display Chinese?
    By helen1024 in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 05-12-2004, 04:25 PM
  3. how to display chinese in OpenGL
    By pango in forum OpenGL: Advanced Coding
    Replies: 30
    Last Post: 06-17-2003, 12:28 PM
  4. Chinese Characters display in OpenGl
    By Suvcon in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 01-08-2002, 06:46 AM
  5. Chinese character in OpenGL
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-09-2001, 10:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean