Build Options: Supply Font Information
The Supply Font Information build options, accessed by clicking the Supply Fonts tab on the Build Options window, allow you to provide Font properties to forms and controls that use VB's default font (and hence have no font information recorded in their form files). As of VBLM4, it also allows you to overwrite existing fonts.
VBLM's ability to supply font information was designed originally to save time and tedium for users translating their apps across character sets, and it still does: see Translating Across Character Sets for an overview of the problem it solves. As of V4, though, these capabilities have been expanded to allow you to manipulate font information for any reason.
When the Supply Font Information option is checked on the main tab of the Build Options window, VBLM supplies font information as it performs a build. The Supply Fonts NOW command button allows you to supply font information independent of the build process. When you click Supply Fonts Now, VBLM:
Checks that you've entered valid font information to supply;
Pops up a dialog box and asks you to specify a MAK/VBP file, and
Rewrites all control-containing files referenced in the MAK/VBP file, supplying the font properties that you've specified to the controls you've specified: all controls not on the Controls that should NOT be supplied ... list that do or don't already have font properties (see below).
Note: When VBLM supplies font properties, it overwrites the files in place. Please be certain that this is what you intend to do!
Font Name to Supply
The entry in this textbox will be supplied as the FontName property to VB3 projects and the Name property of Font objects in VB4+ projects. Either type your entry or click the icon and select a font using the dialog box that pops up. Note that using the dialog will also set the font size and font bold properties below.
Note: VBLM will not let you check the Supply Font Information box on the main page when the font name is blank. It will, however, let you click Supply Fonts Now. If you select All Fonts (Overwrite Existing) as the fonts to supply (see below), and supply a blank font name, VBLM will remove all font properties from the project.
Font Size to Supply
Any entry in this textbox will be supplied as the FontSize property to VB3 projects and the Size property of Font objects in VB4+ projects. If left blank, VBLM won't supply a FontSize/Size property, and if overwriting existing fonts will retain the existing size. Either type your entry or use the Font Name dialog box.
Font Charset to Supply
Any entry in this textbox will be supplied as the Charset property of Font objects in VB4+ projects. If left blank, VBLM won't supply a Charset property, and if overwriting existing fonts will retain the existing charset. Note that the Font Name dialog box has no effect on this field. You will need to enter a value here when translating across character sets; the Japanese ShiftJIS charset, for example, is 128, Hangeul for Korean is 129, traditional Chinese is 136 and simplified Chinese is 134. See Font, Display and Print Considerations in a DBCS Environment, in the International Issues section of the VB6 Programmer's Guide, for more info.
If you've spent much time examining form definitions, you may have noticed that sometimes - not always, not even often, but sometimes -- VB appends a GUID to the first line of font entries, so that instead of reading
BeginProperty Font
it reads
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
This is the CLSID of the 32 bit StandardFont object, and whether it gets written or not appears to depend on the control class; some controls write it, others don't. And interestingly, you can manually add it to controls that don't write it and remove it from controls that do and it doesn't appear to make any difference in the appearance or behavior of the control at runtime. So previous versions of VBLM, and V6 by default, do not include it when supplying font info.
However, I finally did run across a situation where it appeared to make a difference, a case where a user was crossing character sets and supplying a Chinese font to her project. The font did not display properly when supplied by VBLM, but it did when set manually, and only difference was the GUID; add it, and it worked. So as of V6, VBLM gives you a choice when supplying font info: don't append a GUID, append the 32 bit StandardFont GUID by selecting it from the list, or append whatever GUID you want, by entering it in the combo box.
Font Bold (Weight)
The entry in this combobox will be supplied as the FontBold property to VB3 projects and the Weight property of Font objects in VB4+ projects. Either type your entry or use the Font Name dialog box. Note that the dialog won't change the combobox setting if it is set to Don't Supply FontBold Info, but will change it if it set to True or False. If set to Don't Supply FontBold Info and overwriting existing fonts, VBLM will retain existing bold/weight settings.
Supply Which Fonts?
When this combobox is set to the default Supply Missing Fonts Only setting, VBLM only provides font information to controls that lack it, and doesn't touch controls that already have font properties set. When set to All Fonts (Overwrite Existing), VBLM replaces existing font properties with those specified (but preserves all existing font properties not specified).
Overwritten Font Info
Configure VBLM to either comment out or remove overwritten font info.
Controls that should NOT be supplied with FontName
There are two reasons why control definitions recorded in form files don't include font properties. The first is that the control uses VB's default font. The second is that the underlying control class -- the Timer, for example -- doesn't support font properties. We want VBLM to supply FontNames in the first case, but not in the second.
VBLM makes the distinction by referring to this list of controls that don't support font properties, and provides font information to controls that lack it only if the control class is NOT on the list. By default, the list contains all control classes supplied with VB3-5 Professional that don't support fonts.
If you use additional custom controls that don't support fonts, you may want to put them on the list (the list is displayed in a pseudo-listbox, which you maintain by direct editing). The accuracy of the list is not critical, however -- in fact the list itself is technically unnecessary -- because when VB encounters invalid properties while loading forms, it issues a warning, logs the error, discards the property, and moves on. The warnings are annoying, nothing else.
The Parse Command
See pseudo-listboxes.
See Also: Dealing with Default Fonts