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

Last reviewed: June 21, 1995
Article ID: Q84483
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 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 reference words: 1.00 2.00 3.00 3.10
KBCategory: kbenv kbprg kbprb
KBSubcategory: EnvtDes


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.