Re: Available font sizes

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 10 Dec 2002 17:59:21 +0000, Brian Broker <bkb at cnw.com> wrote:

>Any number may be typed into the dialog and therefore any size is=20
>"available".
No it isn't. Windows substitutes a suitable font when the size
specified is not available. I am working on the Zoom in Print Preview.
(If I use a fixed font size and StretchBlt it, the quality really
degrades when you zoom in and out, tried that already)
The following example shows Arial behaving quite well, Courier and MS
fonts rather badly, and Marlett, Terminal actually switching between
serif and sans serif fonts for different point sizes:

include win32lib.ew
constant MAIN=3Dcreate(Window,"Key +/- to change font",0,0,0,200,200,0)
constant fontset=3D{"Arial","Courier","Fixedsys","Garamond","Impact",
			  "Kourier","Kourier SanSerif",
			  "Marlett","MS Sans Serif","MS Serif",
			"Small Fonts","System","Tahoma",
			  "Times New Roman","Terminal","Verdana"}
integer f f=3D1
procedure onpaintmain(integer self, integer event, sequence params)
	for i=3D1 to 24 do
		setFont(MAIN,fontset[f],i,Normal) setPenPos(MAIN,20,i*28)
		wPuts(MAIN,sprintf("%s %d points",{fontset[f],i}))
	end for
end procedure
setHandler(MAIN,w32HPaint,routine_id("onpaintmain"))
procedure onkey(integer self, integer event, sequence params)
	if self or event then end if -- suppress warnings
	if params[1]=3D'+' then
		if f<length(fontset) then f+=3D1 repaintWindow(MAIN) end if
	elsif params[1]=3D'-' then
		if f>1 then f-=3D1 repaintWindow(MAIN) end if
	end if
end procedure
setHandler(MAIN,w32HKeyPress,routine_id("onkey"))
WinMain(MAIN,Maximized)

Pete
PS This link is almost exactly what I think I want(!), less the
if(lpelfe->elfLogFont.lfPitchAndFamily & FIXED_PITCH) test:
http://freespace.virgin.net/james.brown7/tutorials/enumfont.htm

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu