News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

font spacing and formating of outpur

Started by mikeburr, October 04, 2017, 04:28:21 PM

Previous topic - Next topic

mikeburr

dear all
i am having some difficulty spacing output sensibly. Its all numeric and i could use a list view to put the data into ordered columns ... but i didnt i made a formatter based on the largest element i found. I was somewhat annoyed to find that spaces etc are not the same width as numeric charactars [same sort of rubbish thinking applies to HTML i believe] and although it might look nice its a pretty stupid idea [you might tell from my irritation  that i have programmed using punched cards and old green screened terminals]. I thought it would be clever to use the CreateFontIndirect  API at the start of the program but unfortunately the list box into which i load the page of data is unaffected .. although it is possible to make Mondrian-like patterns with the text outside [very avant garde]. I thought i might be able to use a non true type font as a system wide font using the control panel but there is no way to instal these that i can find [button disabled]. I did wonder whether to make a list box of my own as im already using linked lists to provide a paged 4096 records as the list boxes are very limited in terms of lines they can hold / display [prob a 16 bit limitation judging by the maximum lineage] .
Question 1)  Has anyone made such a custom listbox and if so roughly what did you do ???
Question 2)  Has anyone else overcome the True type unequal spacing limitations
regards mike burr       

aw27

Are you looking for fixed-pitch, also called monospace, fonts or not?
There are a bunch of them like Courier, Courier New, Lucida Console, ...

jj2007

invoke SendMessage, hListbox, WM_SETFONT, rv(GetStockObject, ANSI_FIXED_FONT), 0 ; SYSTEM_FIXED_FONT is bold and larger

mikeburr

dear jj
thanks very much ... i had to put the GetStockObject   on a separate line [ no rv stuff] but this is great    My horrible little formatter works properly too which is even more surprising !!  I wont adulterate your map program now [ rather mischieviously i was going to amend the names etc so that when you put the cursor over them they came back with scurrilous attributes relating to the locals ..... which is probably a good idea for a game as it would appeal to lots of peoples Xenophobia if they didnt see the funny side of it !!!
regards and many thanks Mike B

mikeburr

dear jj
SYSTEM_FIXED_FONT is smallest and bolder , OEM_FIXED_FONT is redolent of the old dot matrix printers   its quite bold [ for fading eyes   but bigger] and ANSI_FIXED_FONT attractive too being much lighter and not so obtrusive  .. ive taken a photo but no means on this machine of reducing the size of image so it can be posted   
hence the descriptions
many thanks Mike B