News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

LOGFONT problems

Started by xandaz, December 03, 2018, 02:08:32 AM

Previous topic - Next topic

xandaz

    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>
                                       


jj2007

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">>

xandaz

     Ty jj. i'm going to try.

xandaz

       Errors anyway. Constant value too large. ty for help jj.

xandaz

   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.

jj2007

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:

aw27

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.

xandaz

   AW, that seems to work. I had to use the index registers to fill the damn structure...ty.

xandaz

   yeah JJ. Thats what i did. worked fine. ty