Changing Text Font for Macintosh QuickBasic Listing Window (33042)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0
  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0a
  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0b

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 "n" 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 "proportional" 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 "Microsoft QuickBasic for Apple Macintosh: Language Reference." (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.

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

    1. Double-click System Folder.
    2. Double-click System.
  3. You will see a list of resource names. Double-click FONT.
  4. 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.
  5. From the Edit menu, choose Copy.
  6. 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.
  7. Open the QuickBasic application. You can do this by following these steps:

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

Modification Type:MajorLast Reviewed:10/23/2003
Keywords:KB33042