LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Monospace font in textbox doesn't show correctly in windows 2000, but does in XP

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.

 

0 Kudos
Message 1 of 6
(4,792 Views)

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

0 Kudos
Message 2 of 6
(4,770 Views)

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?

 

  

0 Kudos
Message 3 of 6
(4,760 Views)
This is not a direct answer to your question, it's just an alternative that occured to my mind looking at the screenshot of your application. You could greatly improve the appearance of your panel by switching from a simple textbox to a listbox, that permits you to line up text in columns without the use of a monospace font. Additionally, the listbox permits you to have different alignment inside the columns and to add colours to some of the text shown (e.g. "FAIL" written on a red background). As a side note, in my experience listboxes operate the same way both in W2K ans XP.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(4,748 Views)

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

 

0 Kudos
Message 5 of 6
(4,736 Views)

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

0 Kudos
Message 6 of 6
(4,703 Views)