stupid but easy...I think

all I want to do is change the font size of some text that I am printing out to a window. This is a windows app, not MFC. here's what I have...it doesn't change a thing..

[code]
LOGFONT lg;

lg = ::LOGFONT();
lg.lfHeight = 5;
lg.lfWidth = 5;

SelectObject(*phdc, &lg);

DrawText(*phdc, songName, strlen(songName), &rt, DT_CENTER);
[/code]

anyone know how to change my font size?? thanks

Comments

  • [b][red]This message was edited by stober at 2003-4-30 16:47:6[/red][/b][hr]
    : all I want to do is change the font size of some text that I am printing out to a window. This is a windows app, not MFC. here's what I have...it doesn't change a thing..
    :
    : [code]
    : LOGFONT lg;
    :
    : lg = ::LOGFONT();
    : lg.lfHeight = 5;
    : lg.lfWidth = 5;
    :
    : SelectObject(*phdc, &lg);
    :
    : DrawText(*phdc, songName, strlen(songName), &rt, DT_CENTER);
    : [/code]
    :
    : anyone know how to change my font size?? thanks
    :
    [blue]::LOGFONT() does nothing.. You have to initialize it from someplace else. Here is how to get tye system font.[/blue]
    [code]
    // Initially use the system message font for the GridCtrl font
    NONCLIENTMETRICS ncm;
    LOGFONT lf;
    ncm.cbSize = sizeof(NONCLIENTMETRICS);
    SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0);
    memcpy(&lf, &(ncm.lfMessageFont), sizeof(LOGFONT));
    [/code]






Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion