10-02-2008 06:15 PM
The monospace font inside my textbox doesn't show correctly when I have the application running in Windows 2000. It's as if the font type is no longer monospaced. The problem isn't there when the same application is run in Windows XP. Is there a fix? I am using CVI 8.5.1 and the the windows 2000 have service pack 4 installed.
Gary Z.
10-03-2008 11:40 AM
What is the exact name of the font that you're using? And can you post a screenshot of how the textbox looks like, both in XP and in Windows 2000?
Thanks,
Luis
10-03-2008 03:56 PM
I've attached a image copy of the problem I've described. The top picture is from XP, and the bottom one is from Win 2K
Any suggestions?
10-04-2008 03:13 AM
10-04-2008 10:02 PM
Hi Gary,
I think the most likely problem you're having is that the font you're trying to use ("Arial Monospace") is not installed in the Windows 2000 computer where you're running your application. Whenever you try to specify a font typeface that does not exist, you end up with a different typeface which the Windows font mapper thinks might be a close approximation. In this case, unfortunately, it didn't give you a monospace font.
To confirm that you have "Arial Monospace" in your Windows XP computer but not in your Windows 2000 computer, you can run some application that allows you to browse all the fonts in your system (Notepad, for example). I expect that this font won't show up in the font selection dialog in the Windows 2000 computer. I'm pretty sure that it also doesn't come with Windows XP, by default, but my guess is that some application that you installed at some point in the XP computer happened to also install that font. I've googled for it but couldn't find any reference on where it really comes from.
By the way, I second Roberto's suggestion of using a listbox to align the columns, as long as you don't need to allow your users to edit the text directly.
Luis
10-06-2008 02:49 PM
Based on this page I'd suggest Courier New or Lucida Console for a quick fix.
To check if a font is installed, call GetFontTypefaceName and check the return code. Then you can issue a warning up front notifying the user that a font is missing.
With respect to the list box, the key is the escape codes. Start with the CVI help for InsertListItem.
As a side note, listboxes certainly can offer improvements, but are not completely flexible. I sometimes wish there was a control that was more flexible, like a barebones HTML box, but which did not rely on what ActiveX control was installed on the target machine (which was exactly the issue that started this thread!). Such a control would help me by allowing for larger fonts for headings and easier construction of tables.
Hope this helps.
--Ian