The MASM Forum

General => The Workshop => Topic started by: mikeburr on October 04, 2017, 04:28:21 PM

Title: font spacing and formating of outpur
Post by: mikeburr on October 04, 2017, 04:28:21 PM
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       
Title: Re: font spacing and formating of outpur
Post by: aw27 on October 04, 2017, 04:39:06 PM
Are you looking for fixed-pitch, also called monospace, fonts or not?
There are a bunch of them like Courier, Courier New, Lucida Console, ...
Title: Re: font spacing and formating of outpur
Post by: jj2007 on October 04, 2017, 04:45:08 PM
invoke SendMessage, hListbox, WM_SETFONT, rv(GetStockObject, ANSI_FIXED_FONT), 0 ; SYSTEM_FIXED_FONT is bold and larger
Title: Re: font spacing and formating of outpur
Post by: mikeburr on October 07, 2017, 11:34:01 PM
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
Title: Re: font spacing and formating of outpur
Post by: mikeburr on October 08, 2017, 12:01:57 AM
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