08-13-2010 12:04 PM
Hi,
Is it possible to apply two different fonts to one string, or use symbols amongst normal font? My purpose is to display an Omega symbol after some number.
".99982 Ω" or "-180 φ"
I am using version 6.0,
Thanks in advance!
Solved! Go to Solution.
08-15-2010 03:41 PM
It's not possible to use differnt fonts in the same text control (string, text message, text box, listbox...) or in the label for any control.
An alternative solution can be to use a font that natively includes the letters / symbols you need. Within CVI 6 native fonts you can use NISystemMetaFont which includes uppercase omega letter together with other commonly used greek letters (and uppercase / lowercase alphabet and numbers, of course ).
In charmap the font is seen as NISYSTEM: with that program you can see all characters included in the font file and select / copy each of them to paste in CVI controls if you need it.
08-16-2010 07:39 AM - edited 08-16-2010 07:41 AM
In addition to being able to use charmap to cut and paste, charmap also shows the codes you can use to programmatically create the character. For example, with the NISYSTEM font loaded into charmap (as suggested by Roberto), when you point to the omega character, charmap displays "U + 00EA". "U" indicates that it is a Unicode font. With a Unicode font loaded, you can use the escape sequence \xea for the omega character.
For example:
char myString[80];
double ohmsReading = 3.14;
// ...
SetCtrlAttribute (panelHandle, PANEL_STRING, ATTR_TEXT_FONT,
"NISYSTEM");
sprintf(myString, "%f \xea", ohmsReading);
SetCtrlAttribute (panelHandle, PANEL_STRING, ATTR_CTRL_VAL, myString);
// ...
Use your own appropriate names for panelHandle, PANEL_STRING, etc.
P.S. To run the charmap character viewer, on the Windows toolbar click on Start >> Run, then enter charmap. Use the drop-down box labeled Font to select your font.