Re: Win32Lib: any way to GET the font size?
- Posted by Dan Moyer <danielmoyer at prodigy.net> Mar 23, 2007
- 536 views
don cole wrote: > > Dan Moyer wrote: > > > > don cole wrote: > > > > > > > > > Dan Moyer wrote: > > > > > > > > Is there some way to get the font SIZE? I don't mean the height or > > > > width > > > > extents of CHARACTERS, I mean the value that would be used to SET the > > > > font > > > > to a particular size. > > > > > > > > I want to be able to center various text within columns, by changing the > > > > > > > > size of the font as needed, but that text could > > > > be in different sized fonts to begin with, so my routine needs to change > > > > the font size *from* whatever original size it was, so I need to be able > > > > to > > > > *find out* what size it happens to be initially. > > > > > > > > Dan Moyer > > > > > > Hello Dan, > > > > > > Try getFontDialog() > > > > > > Don Cole > > > > Don, > > > > I'm not looking for a *dialog*, wherein a user *selects* a font/size, > > but rather a way for my *program* to ascertain what font size is currently > > in force for a window. I want my program to GET the font size first, then > > it will decrement it as necessary, then return to original after using > > smaller size as needed to fit space allotted. > > > > Dan > > Hello Dan, > > I was just reading from index.html the desciption of > > getFontDialog ( window ) > > that says > > Returns: { font name, points, style flags, color } or -1 if cancelled. > > I have never used this. However I have a program that I think does what you > want. It starts out with a randon (large) font size. Then it keeps reducing > it until all the columns fit on the paper. This print preview program is > lengthy > and I have never posted it in the archives. If you are interested I coulde > e-mail > it to you. > > Don Cole Don, Thanks, I can do it myself once I know the font size (which I'll work around by making sure that I keep track of it whenever it gets changed), but I'm always interested in how others code a similar problem, so if you will, go ahead & email it to me. Actually I'm just concerned with fitting things onto the *screen* right now, but as soon as I get that working I will want to do the exact same thing for printer, also. Dan