no change of system Font

  • Hello


    with this code i want display chinese character in a textstatic and 2 Buttons
    but there is no change to the TTF msming, always the System Font appeares.
    Only the new Size is correct.




    LOGFONT lf;


    if (!AddFontResource(_T("\\ffsdisk\\msming.ttf")))
    {
    strmessage.Format(L"msming.ttf not found");
    MessageBox(strmessage.GetString());
    }


    memset(&lf,0, sizeof(LOGFONT));


    lf.lfHeight = 25;
    _tcscpy(lf.lfFaceName, _T("MS Ming"));


    b_font.CreateFontIndirect(&lf);


    GetDlgItem(IDC_STATIC_BEREIT)->SetFont(&b_font);
    GetDlgItem(IDC_BUTTON1) ->SetFont(&b_font);
    GetDlgItem(IDC_BUTTON2) ->SetFont(&b_font);



    Regards
    Thomas Dauner

  • Hello,


    the cange of the size works fine.


    here are set the text for the Buttons:


    GetDlgItem(IDC_BUTTON1)->SetWindowTextW(L"\x0041\x4FBF"); //cs_but_setup);
    GetDlgItem(IDC_BUTTON2)->SetWindowTextW(cs_but_start);


    in the first line i use for test the hex values of the characters, normally the text is in the CString cs_but_setup.


    The Software FontView.exe displays all the characters from Msming.ttf right.
    But i can't open the workspace with VisualStudio 2008 to explore this step by step.


    Regards
    Thomas