Hello guys and thanks in advance. I've initialized a logfont structure but masm errors. Initializer must be a string or single item:
UCSTR FontName,"fixedsys.fon",0
logf LOGFONT <32,32,0,0,FW_DONTCARE,0,0,0,\
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,\
DEFAULT_QUALITY,DEFAULT_PITCH+FF_DONTCARE,offset FontName>
Try this, it works fine with UAsm:
logf LOGFONT <32,32,0,0,FW_DONTCARE,0,0,0,\
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,\
DEFAULT_QUALITY,DEFAULT_PITCH+FF_DONTCARE,<"fixedsys.fon">>
Ty jj. i'm going to try.
Errors anyway. Constant value too large. ty for help jj.
i'm using UNICODE. Didn't realise lfFaceName actually included the string inside the LOGFONT STRUCT. do you know what macro to use with it?
ty.
Quote from: xandaz on December 03, 2018, 03:33:32 AM
i'm using UNICODE.
logf LOGFONTW <32,32,0,0,FW_DONTCARE,0,0,0,\
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,\
DEFAULT_QUALITY,DEFAULT_PITCH+FF_DONTCARE, <0>>
Then copy the string to its location. Why do you need Unicode here? There are hardly any fonts around with a Unicode name. You would have to use a resource string or similar to get true Unicode. Of course, I could show you the simple MasmBasic solution, but some troll will show up and aggress me... :bgrin:
logf LOGFONTW <32,32,0,0,FW_DONTCARE,0,0,0,\
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,\
DEFAULT_QUALITY,DEFAULT_PITCH+FF_DONTCARE, {"f","i","x","e","d","s","y","s",".","f","o","n",0}>
and there are other ways but I need to leave before JJ triggers the spam button.
AW, that seems to work. I had to use the index registers to fill the damn structure...ty.
yeah JJ. Thats what i did. worked fine. ty