PRB: VB Uses Bitmap Fonts When TrueType FontSize < 7 Points

ID: Q84483


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, versions 2.0, 3.0
  • Microsoft Visual Basic programming system for Windows, version 1.0


SYMPTOMS

The Microsoft Windows version 3.1 operating environment provides you with TrueType scalable fonts that can be used in Microsoft Visual Basic for Windows applications. Visual Basic for Windows supports TrueType fonts for font sizes of 7 points or greater -- depending on the video driver installed. Smaller fonts are mapped to available bitmap fonts, based on the fonts available for the video driver installed.


CAUSE

This is not a problem with Visual Basic for Windows. This is how Windows manages fonts. This is expected behavior in Windows when using TrueType fonts that are less than 7 points in size.


STATUS

This behavior is by design. There is no way to force Visual Basic for Windows to use TrueType fonts for font sizes less than 7 points.


MORE INFORMATION

Microsoft Windows version 3.1 uses automatic bitmap font substitution, which is done to preserve readability at small sizes. At very small point sizes (4 to 7 points on standard VGA video resolutions), most Type 2 fonts are substituted with a hand-tuned bitmap font to preserve readability. This can cause the style of the font to change. For example, the Times New Roman font shipped with Windows version 3.1 appears as the Small Fonts font for sizes 4 - 6 and MS Serif for sizes 6.25 - 8.25, rather than its native face it has at larger sizes.

The program below demonstrates this. The program attempts to print a message using the Arial font in sizes from 1 to 9. Visual Basic for Windows uses the font Small Fonts for font sizes less than 7 and depending on the video driver installed may use Arial for sizes between 7 and 8.25. Using the standard VGA driver, Arial is used for fonts sizes greater then 8.25.

Steps to Reproduce This Behavior

  1. Start a new project in Visual Basic for Windows. Form1 is created by default.


  2. Enter the following code into the Form_Click procedure:
    
       Sub Form_Click ()
          For i = 1 To 9 Step .25
             FontName = "Arial"
             FontSize = i
             Print Str$(i); Chr$(9); Str$(FontSize); Chr$(9); FontName
          Next i
       End Sub 


  3. Press the F5 key to run the program, and click the form. Notice that the Arial TrueType font is used only for font sizes of 8.25 or larger.


Additional query words: 2.00 3.00 3.10

Keywords :
Version : WINDOWS:1.0,2.0,3.0
Platform : WINDOWS
Issue type :


Last Reviewed: January 25, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.