Multivalues describing a font pattern.

OLE control Font properties follow the same format as FONT properties in OpenInsight. The multivalue font structure is @SVM delimited and has the following structure:

POSNameTypeDescription
<1, 1, 1>NameTextThe face name of the font, e.g., "Arial"
<1, 1, 2>HeightIntegerPositive point size value or negative GDI value
<1, 1, 3>WeightIntegerThe font's weight: 400 for normal or 700 for bold
<1, 1, 4>ItalicBooleanTrue for italic text
<1, 1, 5>UnderlineBooleanTrue for underlined text
<1, 1, 6>WidthIntegerThe font's average character width (usually 0)
<1, 1, 7>Character SetIntegerThe font's character set (usually 0)
<1, 1, 8>Pitch and FamilyIntegerThe font's pitch and family (usually 24)
<1, 1, 9>StrikethroughBooleanTrue for strikethrough text
<1, 1, 10>Out PrecisionIntegerThe font' output precision. (usually 0)
<1, 1, 11>Clip PrecisionIntegerThe font' clipping precision. (usually 0)
<1, 1, 12>QualityIntegerThe font's output quality. (usually 0)

For more information, see Microsoft's documentation regarding the C/C++ LOGFONT structure.

There are two differences in the way OLE controls process the font structure. First, blank sub-values are interpreted as "leave alone," i.e., you can pass data to only those elements you wish to change. For example, the following code only changes the font's weight to bold (700).

// Set the current font to bold 
Set_Property(@Window:".OLE_CTRL", "OLE.Font", @SVM:@SVM:700)


The second difference has to do with setting the font's height. Normally, the font's height is set in "logical units," a Microsoft convention. A positive value in this field says you want some space between lines of text while a negative value means you want to use a specific "logical" height. However, OI developers usually only care about point size. We like to say, "Arial, 8 pt." -- not, "Arial, -11". Therefore, OLE controls will treat positive values as point sizes. So you can set an OLE control's font size to 8 pt. in two ways:

// Set the current font to 8 pt. 
Set_Property(@Window:".OLE_CTRL", "OLE.Font", @SVM:8) 
Set_Property(@Window:".OLE_CTRL", "OLE.Font", @SVM:-11)

See Also

Multivalue

  • No labels