-
Notifications
You must be signed in to change notification settings - Fork 64
Architecture Fonts
LinApple implements a dual font system to manage both the historically accurate Apple II text display and the modern, high-resolution user interface (debugger, file browser).
The fonts used by the virtual Apple II to render text and lo-res graphics modes are strictly emulated as bitmapped character ROMs.
LinApple provides multiple character sets depending on the machine type and region:
-
charset40_IIplus.xpm: The original 128x128 bitmap for the Apple ][ and ][+, featuring the classic upper-case-only font. -
charset40.xpm: The standard US character set for the Apple //e and Enhanced //e, supporting lower-case characters. -
International Sets:
charset40_british,charset40_french, andcharset40_germanare used when the keyboard language is changed.
European Apple //e models featured a physical "rocker switch" that could swap between the US and local character sets.
- Bitmapped Implementation: Euro-ROM character sets are 256x128 pixels. The top 128 pixels contain the US set, and the bottom 128 pixels contain the localized set.
-
LinApple Toggle (
Shift+F6): This shortcut toggles theg_KeyboardRockerSwitchflag, causing the video core to offset its font lookup into the bottom half of the bitmap.
The video core (src/apple2/Video.cpp) synthesizes text in real-time:
-
Scanner Lookup: The video scanner reads a byte from memory (e.g.,
$0400). -
Soft-Switch Check: The core checks if
ALTCHARSETis enabled and which language bank is active. -
Bit Blitting: The scanner uses
SOFTSTRECH_MONOto blit the 7x8 character glyph from the loaded XPM into the output pixel buffer.
The debugger, status area, and file browser use a separate, higher-resolution font system to ensure legibility outside of the 40-column emulation.
The UI font is a 256x256 XPM bitmap loaded by the Asset Manager (src/core/asset.cpp) into assets->font.
- Formatting: The font is a monospaced grid where each character is indexed by its ASCII value.
-
Rendering: Tier 1 utilities like
font_printandfont_print_centered(src/frontends/sdl3/Frame.cpp) use this bitmap to draw text over the emulator screen or in the debugger window.
-
Colorization: The UI font is stored as a monochrome mask. The
font_printutility applies a color (e.g., Green for the debugger, White for help screens) during the blitting process. - Scaling: Tier 1 can apply scaling factors to the UI font, allowing for "Headline" text (1.5x scale) or standard status text.
-
Tier 4 (Hardware): Manages the
charset40selection and real-time blitting for Apple II text modes. -
Tier 1 (User I/O): Uses the
font.xpmasset to draw the emulator's own menus and status overlays. -
Asset Manager: Coordinates the loading of these bitmaps from the host file system during
Linapple_Init.
Architecture
- Architecture-Overview
- Architecture-Debugger
- Architecture-Fonts
- Tier 1
- Tier 2
- Tier 3
- Tier 4