Subject: GB in unicode on NT

From: Jimmy Han <[email-masked]>
Date: Tue, 16 Dec 1997 10:01:43 -0800

For those of you want to know how to display Chinses chars in NT using
IE font, try this:

Create a mfc signle document application, name TextOut, and change
OnDraw to:

void CTextoutView::OnDraw(CDC* pDC)
{
        LOGFONT         lf;
        CFont           font, *oldfont;
        wchar_t         str[] = {0x8fd9, 0x662f};

        CTextoutDoc* pDoc = GetDocument();
        ASSERT_VALID(pDoc);

        lf.lfHeight = 16;
        lf.lfWidth = 16;
        lf.lfEscapement = 0;
        lf.lfOrientation = 0;
        lf.lfWeight = 400;
        lf.lfItalic = 0;
        lf.lfUnderline = 0;
        lf.lfStrikeOut = 0;
        lf.lfCharSet = GB2312_CHARSET;
        lf.lfOutPrecision = 0;
        lf.lfClipPrecision = 0;
        lf.lfQuality = 0;
        lf.lfPitchAndFamily = 0;
        strcpy(lf.lfFaceName, "MS Song");

        font.CreateFontIndirect(&lf);

        oldfont = pDC->SelectObject(&font);
        TextOutW(pDC->m_hDC, 20, 20, str, 2);
        pDC->SelectObject(oldfont);
}

--
Jimmy Han                       Tel: (408)527-3824
Software Engineer               Fax: (408)527-7099
Cisco Systems, Inc.             email: [email-masked]