|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problem offering font selection with listview in regions other than USI recently added a drop-down combo with a few choices of the MS Sans Serif
font that a user can select for a listview. I added 8.25, 9.75, 12, and 13.5. These are the actual font sizes I found by printing out the font sizes for 8, 10, 12, and 14. I have a user who is using a different regional other than US. Probably Italian. When he selects any of the fonts, the listview is unreadable. The fonts are so big that the graphics in the listview are screwed up. How can I fix this? -- Thanks. "Saucer Man" <saucerman@nospam.net> wrote in message Firstly you cannot assume that actual available font sizes will be the samenews:5MydnW0_DOZ2N9DenZ2dnUVZ_tKdnZ2d@adelphia.com... > . . . I added 8.25, 9.75, 12, and 13.5. These are the actual font > sizes I found by printing out the font sizes for 8, 10, 12, and 14. on all machines (or even on the same machine at different settings). If you're interested in determining the actual available sizes for any specific font you need to add code to do so at run time. With True Type fonts the point sizes are constrained to be the equivalent of a "whole number" of pixels on the chosen output device. Other types of font (MS Sans Serif for example, which is not a True Type font) are also constrained in the same way but they additionally have other constraints which further limits the available point sizes. With True Type fonts (which don't usually care about the precise number of pixels in the point size as long as it is a "whole number") you usually get quite close to what you ask for, but with MS Sans Serif (which is quite fussy about the actual number of pixels as well) you can sometimes get something quite different. Also, even if two different machines actually give you a very similar point size then you still have to consider the fact that "the number of pixels in a point" might be very different if the output devices have a different physical size. Perhaps I'd best explain that a little further: If a computer is running its display at 1024 x 768 pixels and its "pixels per inch" setting is currently 96 dpi then the logical size of the screen will be 1024/96 x 768/96, which is the same as 10.7 x 8 inches or 768 x 576 points. A similar machine also running at 1024 x 768 pixels but with a current "pixels per inch" setting of 120 dpi will have a screen size of 1024/120 x 768/120, which is the same as 8.5 x 6.4 inches or 614 x 460 points. Therefore, a "point" on the second machine will be quite a bit larger than a "point" on the first machine. So, the other thing to check is the dpi setting on both machines. You can read it with: Print Me.ScaleY(1, vbInches, vbPixels) Mike I guess that the comma seperator is the problem. Many regional settings use
the comma ',' instead of the dot '.' - so VB reads a string of "8.25" as 825 (because it ignores the dot, which is interpreted as a thousands seperator, or unknown). Are you setting the font size as string? Try using a double value directly (without quotes), that should work. If you want to display the default font size, use CStr(dblFontSize), so the font size will be displayed according to the regional settings. Robert Show quoteHide quote "Saucer Man" <saucerman@nospam.net> wrote in message news:5MydnW0_DOZ2N9DenZ2dnUVZ_tKdnZ2d@adelphia.com... > I recently added a drop-down combo with a few choices of the MS Sans Serif > font that a user can select for a listview. I added 8.25, 9.75, 12, and > 13.5. These are the actual font sizes I found by printing out the font > sizes for 8, 10, 12, and 14. > > I have a user who is using a different regional other than US. Probably > Italian. When he selects any of the fonts, the listview is unreadable. The > fonts are so big that the graphics in the listview are screwed up. How can > I fix this? > > -- > > Thanks. > > > "Robert" <no***@nowhere.com> wrote in message Nice one! I never even thought of that possibility. I reckon you've hit the news:%23xtcDC9zFHA.612@TK2MSFTNGP10.phx.gbl... >I guess that the comma seperator is the problem. nail on the head there! Mike Thanks Mike and Robert. I set the drop-down combo just to 8,10,12, and 14
and that works. Thanks again! -- Show quoteHide quoteThanks. "Saucer Man" <saucerman@nospam.net> wrote in message news:5MydnW0_DOZ2N9DenZ2dnUVZ_tKdnZ2d@adelphia.com... >I recently added a drop-down combo with a few choices of the MS Sans Serif >font that a user can select for a listview. I added 8.25, 9.75, 12, and >13.5. These are the actual font sizes I found by printing out the font >sizes for 8, 10, 12, and 14. > > I have a user who is using a different regional other than US. Probably > Italian. When he selects any of the fonts, the listview is unreadable. > The fonts are so big that the graphics in the listview are screwed up. > How can I fix this? > > -- > > Thanks. > > > |
|||||||||||||||||||||||