12-09-2008 02:10 PM
In all my other IDEs (Visual Studio, WDSCi) I have used a ProggyClean-Slashed-Zero-Bold-Punctuation-monospaced font (http://www.proggyfonts.com/index.php?menu=download) that made my life a tad bit easier. But in LabWindows/CVI 9 I am only allowed to select from a narrow list of fonts. How do I get my Proggy font? Or, a better question, what determines which fonts are listed in that selection?
Thanks!!
Solved! Go to Solution.
12-11-2008 11:10 AM
Hey Luke,
LabWindows/CVI populates its fonts from the C:\WINDOWS\Fonts directory. The one restriction for the source window is that the font has to be monospaced to be compatible. I went ahead and tried installing the font you referenced (the bitmap version) to this directory, closed and restarted CVI, and it then showed up as an option! Give this a try and let me know if you have any questions.
Lars
12-11-2008 12:03 PM
Wow! I'm excited that you got it to work, but alas I could not. 😞
I tried reinstalling the font (first time was just dragging the 'ProggyCleanSZBP.fon' file to C:\Windows\Fonts) by going through the very Windows 3.1-looking File | Install New Font dialog. Both ways seemed to work fine and made the font available to my other IDEs, but there is no change in my LabWindows/CVI editor. I am on LabWindows/CVI 9, but also tried with the evaluation version of 8.5.
Next I located the registry string FontNameSourceWindow and changed it manually to 'ProggyCleanSZBP' there. This caused it to show up in the font preferences of the LabWindows/CVI system, but as 'ProggyCleanSZBP - (not found)'.
Am I missing a step here? Is this the same font you tested? Now it seems that I can't get to www.proggyfonts.com, so I may have to wait until later if I should have tried a different font instead.
Thanks for your assistance!!
12-11-2008 02:11 PM
Hey Luke,
It sounds like you've followed the exact same steps with the exact same font that I used. Have you tried restarting your computer after reinstalling the font? I
tried this on yet another computer with both CVI 9.0 as well as 8.5 and
we still had no issues. Are you having the same problems with other
monospaced fonts? If it is just this font that is acting up then
perhaps we can find a similar font that would work.
Lars
12-11-2008 02:57 PM
I figured it out!
I maintain programs written in Japan that need to be modified for our US systems. As such, I typically use Windows XP with my default non-Unicode system language set to Japanese. Otherwise, Japanese text in comments in the source code show up just as boxes.
When I am in Japanese-language mode I only have a dozen or so monospaced fonts available. But, I just now switched to English and have a *ton* of them, including my favorite Proggy! But...the solution is no good...I *have* to run in Japanese mode to do my job. 😞
I'd love to beta test a fix for this! 🙂 There must be some language check done against the fonts, and whatever ones do not overtly support the current system language must be disallowed. Just a guess.
Any ideas on how I can get this to work when I switch back to Japanese mode? I'll try setting it now and hope it stays...
12-12-2008 07:35 AM
It works!! I'm back in Japanese text mode and it still says that ProggyCleanSZBP is the current font for the source editor! But, going into another section to change the font still does *NOT* show the Proggy font as being available. So...looks like I just need to go into English mode and set all the fonts the way I want them! 🙂
It would be nice from a program standpoint to find out exactly why they are not shown normally and address that, since lots of other persons may run into this as well. But, this is definitely a workaround that is successful! Hope this helps someone else too!
Thanks for your help, Lars_L!! I appreciate you testing this because it proved to me that it was possible! 🙂
12-12-2008 11:38 AM
Hi Luke,
I just wanted to confirm what you've already guessed to be the case. In the CVI font browsing dialog, only fonts that support the current language are displayed. However, you did find an ingenious way to specify the font that you wanted anyway, and once you've managed to tell CVI that that was the font you wanted, CVI will still try to honor it, in spite of the language issue.
If you were trying to select a font for a UI control, you could get around this by changing the character set of the control in the UI Editor. But unfortunately, you can't do that for the source window.
If you run into this again in the future, you have an alternative to having to switch to English so that you can pick the font you want: you can go to the system registry, when CVI isn't running, and specify the font you want, in the following location:
[HKEY_CURRENT_USER\Software\National Instruments\CVI\9.0\Environment]:FontNameSourceWindow
Luis
12-12-2008 12:16 PM
I initially was excited when I located the registry strings you are referring to, imagining that they would do exactly what you say. Unfortunately, whatever I set there seems to be totally ignored by the LabWindows/CVI program! For instance, I just now tried changing FontNameSourceWindow to Consolas. When I open the program, it remains what it had been set to previously: ProggyCleanSZBP. Same thing with Times New Roman--no change at all.
I imagine from this that the program is remembering the fonts somewhere additional to this registry location. Strange. But, I'm happy for now!
As a side note, I notice that I can use ProggyCleanSZBP in notepad (for instance) to enter English, Japanese, and French-accented characters. However, when I try those three languages in LabWindows/CVI's source window only English and French work correctly. The IME for Japanese shows the characters I type, but when it places them in the source window they are converted into two single-byte characters. The same is now true with existing Japanese text in my source files. Am I to assume that the LabWindows/CVI is not fully unicode aware or at least not totally double-byte aware? If I revert to one of the specific Japanese fonts from Microsoft (MS Gothic, MS Mincho) then Japanese text is displayed correctly. This also is true in other windows, such as the watch window. I can live without the Japanese text right now, but it would be a nice feature in the future to be fully double-byte aware.
Just a suggestion! Thanks!! 🙂
12-14-2008 12:01 PM
Oops, I apologize. I had forgotten that there was another registry key that, for legacy reasons, you also have to change:
[HKEY_CURRENT_USER\Software\National Instruments\CVI\8.5\SourceFont]:Name
Sorry about that!
As far as entering Japanese text in CVI is concerned, CVI does not support Unicode, but it is in fact multi-byte aware. When you use the other Microsoft fonts to display Japanese text in CVI, that works because those fonts support the Shift-JIS character set encoding, which basically means that they support multi-byte Japanese text. I don't really know the particulars of ProggyCleanSZBP, but my guess is that it doesn't support Shift-JIS (which is the same reason that explains why it wasn't showing up in CVI's font selection dialog when you switched from English to Japanese). The fact that you can use it to display Japanese characters in Notepad suggests that this font supports Unicode. I thought it would be unusual for a font that supports Unicode to not also support common international character sets, but I guess it's possible, and that probably explains what you're seeing.
Luis
12-15-2008 06:55 AM
Awesome! Thanks for the registry info...I totally missed that key!
I figured that there might be an issue with the font not supporting Japanese 100%, and honestly, I can live with that. The comments in this source code are really all I am losing, and they consisted mainly of superfluous descriptions, programmer names and dates of changes. None of those things are really critical to my work. 😉
In addition, perhaps Windows is aware of the shortcomings of the font in question and simply substitutes its own Shift-JIS characters when I use the Proggy font in notepad or WDSCi.
In any event, thanks all for your help and kind assistance! I really do appreciate it!!