1. Size,Space,Fonts etc
- Posted by Euman <euman at bellsouth.net> Jun 21, 2001
- 403 views
Hello all, I am faced with a problem and what best way to handle it. If a user of a program has set the fonts on the menu to a different size (lets say larger than standard for example) than you originaly programmed your window size for. everything in your client area will be pushed down by the left over size of the font. Also, Group boxes are static which means they too will automatically resize themselves to compensate. I use this: extent = getCharExtent( hWnd ) fh = extent[2] -- Only accounting for 99% & 125% font if fh = 16 then --Windows Default large font fh = 0 sh = 2 elsif fh = 13 then -- Windows Default small font fh = 8 sh = 0 end if the fh and sh values are to place inside controls to compensate for this size problem I have. Is there a better way? I cant think of one right off. there are so many user configurable changes in Windows Fonts, menu font sizes, icon spaceing etc etc etc How are we supposed to compensate for all of these? Euman euman at bellsouth.net
2. Re: Size,Space,Fonts etc
- Posted by president at insight-concepts.com Jun 21, 2001
- 388 views
Hi Euman, Try the Win32lib setfont fix I sent you. I just tried it and it= seems to correct that problem. I adjusted my system font size to 18 but= it did not affect my program. But when I removed setfont,.....the program took the size of the system font. Try the patch. Chris
3. Re: Size,Space,Fonts etc
- Posted by Gerardo <gebrandariz at YAHOO.COM> Jun 21, 2001
- 417 views
Euman, You are resetting font sizes according to your criteria, in order to have your controls show the way you designed them. But if the user modified the default font size, it's probably because of a personal need or preference, and if you reset them you are running against the grain of the user's decision. Especially in the case of large fonts, this may be a dire necessity, if the user is really short-sighted. In your place, instead of modifyng font sizes, on detecting large fonts I'd apply smaller images and shorter, abbreviated texts to the controls. A short-sighted user will accept that, s/he knows s/he's short-sighted and doesn't expect the world to conform to her/his disadvantage, but will certainly be turned off by any meddling with settings. If you always try for 640x480, 16-color & hugefont, and think of anything else as added bonuses, you can't go wrong. Gerardo ----- Original Message ----- From: "Euman" <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Sent: Friday, June 22, 2001 12:16 AM Subject: Size,Space,Fonts etc > Hello all, > > I am faced with a problem and what best way to > handle it. > > If a user of a program has set the fonts on the menu > to a different size > (lets say larger than standard for example) > than you originaly programmed your window size for. > everything in your client area will be pushed down by > the left over size of the font. > > Also, Group boxes are static which means they too will > automatically resize themselves to compensate. > > I use this: > extent = getCharExtent( hWnd ) > > fh = extent[2] > > -- Only accounting for 99% & 125% font > if fh = 16 then --Windows Default large font > fh = 0 > sh = 2 > > elsif fh = 13 then -- Windows Default small font > fh = 8 > sh = 0 > end if > > the fh and sh values are to place inside controls to > compensate for this size problem I have. > > Is there a better way? I cant think of one right off. > there are so many user configurable changes in Windows > Fonts, menu font sizes, icon spaceing etc etc etc > > How are we supposed to compensate for all of these? > > Euman > euman at bellsouth.net
4. Re: Size,Space,Fonts etc
- Posted by Euman <euman at bellsouth.net> Jun 21, 2001
- 402 views
I think maybe you misunderstood, I want to be able to have *cross* font size support. try this: include win32lib.ew constant hWnd = create( Window, " ", 0, 0, 0, 678, 548, { WS_DLGFRAME, WS_SYSMENU} ) setWindowBackColor( hWnd,8404992) constant RebarGroup = create( Group, "", hWnd, 8, 185, 656, 40, 0 ) constant RB = create( ReBar, "Family", RebarGroup, 1, 8, 630, 30, RBS_FIXEDORDER ) constant Band1 = create( ReBarBand, "File & Printing", RB, 4, 0, 30, 30, 0) constant Band2 = create( ReBarBand, "Member Section", RB, 30, 0, 30, 30, 0) constant Band3 = create( ReBarBand, "New Additions", RB, 60, 0, 30, 30, 0) constant BandGroup1 = create(ToolBar, "", RB, 0, 0, 300, 30, TBSTYLE_TRANSPARENT ) constant BandGroup2 = create(ToolBar, "", RB, 0, 0, 300, 30, TBSTYLE_TRANSPARENT ) constant BandGroup3 = create(ToolBar, "", RB, 0, 0, 300, 30, TBSTYLE_TRANSPARENT ) addToBand( BandGroup1, Band1 ) addToBand( BandGroup2, Band2 ) addToBand( BandGroup3, Band3 ) WinMain( hWnd, Normal ) Now run it with changed font sizes and watch the Goup behind the rebar move up or down the page...... UNSATISFACTORY* Any help with this appreciated, If not then I'll write enough code to get by which Ive done. but there has to be a global way. Euman euman at bellsouth.net ----- Original Message ----- From: "Gerardo" <gebrandariz at YAHOO.COM> To: "EUforum" <EUforum at topica.com> Sent: Thursday, June 21, 2001 23:07 Subject: Re: Size,Space,Fonts etc > > > Euman, > > You are resetting font sizes according to your criteria, in order to have > your controls show the way you designed them. > > But if the user modified the default font size, it's probably because of a > personal need or preference, and if you reset them you are running against > the grain of the user's decision. Especially in the case of large fonts, > this may be a dire necessity, if the user is really short-sighted. > > In your place, instead of modifyng font sizes, on detecting large fonts I'd > apply smaller images and shorter, abbreviated texts to the controls. A > short-sighted user will accept that, s/he knows s/he's short-sighted and > doesn't expect the world to conform to her/his disadvantage, but will > certainly be turned off by any meddling with settings. > > If you always try for 640x480, 16-color & hugefont, and think of anything > else as added bonuses, you can't go wrong. > > Gerardo > > > ----- Original Message ----- > From: "Euman" <euman at bellsouth.net> > To: "EUforum" <EUforum at topica.com> > Sent: Friday, June 22, 2001 12:16 AM > Subject: Size,Space,Fonts etc > > > > Hello all, > > > > I am faced with a problem and what best way to > > handle it. > > > > If a user of a program has set the fonts on the menu > > to a different size > > (lets say larger than standard for example) > > than you originaly programmed your window size for. > > everything in your client area will be pushed down by > > the left over size of the font. > > > > Also, Group boxes are static which means they too will > > automatically resize themselves to compensate. > > > > I use this: > > extent = getCharExtent( hWnd ) > > > > fh = extent[2] > > > > -- Only accounting for 99% & 125% font > > if fh = 16 then --Windows Default large font > > fh = 0 > > sh = 2 > > > > elsif fh = 13 then -- Windows Default small font > > fh = 8 > > sh = 0 > > end if > > > > the fh and sh values are to place inside controls to <snip> > >
5. Re: Size,Space,Fonts etc
- Posted by Euman <euman at bellsouth.net> Jun 21, 2001
- 428 views
Ok, that wasnt the best example but it does prove that the Group box when useing small fonts is a perfect fit around the rebar control and when in Large fonts that the top of the Group box is hidden behind the rebar control. Now, I hope you guys/gals think Im worried about one or two pixels difference..... It matters to me that visually the line is hidden useing Large fonts. Euman euman at bellsouth.net ----- Original Message ----- From: "Euman" <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Sent: Friday, June 22, 2001 00:31 Subject: Re: Size,Space,Fonts etc > > > I think maybe you misunderstood, > I want to be able to have *cross* font size support. > > try this: > > include win32lib.ew > > constant hWnd = create( Window, " ", 0, 0, 0, 678, 548, { WS_DLGFRAME, > WS_SYSMENU} ) > setWindowBackColor( hWnd,8404992) > > constant RebarGroup = create( Group, "", hWnd, 8, 185, 656, 40, 0 ) > > constant RB = create( ReBar, "Family", RebarGroup, 1, 8, 630, 30, > RBS_FIXEDORDER ) > > constant Band1 = create( ReBarBand, "File & Printing", RB, 4, 0, 30, 30, 0) > constant Band2 = create( ReBarBand, "Member Section", RB, 30, 0, 30, 30, 0) > constant Band3 = create( ReBarBand, "New Additions", RB, 60, 0, 30, 30, 0) > > constant BandGroup1 = create(ToolBar, "", RB, 0, 0, 300, 30, > TBSTYLE_TRANSPARENT ) > constant BandGroup2 = create(ToolBar, "", RB, 0, 0, 300, 30, > TBSTYLE_TRANSPARENT ) > constant BandGroup3 = create(ToolBar, "", RB, 0, 0, 300, 30, > TBSTYLE_TRANSPARENT ) > > addToBand( BandGroup1, Band1 ) > addToBand( BandGroup2, Band2 ) > addToBand( BandGroup3, Band3 ) > > WinMain( hWnd, Normal ) > > > Now run it with changed font sizes and watch the Goup behind > the rebar move up or down the page...... > > UNSATISFACTORY* > > Any help with this appreciated, > > If not then I'll write enough code to get by which Ive done. > but there has to be a global way. > > Euman > euman at bellsouth.net > > > ----- Original Message ----- > From: "Gerardo" <gebrandariz at YAHOO.COM> > To: "EUforum" <EUforum at topica.com> > Sent: Thursday, June 21, 2001 23:07 > Subject: Re: Size,Space,Fonts etc > > > > > > > > Euman, > > > > You are resetting font sizes according to your criteria, in order to have <snip> > >
6. Re: Size,Space,Fonts etc
- Posted by Gerardo <gebrandariz at YAHOO.COM> Jun 22, 2001
- 381 views
Euman, Sorry. Yes, I misunderstood. I thought your intention was to force a standard, unchanging font size. About Large Fonts: this is the way they work, there's no help for it. I know. One of my PCs runs Win98 configured with users, and my wife, who has severe eyesight problems, has her config Large, Larger, Largest! She sees them OK, but half the texts, menus and controls stampede out of sight, one on top of the other, and so on. You can't even reach them with the mouse pointer in a normal fashion. The only way around this could be managing your own font sizes and faces: upon detecting Large, apply the largest you consider appropriate, choosing a narrow, very clear, sans serif font face to replace the Win default. Good choices would be, in my experience, Arial (maybe even Arial Narrow), and Comic Sans MS. Gerardo ----- Original Message ----- From: "Euman" <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Sent: Friday, June 22, 2001 3:12 AM Subject: Re: Size,Space,Fonts etc > Ok, that wasnt the best example but it does prove > that the Group box when useing small fonts > is a perfect fit around the rebar control and when > in Large fonts that the top of the Group box is hidden > behind the rebar control. > > Now, I hope you guys/gals think Im worried > about one or two pixels difference..... > > It matters to me that visually the line is hidden > useing Large fonts. > > Euman > euman at bellsouth.net > > > ----- Original Message ----- > From: "Euman" <euman at bellsouth.net> > To: "EUforum" <EUforum at topica.com> > Sent: Friday, June 22, 2001 00:31 > Subject: Re: Size,Space,Fonts etc > > > > > > > > I think maybe you misunderstood, > > I want to be able to have *cross* font size support. > > > > try this: > > > > include win32lib.ew > > > > constant hWnd = create( Window, " ", 0, 0, 0, 678, 548, { WS_DLGFRAME, > > WS_SYSMENU} ) > > setWindowBackColor( hWnd,8404992) > > > > constant RebarGroup = create( Group, "", hWnd, 8, 185, 656, 40, 0 ) > > > > constant RB = create( ReBar, "Family", RebarGroup, 1, 8, 630, 30, > > RBS_FIXEDORDER ) > > > > constant Band1 = create( ReBarBand, "File & Printing", RB, 4, 0, 30, 30, 0) > > constant Band2 = create( ReBarBand, "Member Section", RB, 30, 0, 30, 30, 0) > > constant Band3 = create( ReBarBand, "New Additions", RB, 60, 0, 30, 30, 0) > > > > constant BandGroup1 = create(ToolBar, "", RB, 0, 0, 300, 30, > > TBSTYLE_TRANSPARENT ) > > constant BandGroup2 = create(ToolBar, "", RB, 0, 0, 300, 30, > > TBSTYLE_TRANSPARENT ) > > constant BandGroup3 = create(ToolBar, "", RB, 0, 0, 300, 30, > > TBSTYLE_TRANSPARENT ) > > > > addToBand( BandGroup1, Band1 ) > > addToBand( BandGroup2, Band2 ) > > addToBand( BandGroup3, Band3 ) > > > > WinMain( hWnd, Normal ) > > > > > > Now run it with changed font sizes and watch the Goup behind > > the rebar move up or down the page...... > > > > UNSATISFACTORY* > > > > Any help with this appreciated, > > > > If not then I'll write enough code to get by which Ive done. > > but there has to be a global way. > > > > Euman > > euman at bellsouth.net > > > > > > ----- Original Message ----- > > From: "Gerardo" <gebrandariz at YAHOO.COM> > > To: "EUforum" <EUforum at topica.com> > > Sent: Thursday, June 21, 2001 23:07 > > Subject: Re: Size,Space,Fonts etc > > > > > > > > > > > > > Euman, > > > > > > You are resetting font sizes according to your criteria, in order to have > <snip> >
7. Re: Size,Space,Fonts etc
- Posted by Euman <euman at bellsouth.net> Jun 22, 2001
- 404 views
What I decided to do was trace the program useing small font and then large I found that even if a user had opted for a larger font on menu's that a program will return the same size for the menu based on the global windows font size scale. 16 is the height returned for small fonts and 19 is returned for large fonts. I realise this isnt insureing that this will work with all users configurations but assume that *most* users either utilize the small or large that can be selected under properties/settings/advanced/display/font size I then test for each of these by doing this: mnuextent = getCharExtent( mnu ) gh = floor(mnuextent[2]) -- floor this just incase if gh = 16 then --Windows default small font fh = 8 sh = 0 setRect( hWnd, centerX(678), centerY(548-fh), 678, 548-fh, True ) elsif gh = 19 then -- Windows default large font sh = 2 setRect( hWnd, centerX(678), centerY(548), 678, 548, True ) end if based on this I re-setRect to handle the controls being smaller or larger i.e: TabItems, Listview Headers, Group boxes and non control text. Granted this is not the *pro* way to do this and is a very quick fix only to handle a specific Windowing app that seems to work. Euman euman at bellsouth.net ----- Original Message ----- From: "Gerardo" <gebrandariz at YAHOO.COM> To: "EUforum" <EUforum at topica.com> Sent: Saturday, June 23, 2001 01:03 Subject: Re: Size,Space,Fonts etc > > > Euman, > > Sorry. Yes, I misunderstood. I thought your intention was to force a > standard, unchanging font size. > > About Large Fonts: this is the way they work, there's no help for it. I > know. One of my PCs runs Win98 configured with users, and my wife, who has > severe eyesight problems, has her config Large, Larger, Largest! She sees > them OK, but half the texts, menus and controls stampede out of sight, one > on top of the other, and so on. You can't even reach them with the mouse > pointer in a normal fashion. > > The only way around this could be managing your own font sizes and faces: > upon detecting Large, apply the largest you consider appropriate, choosing a > narrow, very clear, sans serif font face to replace the Win default. Good > choices would be, in my experience, Arial (maybe even Arial Narrow), and > Comic Sans MS. > > Gerardo > > > ----- Original Message ----- > From: "Euman" <euman at bellsouth.net> > To: "EUforum" <EUforum at topica.com> > Sent: Friday, June 22, 2001 3:12 AM > Subject: Re: Size,Space,Fonts etc > > > > Ok, that wasnt the best example but it does prove > > that the Group box when useing small fonts > > is a perfect fit around the rebar control and when > > in Large fonts that the top of the Group box is hidden > > behind the rebar control. > > > > Now, I hope you guys/gals think Im worried > > about one or two pixels difference..... > > > > It matters to me that visually the line is hidden > > useing Large fonts. > > > > Euman > > euman at bellsouth.net > > > > > > ----- Original Message ----- > > From: "Euman" <euman at bellsouth.net> > > To: "EUforum" <EUforum at topica.com> > > Sent: Friday, June 22, 2001 00:31 > > Subject: Re: Size,Space,Fonts etc > > > > > > > > > > > > > I think maybe you misunderstood, > > > I want to be able to have *cross* font size support. > > > > > > try this: > > > > > > include win32lib.ew > > > <snip> > >
8. Re: Size,Space,Fonts etc
- Posted by Gerardo <gebrandariz at YAHOO.COM> Jun 23, 2001
- 398 views
Euman, Seems right to me. OK, it's a patch, but as long as it works, keep it. You say it's not the pro way, but you can't go much farther -not until Windows becomes open code, and I wouldn't recommend waiting for that! I can think of two ways to do the pro job, granted the time and inclination: One would be to write a structure that compiled all possible video modes, all possible font sizes, all possible... you get the idea. Unworkable, since (a) no one can tell what will come up next month, or next year, and (b) infinite combinations in infinite diversity may be good for Vulcan philosophy, but not for your program's size or performance. The second requires not just a programmer but an artist: think 'variable', think 'function of'. Make everything depend on what you detect, redesign your interface on the fly, as the user ..ah.. uses it. I did it once with Visual Basic. It takes a lot of code, and you mustn't forget a single detail (link window resizing) or it will look decidedly unprofessional. But the results are wonderful, everybody will be happy, and you'll be covered as long as the API holds still. Gerardo ----- Original Message ----- From: "Euman" <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Sent: Saturday, June 23, 2001 4:43 AM Subject: Re: Size,Space,Fonts etc > > > What I decided to do was trace the program useing small font and then large > > I found that even if a user had opted for a larger font on menu's > that a program will return the same size for the menu based on > the global windows font size scale. 16 is the height returned for > small fonts and 19 is returned for large fonts. > I realise this isnt insureing that this will work with all users configurations > but assume that *most* users either utilize the small or large that can be > selected under properties/settings/advanced/display/font size > I then test for each of these by doing this: > > mnuextent = getCharExtent( mnu ) > gh = floor(mnuextent[2]) -- floor this just incase > > if gh = 16 then --Windows default small font > fh = 8 > sh = 0 > setRect( hWnd, centerX(678), centerY(548-fh), 678, 548-fh, True ) > > elsif gh = 19 then -- Windows default large font > sh = 2 > setRect( hWnd, centerX(678), centerY(548), 678, 548, True ) > end if > > based on this I re-setRect to handle the controls being smaller or larger > i.e: TabItems, Listview Headers, Group boxes and non control text. > > Granted this is not the *pro* way to do this and is a very quick > fix only to handle a specific Windowing app that seems to work. > > Euman > euman at bellsouth.net > > > ----- Original Message ----- > From: "Gerardo" <gebrandariz at YAHOO.COM> > To: "EUforum" <EUforum at topica.com> > Sent: Saturday, June 23, 2001 01:03 > Subject: Re: Size,Space,Fonts etc > > > > > > > > Euman, > > > > Sorry. Yes, I misunderstood. I thought your intention was to force a > > standard, unchanging font size. > > > > About Large Fonts: this is the way they work, there's no help for it. I > > know. One of my PCs runs Win98 configured with users, and my wife, who has > > severe eyesight problems, has her config Large, Larger, Largest! She sees > > them OK, but half the texts, menus and controls stampede out of sight, one > > on top of the other, and so on. You can't even reach them with the mouse > > pointer in a normal fashion. > > > > The only way around this could be managing your own font sizes and faces: > > upon detecting Large, apply the largest you consider appropriate, choosing a > > narrow, very clear, sans serif font face to replace the Win default. Good > > choices would be, in my experience, Arial (maybe even Arial Narrow), and > > Comic Sans MS. > > > > Gerardo > > > > > > ----- Original Message ----- > > From: "Euman" <euman at bellsouth.net> > > To: "EUforum" <EUforum at topica.com> > > Sent: Friday, June 22, 2001 3:12 AM > > Subject: Re: Size,Space,Fonts etc > > > > > > > Ok, that wasnt the best example but it does prove > > > that the Group box when useing small fonts > > > is a perfect fit around the rebar control and when > > > in Large fonts that the top of the Group box is hidden > > > behind the rebar control. > > > > > > Now, I hope you guys/gals think Im worried > > > about one or two pixels difference..... > > > > > > It matters to me that visually the line is hidden > > > useing Large fonts. > > > > > > Euman > > > euman at bellsouth.net > > > > > > > > > ----- Original Message ----- > > > From: "Euman" <euman at bellsouth.net> > > > To: "EUforum" <EUforum at topica.com> > > > Sent: Friday, June 22, 2001 00:31 > > > Subject: Re: Size,Space,Fonts etc > > > > > > > > > > > > > > > > > > I think maybe you misunderstood, > > > > I want to be able to have *cross* font size support. > > > > > > > > try this: > > > > > > > > include win32lib.ew > > > > > <snip> > > > > > > > >