LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ATTR_TEXT_FONT for NI7SegMetaFont

I need someone to double check me to make sure I do not have an OS problem with our systems.  When I run this under CVI 7.1.1 on a WinXP SP2 system it returns
"NI7SEG"  not  the expected "NI7SegMetaFont" in fontName.
 
{
  int hIndicator;
  int fontNameWidth;
  char *fontName=NULL;
  int status;
  // create a numeric indicator
  hIndicator= NewCtrl(panel, CTRL_NUMERIC_LS, "Numeric Ctrl", 10, 10);
  SetCtrlAttribute(panel, hIndicator, ATTR_CTRL_MODE, VAL_INDICATOR);
  SetCtrlAttribute(panel, hIndicator, ATTR_DATA_TYPE, VAL_INTEGER);
  status=SetCtrlAttribute(panel, hIndicator, ATTR_TEXT_FONT,  VAL_7SEG_META_FONT);
  SetCtrlAttribute(panel, hIndicator, ATTR_TEXT_POINT_SIZE, 30);
  SetCtrlAttribute(panel, hIndicator, ATTR_TEXT_JUSTIFY, VAL_RIGHT_JUSTIFIED);
 
  // get the font
  GetCtrlAttribute (panel, hIndicator, ATTR_TEXT_FONT_NAME_LENGTH, &fontNameWidth);
  fontName=malloc((1+fontNameWidth)*sizeof(char));
  status=GetCtrlAttribute (panel, hIndicator, ATTR_TEXT_FONT, fontName);
  // expected "NI7SegMetaFont", but found "NI7SEG"
 
  if(fontName)
     free(fontName);
}
 
Thanks in advance for any insight into what is going on here.
 
0 Kudos
Message 1 of 3
(3,013 Views)
The reason you are getting a different font is because when you change the point size of the control's font, you are changing the criteria that made "NI7Seg" a metafont. A metafont implies not only a typeface ("NI7Seg") but also a size, italics, strikeout, etc. Once you change any of these things, you are still keeping the same typeface, but it is no longer the metafont.
 
If you need it to be a metafont, and you need to it to have a point size of 30, you will have to create your own metafont, using the CreateMetaFont function.
 
Luis
NI
0 Kudos
Message 2 of 3
(3,005 Views)
Thanks for clearing that up for me.  I am not that knowledgeable on font related details.  As usual, learning something new all the time.
I appreciate the answer.
0 Kudos
Message 3 of 3
(2,998 Views)