Microsoft KB Archive/33042

= Changing Text Font for Macintosh QuickBasic Listing Window =

Article ID: 33042

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for Macintosh 1.0
 * Microsoft QuickBasic Compiler for Macintosh 1.0
 * Microsoft QuickBasic Compiler for Macintosh 1.0

-



This article was previously published under Q33042



SUMMARY
The default text font for the Listing window in Microsoft QuickBasic for Macintosh is the default System application font, which is Geneva, size 12, and Face 0 (plain text).

To change the text font used in the QuickBasic editing window, you can type the following statement in the Command window, where &quot;n&quot; is the family number of a currently installed System font [such as 0 = Chicago (the default System font), 4 = Monaco]: POKEW &H984,n To see the new font, you must refresh the Listing window (by pressing COMMAND+L or by choosing List from the Windows menu). The specified font is active only for the current session and is not carried over when another program is sublaunched. The font also displays when you send the source listing to the printer by choosing Print from the File menu, letting you fit in more lines per printed page (depending upon the font).

You can also change the font in QuickBasic's Listing window by modifying QuickBasic's font resource as described further below.

This is not an official feature of QuickBasic. This information is provided as is, and no performance guarantees are implied for current or future versions.

This information applies to Microsoft QuickBasic for Apple Macintosh versions 1.0, 1.0a, and 1.0b.



MORE INFORMATION
You can access only font numbers that are currently installed in your Macintosh System file. If a font number is not installed, then Geneva, the default application font, is displayed. You can use Apple's Font/DA Mover program to add more fonts to your Macintosh System file. The Font/DA Mover program and additional fonts are distributed on Apple System disks (not shipped with QuickBasic).

If you want columns to line up in your source listing, you can use Monaco (4) or Courier (22) font, but note that bold reserved words will still be wider than nonbold characters and will throw off alignment accordingly.

As an alternative to the QuickBasic editor, if you want a different text font (and size) for editing the source code, you can use Apple's Edit program that is included on the QuickBasic distribution disk in the Tools folder.

The default font for Apple's Edit program is Monaco, but once the program is loaded, the font and size can be changed by menu options. The Monaco font is useful if you want columns of characters in the source code to line up in the editing window.

Most fonts other than Monaco or Courier are &quot;proportional&quot; fonts, which look more attractive but have different character widths. Columns of characters do not line up in proportional fonts.

A disadvantage of editing in Apple's Edit program is that you cannot quickly run the program to locate syntax errors the way you can in the QuickBasic editor.

Font numbers that are accessible from QuickBasic are listed on page 397 of &quot;Microsoft QuickBasic for Apple Macintosh: Language Reference.&quot; (Correction for page 397: Courier should be 22, and Helvetica 21.)

Note: You can call the following routines from a running program to change text characteristics sent to the program's output window:   TEXTFONT TEXTSIZE TEXTFACE TEXTMODE These routines do not affect the Listing window in QuickBasic's editor; they affect only the output window at run time.

How to Change QuickBasic's Listing Font by Modifying Font Resource
You can also change the text font used in the QuickBasic Listing window by modifying QuickBasic's font resource with ResEdit. By following the steps below, you can substitute any font for Geneva 12, the font used by QuickBasic. WARNING: always keep backup copies of QuickBasic before modifying its resources.

 Launch ResEdit. ResEdit is supplied on the distribution disk titled Examples in the folder named Tools. Open the System file on your boot disk. You can do this by following these steps:

 Double-click System Folder. Double-click System.  You will see a list of resource names. Double-click FONT.</li> You will see a list titled Fonts From System that contains all available fonts in each available point size. Select the font and point size you want to use in the QuickBasic Listing window.</li> From the Edit menu, choose Copy.</li> Close the top three window boxes so that ResEdit appears as it did when you first launched it. You should see one box with your hard disk name as the title.</li> Open the QuickBasic application. You can do this by following these steps:

 Double-click on the folder in which QuickBasic is located.</li> Double-click on Microsoft QuickBasic (b) or Microsoft QuickBasic (d).</li></ol> </li> From the File menu, choose New. A dialog box asks you for a resource name. Type FONT (in uppercase) and click OK.</li> From the Edit menu, choose Paste.</li> Select the font that appears in the box titled Fonts from Microsoft QuickBasic.</li> From the File menu, choose Get Info.</li> In the box to the right of the label ID:, change the number to 396, the ID number for Geneva 12.</li> From the File menu, choose Quit.</li></ol>

Additional query words: MQuickB 1.00 1.00a 1.00b

Keywords: KB33042

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.