TextOut()似乎没有展示代理UNICODE对

时间:2011-04-30 01:29:55

标签: winapi unicode

我尝试使用H = 0xD835展示U + 1D400(代理对L = 0xDC00 TextOut())无济于事。为什么?

  

案例WM_PAINT:

    PAINTSTRUCT ps;

    BeginPaint(hwnd, &ps);

    int iLogPixelsY;

    iLogPixelsY = GetDeviceCaps(ps.hdc, LOGPIXELSY);

    LOGFONT lf;

    int iPts;

    iPts = 11;

    memset(&lf, 0, sizeof(LOGFONT));
    lf.lfHeight = -iPts * iLogPixelsY / 72;
    lf.lfOutPrecision = OUT_TT_ONLY_PRECIS;
    wcscpy_s(lf.lfFaceName, L"Cambria Math");

    HFONT hFont;

    hFont = CreateFontIndirect(&lf);
    hFont = (HFONT)SelectObject(ps.hdc, hFont);

    wchar_t tx[2];

    tx[0] = 0xD835;
    tx[1] = 0xDC00;

    TextOut(ps.hdc, 10, 100, tx, 1); 

    DeleteObject(SelectObject(ps.hdc, hFont));

    EndPaint(hwnd, &ps);
    break;

1 个答案:

答案 0 :(得分:1)

您正在调用TextOut,指定字符串长度为1,但根据this documentation,您应该传递2,因为它是代理对。