Subject: Re: MS VC++ MFC and GB in unicode on NT

From: Yan Deng <[email-masked]>
Date: Wed, 17 Dec 1997 09:48:52 -0800

Many thanks to Jimmy Han <[email-masked]> and Ji Zhang
<[email-masked]>.
I can display Chinese Chars on NT 4.0 Japanese env using Simsun.ttf
font.
                                                         ^^^^^^^^^^

>>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");

          strcpy(lf.lfFaceName, "Simsun");
                                 ^^^^^^

>>        font.CreateFontIndirect(&lf);

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

--
  Yan Deng
  mailto:[email-masked]
  http://www.geocities.com/CapeCanaveral/Lab/7278/index.htm
--