Macintosh: Changing Font Size in Menu Bars


At the end of this article is the MPW Assembly source code for an Init file
that, when placed in the System Folder, modifies three low memory globals at
startup.

The Init changes the System font from Chicago 12 to Chicago 14, the largest
font that doesn't cause distortion in dialogs and buttons. (You must, of
course, have Chicago 14 installed in the System file.) Menu bars and window
title bars will change in size based on the values you supply.

Warnings: This method of changing the size of the system font is not
recommended, but is the easiest way to change the font size of the menu
bar with existing System files. The Init has been tested with few
applications, but may not work with all programs. It makes direct calls to
hardware locations and may not work with future versions of hardware or of
system software.

For more information, see:
- the Font Manager Chapter of Inside Macintosh, volume III
- the Menu Manger Chapter of Inside Macintosh, volume V

Here is the source code for the ChangeFont Init:

; Source for an Init that will change the system default menu bar size to other
; than chicago 12 point. By Jim Mensch
; Note: you can use ResEdit to change the Font/size without recompiling
;
Main Proc Export
OPT NONE ; Turns off code optimization
lea $BA6,A0 ; Load address of system font number
lea $BA8,A1 ; Load address of system font size
Move.W #$00,(A0) ; Store my font number into sysFont ( 0 is
; Chicago )
Move.W #$0E,(A1) ; Store the new Font Size
lea $BAA,A0 ; Load in the MBar Heigth address
Move.W #$16,(A0) ; Adjust it for 14 pt NOTE: you must do this in
; order to make the finder adjust at boot time
; This value must be computed for each
; font/size pair you want to use. To easily
; get this number use macsbug to change the
; Font/Size and do an Exit to Shell. This will
; cause the address BAA to be recomputed
; {Because it calls InitMenus}
rts
end
;
; MPW assemble and link instructions for this init
; asm ChangeFont.a
; link -o ChangeFont -rt INIT=0 -c ZSYS -t INIT ChangeFont.a.o
; DumpCode -rt INIT=0 ChangeFont
;
; File: ChangeFont, Resource 0, Type: INIT, Name: Main
; 000000: 41F8 0BA6 'A...' LEA $0BA6,A0
; 000004: 43F8 0BA8 'C...' LEA $0BA8,A1
; 000008: 30BC 0000 '0...' MOVE.W #$0000,(A0)
; 00000C: 32BC 000E '2...' MOVE.W #$000E,(A1)
; 000010: 41F8 0BAA 'A...' LEA $0BAA,A0
; 000014: 30BC 0016 '0...' MOVE.W #$0016,(A0)
; 000018: 4E75 'Nu' RTS
;


Published Date: Feb 18, 2012