amiga-bootcamp/11_libraries/diskfont.md
Ilia Sharin 21751c0025 docs(amiga): complete AmigaOS 3.1/3.2 developer reference — 172 files across 17 sections
Comprehensive technical documentation covering:
- Hardware: OCS/ECS/AGA custom chip registers, Copper & Blitter deep dives
- Boot sequence: cold boot through startup-sequence
- Binary format: HUNK executable spec, relocation, debug info
- Linking & ABI: .fd files, LVO tables, register calling conventions
- Exec kernel: tasks, interrupts, memory, signals, semaphores
- AmigaDOS: file I/O, FFS/OFS layout, CLI/Shell scripting
- Graphics: planar bitmaps, Copper programming, HAM/EHB modes
- Intuition: screens, windows, IDCMP, BOOPSI
- Devices: trackdisk, SCSI, serial, timer, audio, keyboard
- Libraries: utility, expansion, IFFParse, locale, ARexx
- Networking: bsdsocket API, SANA-II, TCP/IP stack comparison
- Toolchain: GCC, vasm/vlink, SAS/C, NDK, debugging
- Reverse engineering: IDA/Ghidra setup, compiler fingerprints, case studies
- CPU & MMU: 68040/060 emulation libs, PMMU, cache management
- Driver development: SANA-II, Picasso96/RTG, AHI audio

All files include breadcrumb navigation. No local paths or proprietary content.
2026-04-23 12:17:35 -04:00

57 lines
1.2 KiB
Markdown

[← Home](../README.md) · [Libraries](README.md)
# diskfont.library — Disk-Based Fonts
## Overview
`diskfont.library` loads bitmap fonts from disk (the `FONTS:` assign). ROM fonts (topaz 8, topaz 9) are always available; all others require this library.
---
## Loading a Disk Font
```c
struct Library *DiskfontBase = OpenLibrary("diskfont.library", 0);
struct TextAttr ta = {"helvetica.font", 24, 0, 0};
struct TextFont *font = OpenDiskFont(&ta);
if (font) {
SetFont(rp, font);
/* ... render ... */
CloseFont(font);
}
CloseLibrary(DiskfontBase);
```
---
## Font Directory Structure
```
FONTS:
helvetica.font ← font descriptor file
helvetica/
24 ← bitmap data for size 24
11 ← bitmap data for size 11
```
---
## Listing Available Fonts
```c
struct List *fontList = NULL;
LONG count = AvailFonts(buf, bufsize, AFF_DISK | AFF_MEMORY);
struct AvailFontsHeader *afh = (struct AvailFontsHeader *)buf;
struct AvailFonts *af = (struct AvailFonts *)&afh[1];
for (int i = 0; i < afh->afh_NumEntries; i++) {
Printf("%s %ld\n", af[i].af_Attr.ta_Name, af[i].af_Attr.ta_YSize);
}
```
---
## References
- NDK39: `diskfont/diskfont.h`