Export (0) Print
Expand All

SelectFont

Specifies a list of attributes that define the .tinyfnt font to create.

SelectFont "selectionstring"
      
    

Parameters

selectionstring
A quoted string containing comma-delimited fields that indicate the characteristics of the .tinyfnt to create. The fields correspond to fields in the LOGFONT structure and the ENUMLOGFONTEX structure. Each field in selectionstring consists of one of the prefixes below, followed by a string described below:
PrefixName Description
FN:Face Name The typeface name of the font, for instance, Miramonte. If the name includes spaces, this field must be enclosed in quotes, for example, FN:"Miramonte Bold". This field should always be specified to ensure consistent results.
WE:Weight Specifies the weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. This value corresponds to the lfWeight field of the LOGFONT structure. This value is optional, but should be specified to ensure consistent results. If this field is not provided, a normal weight is assumed.
HE:Height Specifies the height, in logical units, of the font's character cell or character. The character height value (also known as the em height) is the character cell height value minus the internal-leading value. For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size.

If this value is greater than 0, the font mapper transforms this value into device units and matches it against the cell height of the available fonts.

If this value is less than 0, the font mapper transforms this value into device units and matches its absolute value against the character height of the available fonts.

This value is optional, but should be specified to ensure consistent results. If not specified, a default height is used.

WI:WidthSpecifies the average width, in logical units, of characters in the font. This value is optional.
ES:Escapement Specifies the angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line of a row of text. A positive escapement value will rotate characters counter-clockwise. For example, ES:300 will rotate characters 30 degrees counter-clockwise. This value is optional.
OR:Orientation Specifies the angle, in tenths of degrees, between each character's base line and the x-axis of the device. This value is optional. If you provide the OR: value, you should set it to be the same as the ES: value.
IT:Italic Specifies an italic font if set to 1. This value is optional.
UN:Underline Specifies an underlined font if set to 1. This value is optional.
CS:Character Set An integer that specifies the character set. This value corresponds to the lfCharset field of the LOGFONT structure. The character set defaults to ANSI if this field is not provided. Make sure that the value of the CS: field matches the character set of the typeface specified in the FN: field. The following table shows possible values:
Character SetValue
ANSI0
Arabic178
Baltic186
Chinese Big5136
Default1
Eastern Europe238
GB2312134
Greek161
Hebrew177
Hangul129
Johab130
Mac77
OEM255
Russian204
Shift JIS128
Symbol2
Thai222
Turkish162
Vietnamese163
OP:Output Precision Specifies the output precision. This value is optional. This value corresponds to the lfOutPrecision field of the LOGFONT structure.
CP:Clip Precision Specifies the clip precision. This value is optional. This value corresponds to the lfClipPrecision field of the LOGFONT structure.
QA:Quality Specifies the quality. This value is optional. This value corresponds to the lfCharset field of the LOGFONT structure.
PF:Pitch and Family Specifies the pitch and family. This field is optional. This value corresponds to the lfPitchAndFamily member of the LOGFONT structure.
FullName:Full Name A string that specifies the full font name, which may include publisher and version information. For example, ABC Font Company TrueType Bold Italic Sans Serif. This value is optional.
Script:Script A string that specifies the character set of the font, for example, Cyrillic. This value is optional.
Style:Style A string that specifies the font style, for example, Bold Italic. This value is optional.

TFConvert searches all TrueType fonts installed on the system, as well as any fonts specified in an AddFontToProcess argument, to find a font that matches the characteristics specified in the selectionstring argument. The .tinyfnt file is generated based on the first match.

A SelectFont statement "selects" the current font that subsequent statements in the .fntdef file refer to. A SelectFont statement must be followed by an ImportRange or ImportRangeAndMap statement that specifies the characters to import from the currently selected font. If any ImportRange or ImportRangeAndMap options appear in a .fntdef file before a font has been selected using a SelectFont statement, TFConvert fails.

Cc506344.note(en-us,MSDN.10).gifNote
The comma-delimited fields in selectionstring may not be preceded by a space. For instance, SelectFont "WE:400,FN:Pericles" is a valid SelectFont option, but SelectFont "WE:400, FN:Pericles" is not.

In the following .fntdef file, the SelectFont statement instructs TFConvert to look for a regular-weight font with the face name "Miramonte". Fonts installed on the system, as well as the font at the path specified in the AddFontToProcess argument, will be considered by TFConvert.
AddFontToProcess C:\SampleFonts\miramo.ttf
SelectFont "WE:400,FN:Miramonte"
#import upper case letters
ImportRange 65 90
    
In the following .fntdef file, the SelectFont statement instructs TFConvert to look for a bold-weight font of height 12, with the face name "Miramonte Bold". Note that the font name in the FN: field must be enclosed in quotes because it contains a space.
AddFontToProcess C:\SampleFonts\miramob.ttf
SelectFont "HE:12,WE:700,FN:"Miramonte Bold""
#import upper case letters
ImportRange 65 90
    

Available in .NET Micro Framework version 2.0

Show:
© 2014 Microsoft