| 1 |
Several formats for bitmap only sfnts |
| 2 |
===================================== |
| 3 |
|
| 4 |
:small:`(the file type which holds a truetype or opentype font)` |
| 5 |
|
| 6 |
Unfortunately every system has its own way of storing bitmap only fonts into an |
| 7 |
sfnt wrapper (or the system just doesn't support it) |
| 8 |
|
| 9 |
|
| 10 |
.. _bitmaponlysfnt.Apple: |
| 11 |
|
| 12 |
Apple |
| 13 |
----- |
| 14 |
|
| 15 |
Apple documents the existence of a bitmap only format, and gives some hints |
| 16 |
about the requirements of it. Their documentation is far from complete and the |
| 17 |
following is determined in part by that documentation, in part by examining the |
| 18 |
(few) bitmap only fonts of theirs I have found, and in part by error messages |
| 19 |
given by some of their tools. |
| 20 |
|
| 21 |
* As is expected on Apple, the bitmap data reside in '`bloc`_' and '`bdat`_' tables. |
| 22 |
|
| 23 |
(These are identical in format to the '`EBLC`_' and '`EBDT`_' tables used in |
| 24 |
OpenType) |
| 25 |
* The '`head <https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6head.html>`__' |
| 26 |
table is replaced by a '`bhed`_' table which is byte for byte identical |
| 27 |
* There are no '`glyf`_', '`loca`_' nor '``CFF`` ' tables. |
| 28 |
* There are no '``hhea``' nor '``hmtx``' tables (metrics data are provided in |
| 29 |
the bitmap strikes themselves) |
| 30 |
* (Presumably there are no '``vhea``' nor '``vmtx``' tables either) |
| 31 |
* '`maxp <https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6maxp.html>`__'. |
| 32 |
``numGlyphs`` is set to the number of bitmap glyphs |
| 33 |
|
| 34 |
|
| 35 |
.. _bitmaponlysfnt.X11: |
| 36 |
|
| 37 |
X11 (Unix/Linux) |
| 38 |
---------------- |
| 39 |
|
| 40 |
The X consortium have devised their own format which they call "OpenType Bitmap" |
| 41 |
with extension .otb. |
| 42 |
|
| 43 |
* The bitmap data reside in '`EBLC`_' and '`EBDT`_' tables. |
| 44 |
* There is a zero length '`glyf`_' table |
| 45 |
* There is a '`loca`_' table with one entry in it |
| 46 |
* There is a '`head`_' table (not a '``bhed``') |
| 47 |
* '`maxp`_'. ``numGlyphs`` is set to the number of bitmap glyphs, not to the |
| 48 |
size of the '`loca`_' table |
| 49 |
|
| 50 |
-------------------------------------------------------------------------------- |
| 51 |
|
| 52 |
* The fonts I generate also contain the metrics tables as appropriate |
| 53 |
|
| 54 |
|
| 55 |
.. _bitmaponlysfnt.MS: |
| 56 |
|
| 57 |
MS |
| 58 |
-- |
| 59 |
|
| 60 |
MicroSoft Windows provides no support for a bitmap only sfnt. So I have created |
| 61 |
a faked up format which should work in most cases |
| 62 |
|
| 63 |
* The bitmap data reside in '`EBLC`_' and '`EBDT`_' tables. |
| 64 |
* There are '`glyf`_' / '`loca`_' tables with entries for every glyph. If used |
| 65 |
the entries will produce blank glyphs (spaces). |
| 66 |
* There is an '`EBSC`_' table which maps common pixel sizes to the supplied |
| 67 |
pixel sizes. (so if a user asked for a 20 pixel strike s/he might get an 18 |
| 68 |
pixel strike -- as opposed to getting a set of blanks. |
| 69 |
* There is a '`head`_' table (not a '``bhed``') |
| 70 |
* Since these fonts try to look like scalable fonts (to MS anyway) they contain |
| 71 |
metrics tables. |
| 72 |
|
| 73 |
.. _bloc: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bloc.html |
| 74 |
.. _bdat: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bdat.html |
| 75 |
.. _EBLC: https://docs.microsoft.com/en-us/typography/opentype/spec/eblc |
| 76 |
.. _EBDT: https://docs.microsoft.com/en-us/typography/opentype/spec/ebdt |
| 77 |
.. _bhed: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bhed.html |
| 78 |
.. _glyf: https://docs.microsoft.com/en-us/typography/opentype/spec/glyf |
| 79 |
.. _loca: https://docs.microsoft.com/en-us/typography/opentype/spec/loca |
| 80 |
.. _EBSC: https://docs.microsoft.com/en-us/typography/opentype/spec/ebsc |
| 81 |
.. _maxp: https://docs.microsoft.com/en-us/typography/opentype/spec/maxp |
| 82 |
.. _head: https://docs.microsoft.com/en-us/typography/opentype/spec/head |