Click to See Complete Forum and Search --> : font construction prob


scomet1
August 20th, 2004, 02:23 PM
Hello,

So hopefully this is an easy one:

My program gets a char array containing the name of a font family.

I need to get it into the lfHeight member of the LOGFONT structure.

Does anyone know how?!?!


char * familyname = "courier";

LOGFONT lf;

Now how do I get familyname into lf.lfFaceName ????

I'm using visual c++ emedded 4.0 - but I don't think it should matter too much.

Thanx

scomet1
August 20th, 2004, 02:36 PM
So no one has to answer me anymore.

I'm currently just going to use a loop and copy each character in individually.

Maybe someone has a prettier way however?.....

mdmd
August 20th, 2004, 03:30 PM
strcpy(lf.lfFaceName, "Courier");
or lstrcpy().
Or strncpy() and limit the copy to LF_FACESIZE characters.