-
Notifications
You must be signed in to change notification settings - Fork 11
PC‐GEOS (GeoWorks, BreadBox) fonts
Rob Hagemans edited this page Jul 4, 2024
·
1 revision
The file starts with a FontFileInfo structure
00 FFI_signature char * 4 ;"BSWF"
04 FFI_minorVer byte ;minor version (0)
05 FFI_majorVer byte ;major version (1)
06 FFI_headerSize word ;size of font info section
followed by a FontInfo structure, without fileHandle.
The pointers in this structure are form the start of the structure; add 8 to get a pointer form the start of the file.
08 FI_fontID word ;font ID
0a FI_maker word (0 for bitmap) ;font manufacturer ID
0c FI_family FontAttrs (flags byte) ;font family, etc.
0d FI_faceName char * 20 ;typeface name
21 FI_pointSizeTab word (0x23) ;start of table of point sizes
23 FI_pointSizeEnd word ;end of bitmap faces
25 FI_outlineTab word (0) ;start of outline table
27 FI_outlineEnd word (0) ;end of outline faces
following 2 "only for DBCS_PCGEOS" which seems False:
29 FI_firstChar char (0?) ;first char included
2a FI_lastChar char (0?) ;last char included
2b first point size table entry (at 0x23 + 8) (or at 2a? 0x23 +7?)
PointSizeEntry (10 bytes)
2a PSE_style TextStyle (byte flags; 0?) ;style of face
2b PSE_pointSize sbyte ;integer point size <128
2c PSE_dataSize word ;size of data
2e PSE_filePosLo word ;position in file
30 PSE_filePosHi word (0?) ;position in file
next entry at 0x34 so we need another word ?
32 unknown word
the fileposhi and fileposlo appear to be relative to start of file
at the pointed-to location (dec 91, which is also pointsizeend + 6 ??) we have another table - unknown
FontBuf?
FontBuf struct
FB_dataSize word ; actual size of data (bytes)
FB_maker FontMaker (word) ; manufacturer ID
FB_avgwidth WBFixed ; average character width
FB_maxwidth WBFixed ; width of widest character
FB_heightAdjust WBFixed ; offset to top of font box
FB_height WBFixed ; height of characters
FB_accent WBFixed ; height of accent portion.
FB_mean WBFixed ; top of lower case character boxes.
FB_baseAdjust WBFixed ; offset to top of ascent
FB_baselinePos WBFixed ; position of baseline from top of font
FB_descent WBFixed ; maximum descent (from baseline)
FB_extLeading WBFixed ; recommended external leading
; line spacing = FB_height +
; FB_extLeading +
; FB_heightAdjust
FB_kernCount word ; number of kerning pairs
FB_kernPairPtr nptr.KernPair ; offset to kerning pair table
FB_kernValuePtr nptr.BBFixed ; offset to kerning value table
if DBCS_PCGEOS
FB_firstChar Chars ; first char in section
FB_lastChar Chars ; last char in section
FB_defaultChar Chars ; default character
else
FB_firstChar byte ; first char defined
FB_lastChar byte ; last char defined
FB_defaultChar byte ; default character
endif
FB_underPos WBFixed ; underline position (from baseline)
FB_underThickness WBFixed ; underline thickness
FB_strikePos WBFixed ; position of the strike-thru
FB_aboveBox WBFixed ; maximum above font box
FB_belowBox WBFixed ; maximum below font box
; Bounds are signed integers, in device coords, and are
; measured from the upper left of the font box where
; character drawing starts from.
FB_minLSB sword ; minimum left side bearing
FB_minTSB sword ; minimum top side bound
if not DBCS_PCGEOS
FB_maxBSB sword ; maximum bottom side bound
FB_maxRSB sword ; maximum right side bound
endif
FB_pixHeight word ; height of font (invalid for rotation)
FB_flags FontBufFlags ; special flags
FB_heapCount word ; usage counter for this font
FB_charTable CharTableEntry <>
FontBuf ends
then we have a table of CharTableEntry (8 bytes) starting at hex a2 (maybe)
a2 CTE_dataOffset nptr.CharData (word?) ;Offset to data
CTE_width WBFixed (word byte fixed-point?) ;character width
CTE_flags CharTableFlags (byte flags?) ;flags
CTE_usage word ;LRU count
first pointer is 0747; first char is space at 07a2, a diff of dec 91
other pointers seem to make sense if we add 91 (the start of the FontBuf table)
character definitions then take the form of a CharData struct
07a2, 07a7 CD_pictureWidth byte ;width of picture data in bits
CD_numRows byte ;number of rows of data
CD_yoff sbyte ;(signed) offset to first row
CD_xoff sbyte ;(signed) offset to first column
CD_data byte ;data for character
(though 0 rows of data for space is interpreted as 1?? as the next char starts at +5))