xref: /dragonfly/contrib/file/magic/Magdir/fonts (revision 3b9cdfa3)
1f72f8299SJan Lentfer
2327e51cbSPeter Avalos#------------------------------------------------------------------------------
3*3b9cdfa3SAntonio Huete Jimenez# $File: fonts,v 1.51 2022/08/16 11:16:39 christos Exp $
4327e51cbSPeter Avalos# fonts:  file(1) magic for font data
5327e51cbSPeter Avalos#
679343712SPeter Avalos0	search/1	FONT		ASCII vfont text
7327e51cbSPeter Avalos0	short		0436		Berkeley vfont data
8327e51cbSPeter Avalos0	short		017001		byte-swapped Berkeley vfont data
9327e51cbSPeter Avalos
10327e51cbSPeter Avalos# PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
11*3b9cdfa3SAntonio Huete Jimenez# Modified by:	Joerg Jenderek
12*3b9cdfa3SAntonio Huete Jimenez# URL:		https://en.wikipedia.org/wiki/PostScript_fonts
13*3b9cdfa3SAntonio Huete Jimenez#		http://fileformats.archiveteam.org/wiki/Adobe_Type_1
14*3b9cdfa3SAntonio Huete Jimenez# Reference:	http://mark0.net/download/triddefs_xml.7z
15*3b9cdfa3SAntonio Huete Jimenez#		defs/p/pfb.trid.xml
16*3b9cdfa3SAntonio Huete Jimenez# Note:		PFB stands for Printer Font Binary
17327e51cbSPeter Avalos0	string		%!PS-AdobeFont-1.	PostScript Type 1 font text
18*3b9cdfa3SAntonio Huete Jimenez#!:mime	font/x-postscript-pfb
19*3b9cdfa3SAntonio Huete Jimenez#!:ext	pfb
20327e51cbSPeter Avalos>20	string		>\0			(%s)
21*3b9cdfa3SAntonio Huete Jimenez# http://www.nationalarchives.gov.uk/pronom/fmt/525
22*3b9cdfa3SAntonio Huete Jimenez6	string		%!PS-AdobeFont-1.
23*3b9cdfa3SAntonio Huete Jimenez# skip DROID fmt-525-signature-id-816.pfb by checking for content after header
24*3b9cdfa3SAntonio Huete Jimenez>24	ubyte		x			PostScript Type 1 font program data
25*3b9cdfa3SAntonio Huete Jimenez#!:mime	application/octet-stream
26*3b9cdfa3SAntonio Huete Jimenez!:mime	font/x-postscript-pfb
27*3b9cdfa3SAntonio Huete Jimenez!:ext	pfb
28*3b9cdfa3SAntonio Huete Jimenez# often followed by colon (3Ah) and space (20h) and font name like: DarkGardenMK LetterGothic
29*3b9cdfa3SAntonio Huete Jimenez>>24	ubyte		=0x3A
30*3b9cdfa3SAntonio Huete Jimenez>>>26	string		>\0			(%s)
31*3b9cdfa3SAntonio Huete Jimenez# some times instead of colon %%CreationDate: and "font name" later
32*3b9cdfa3SAntonio Huete Jimenez>>24	ubyte		!0x3A
33*3b9cdfa3SAntonio Huete Jimenez# font name directive followed by def like: c0633bt_.pfb
34*3b9cdfa3SAntonio Huete Jimenez>>>25	search/1247	/FontName\040/
35*3b9cdfa3SAntonio Huete Jimenez# show font name in parentheses like: Frankfurt Lithos CharterBT-BoldItalic Courier10PitchBT-Bold
36*3b9cdfa3SAntonio Huete Jimenez>>>>&0	regex		[A-Za-z0-9-]+		(%s)
37*3b9cdfa3SAntonio Huete Jimenez# http://cd.textfiles.com/maxfonts/ATM/M/MIRROR__.PFB
38*3b9cdfa3SAntonio Huete Jimenez6	string		%PS-AdobeFont-1.	PostScript Type 1 font program data
39*3b9cdfa3SAntonio Huete Jimenez!:mime	font/x-postscript-pfb
40*3b9cdfa3SAntonio Huete Jimenez!:ext	pfb
41*3b9cdfa3SAntonio Huete Jimenez# font name like:  Times-Mirror
42*3b9cdfa3SAntonio Huete Jimenez>25	string		>\0			(%s)
43f72f8299SJan Lentfer0	string		%!FontType1	PostScript Type 1 font program data
44*3b9cdfa3SAntonio Huete Jimenez#!:mime	font/x-postscript-pfb
45*3b9cdfa3SAntonio Huete Jimenez#!:ext	pfb
46f72f8299SJan Lentfer6	string		%!FontType1	PostScript Type 1 font program data
47*3b9cdfa3SAntonio Huete Jimenez#!:mime	application/octet-stream
48*3b9cdfa3SAntonio Huete Jimenez!:mime	font/x-postscript-pfb
49*3b9cdfa3SAntonio Huete Jimenez!:ext	pfb
50*3b9cdfa3SAntonio Huete Jimenez# font name like: CaslonOpenFace FetteFraktur Kaufmann Linotext MesozoicGothic Old-Town
51*3b9cdfa3SAntonio Huete Jimenez>23	string		>\0			(%s)
52*3b9cdfa3SAntonio Huete Jimenez# http://cd.textfiles.com/maxfonts/ATM/P/PLAYBI.PFB
53*3b9cdfa3SAntonio Huete Jimenez230	string		%!FontType1	PostScript Type 1 font program data
54*3b9cdfa3SAntonio Huete Jimenez!:mime	font/x-postscript-pfb
55*3b9cdfa3SAntonio Huete Jimenez!:ext	pfb
56*3b9cdfa3SAntonio Huete Jimenez# font name like: Playbill
57*3b9cdfa3SAntonio Huete Jimenez>247	string		>\0			(%s)
58f72f8299SJan Lentfer0	string		%!PS-Adobe-3.0\ Resource-Font	PostScript Type 1 font text
59*3b9cdfa3SAntonio Huete Jimenez#!:mime	font/x-postscript-pfb
60*3b9cdfa3SAntonio Huete Jimenez#!:ext	pfb
61327e51cbSPeter Avalos
62c30bd091SSascha Wildner# Summary:	PostScript Type 1 Printer Font Metrics
63c30bd091SSascha Wildner# URL:		https://en.wikipedia.org/wiki/PostScript_fonts
646fca56fbSSascha Wildner# Reference:	https://partners.adobe.com/public/developer/en/font/5178.PFM.pdf
65c30bd091SSascha Wildner# Modified by:	Joerg Jenderek
66c30bd091SSascha Wildner# Note:		moved from ./msdos magic
67c30bd091SSascha Wildner# dfVersion 256=0100h
68c30bd091SSascha Wildner0		uleshort	0x0100
69c30bd091SSascha Wildner# GRR: line above is too general as it catches also TrueType font,
70c30bd091SSascha Wildner# raw G3 data FAX, WhatsApp encrypted and Panorama database
71c30bd091SSascha Wildner# dfType 129=0081h
72c30bd091SSascha Wildner>66		uleshort	0x0081
73c30bd091SSascha Wildner# dfVertRes 300=012Ch not needed as additional test
74c30bd091SSascha Wildner#>>70		uleshort	0x012c
75c30bd091SSascha Wildner# dfHorizRes 300=012Ch
76c30bd091SSascha Wildner#>>>72		uleshort	0x012c
77c30bd091SSascha Wildner# dfDriverInfo points to postscript information section
78c30bd091SSascha Wildner>>(101.l)	string/c	Postscript	Printer Font Metrics
79c30bd091SSascha Wildner# above labeled "PFM data" by ./msdos (version 5.28) or "Adobe Printer Font Metrics" by TrID
80c30bd091SSascha Wildner!:mime	application/x-font-pfm
81c30bd091SSascha Wildner# AppleShare Print Server
82c30bd091SSascha Wildner#!:apple	ASPS????
83c30bd091SSascha Wildner!:ext	pfm
84c30bd091SSascha Wildner# dfCopyright 60 byte null padded Copyright string. uncomment it to get old looking
85c30bd091SSascha Wildner#>>>6		string		>\060		- %-.60s
86c30bd091SSascha Wildner# dfDriverInfo
87c30bd091SSascha Wildner>>>139		ulelong		>0
88c30bd091SSascha Wildner# often abbreviated and same as filename
89c30bd091SSascha Wildner>>>>(139.l)	string		x		%s
90c30bd091SSascha Wildner# dfSize
91c30bd091SSascha Wildner>>>2		ulelong		x		\b, %d bytes
92c30bd091SSascha Wildner# dfFace 210=D2h 9Eh
93c30bd091SSascha Wildner>>>105		ulelong		>0
94c30bd091SSascha Wildner# Windows font name
95c30bd091SSascha Wildner>>>>(105.l)	string		x		\b, %s
96c30bd091SSascha Wildner# dfItalic
97c30bd091SSascha Wildner>>>80		ubyte		1		italic
98c30bd091SSascha Wildner# dfUnderline
99c30bd091SSascha Wildner>>>81		ubyte		1		underline
100c30bd091SSascha Wildner# dfStrikeOut
101c30bd091SSascha Wildner>>>82		ubyte		1		strikeout
102c30bd091SSascha Wildner# dfWeight 400=0x0190 300=0x012c 500=0x01f4 600=0x0258 700=0x02bc
103c30bd091SSascha Wildner>>>83		uleshort	>699		bold
104c30bd091SSascha Wildner# dfPitchAndFamily 16 17 48 49 64 65
105c30bd091SSascha Wildner>>>90		ubyte		16		serif
106c30bd091SSascha Wildner>>>90		ubyte		17		serif proportional
107c30bd091SSascha Wildner#>>>90		ubyte		48		other
108c30bd091SSascha Wildner>>>90		ubyte		49		proportional
109c30bd091SSascha Wildner>>>90		ubyte		64		script
110c30bd091SSascha Wildner>>>90		ubyte		65		script proportional
111c30bd091SSascha Wildner
112327e51cbSPeter Avalos# X11 font files in SNF (Server Natural Format) format
113*3b9cdfa3SAntonio Huete Jimenez# updated by Joerg Jenderek at Feb 2013 and Nov 2021
114e8af9738SPeter Avalos# http://computer-programming-forum.com/51-perl/8f22fb96d2e34bab.htm
115*3b9cdfa3SAntonio Huete Jimenez# URL:		http://fileformats.archiveteam.org/wiki/SNF
116*3b9cdfa3SAntonio Huete Jimenez# Reference:	https://cgit.freedesktop.org/xorg/lib/libXfont/tree/src/bitmap/snfstr.h
117*3b9cdfa3SAntonio Huete Jimenez0	belong		00000004
118*3b9cdfa3SAntonio Huete Jimenez# version2 same as version1 in struct _snfFontInfo
119*3b9cdfa3SAntonio Huete Jimenez>104	belong		00000004		X11 SNF font data, MSB first
120*3b9cdfa3SAntonio Huete Jimenez# GRR: line above is too general as it catches also DEGAS low-res bitmap like:
121*3b9cdfa3SAntonio Huete Jimenez# http://cd.textfiles.com/geminiatari/FILES/GRAPHICS/ANIMAT/SPID_PAT/BIGSPID.PI1
122e8af9738SPeter Avalos!:mime	application/x-font-sfn
123*3b9cdfa3SAntonio Huete Jimenez!:ext	snf
124*3b9cdfa3SAntonio Huete Jimenez# GRR: line below is too general as it catches also Xbase index file t3-CHAR.NDX
125e8af9738SPeter Avalos0	lelong		00000004
126e8af9738SPeter Avalos>104	lelong		00000004		X11 SNF font data, LSB first
127e8af9738SPeter Avalos!:mime	application/x-font-sfn
128*3b9cdfa3SAntonio Huete Jimenez# Reference:    http://mark0.net/download/triddefs_xml.7z/defs/s/snf-x11-lsb.trid.xml
129*3b9cdfa3SAntonio Huete Jimenez!:ext	snf
130327e51cbSPeter Avalos
131327e51cbSPeter Avalos# X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
13279343712SPeter Avalos0	search/1	STARTFONT\ 		X11 BDF font text
133327e51cbSPeter Avalos
134c30bd091SSascha Wildner# From: Joerg Jenderek
1356fca56fbSSascha Wildner# URL: https://grub.gibibit.com/New_font_format
136c30bd091SSascha Wildner# Reference: util/grub-mkfont.c
137c30bd091SSascha Wildner#		include/grub/fontformat.h
138c30bd091SSascha Wildner# FONT_FORMAT_SECTION_NAMES_FILE
139c30bd091SSascha Wildner0			string		FILE
140c30bd091SSascha Wildner# FONT_FORMAT_PFF2_MAGIC
141c30bd091SSascha Wildner>8			string		PFF2
142c30bd091SSascha Wildner# leng 4 only at the moment
143c30bd091SSascha Wildner>>4			ubelong		4
144c30bd091SSascha Wildner# FONT_FORMAT_SECTION_NAMES_FONT_NAME
145c30bd091SSascha Wildner>>>12			string		NAME		GRUB2 font
146c30bd091SSascha Wildner!:mime			application/x-font-pf2
147c30bd091SSascha Wildner!:ext			pf2
148c30bd091SSascha Wildner# length of font_name
149c30bd091SSascha Wildner>>>>16			ubelong		>0
150c30bd091SSascha Wildner# font_name
151c30bd091SSascha Wildner>>>>>20			string		>\0		"%-s"
152c30bd091SSascha Wildner
153327e51cbSPeter Avalos# X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
154327e51cbSPeter Avalos# PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
155c30bd091SSascha Wildner0	string		\001fcp			X11 Portable Compiled Font data,
156c30bd091SSascha Wildner>12	lelong		^0x08			bit: LSB,
157c30bd091SSascha Wildner>12	lelong		&0x08			bit: MSB,
158c30bd091SSascha Wildner>12	lelong		^0x04			byte: LSB first
159c30bd091SSascha Wildner>12	lelong		&0x04			byte: MSB first
160327e51cbSPeter Avalos0	string		D1.0\015		X11 Speedo font data
161327e51cbSPeter Avalos
162327e51cbSPeter Avalos#------------------------------------------------------------------------------
163327e51cbSPeter Avalos# FIGlet fonts and controlfiles
164327e51cbSPeter Avalos# From figmagic supplied with Figlet version 2.2
165327e51cbSPeter Avalos# "David E. O'Brien" <obrien@FreeBSD.ORG>
166327e51cbSPeter Avalos0	string		flf		FIGlet font
167327e51cbSPeter Avalos>3	string		>2a		version %-2.2s
168327e51cbSPeter Avalos0	string		flc		FIGlet controlfile
169327e51cbSPeter Avalos>3	string		>2a		version %-2.2s
170327e51cbSPeter Avalos
171327e51cbSPeter Avalos# libGrx graphics lib fonts, from Albert Cahalan (acahalan@cs.uml.edu)
172327e51cbSPeter Avalos# Used with djgpp (DOS Gnu C++), sometimes Linux or Turbo C++
173327e51cbSPeter Avalos0	belong		0x14025919	libGrx font data,
174327e51cbSPeter Avalos>8	leshort		x		%dx
175327e51cbSPeter Avalos>10	leshort		x		\b%d
176327e51cbSPeter Avalos>40	string		x		%s
177327e51cbSPeter Avalos# Misc. DOS VGA fonts, from Albert Cahalan (acahalan@cs.uml.edu)
178970935fdSSascha Wildner# Update:	Joerg Jenderek
179970935fdSSascha Wildner# URL:		http://fileformats.archiveteam.org/wiki/CPI
180970935fdSSascha Wildner# Reference:	http://www.delorie.com/djgpp/doc/rbinter/it/58/17.html
181327e51cbSPeter Avalos0	belong		0xff464f4e	DOS code page font data collection
182970935fdSSascha Wildner!:mime	font/x-dos-cpi
183970935fdSSascha Wildner!:ext	cpi
184970935fdSSascha Wildner0	string		\x7fDRFONT	DR-DOS code page font data collection
185970935fdSSascha Wildner!:mime	font/x-drdos-cpi
186970935fdSSascha Wildner!:ext	cpi
187327e51cbSPeter Avalos7	belong		0x00454741	DOS code page font data
188327e51cbSPeter Avalos7	belong		0x00564944	DOS code page font data (from Linux?)
189327e51cbSPeter Avalos4098	string		DOSFONT		DOSFONT2 encrypted font data
190327e51cbSPeter Avalos
1916fca56fbSSascha Wildner# From: Joerg Jenderek
1926fca56fbSSascha Wildner# URL: http://fileformats.archiveteam.org/wiki/GEM_bitmap_font
1936fca56fbSSascha Wildner# Reference: http://cd.textfiles.com/ataricompendium/BOOK/HTML/APPENDC.HTM#cnt
1946fca56fbSSascha Wildner#
1956fca56fbSSascha Wildner# usual case with lightening mask and skewing mask 5555h~UU
1966fca56fbSSascha Wildner#62	ulelong		0x55555555
1976fca56fbSSascha Wildner# skip cl8m8ocofedso.testfile by looking for face size lower/equal 72
1986fca56fbSSascha Wildner#>2	uleshort	<73
1996fca56fbSSascha Wildner#>>0	use		gdos-font
2006fca56fbSSascha Wildner# BOX18.GFT COWBOY30.GFT ROYALK30.GFT
2016fca56fbSSascha Wildner#62	ulelong		0
2026fca56fbSSascha Wildner# skip ISO 9660 CD-ROM ./filesystem by looking for low positive face size
2036fca56fbSSascha Wildner#>2	uleshort	>2
2046fca56fbSSascha Wildner# skip DOS 2.0 backup id file ./msdos by looking for face size lower/equal 72
2056fca56fbSSascha Wildner#>>2	uleshort	<73
2066fca56fbSSascha Wildner# skip MS oem.hlp, some Windows ICO ./msdos by looking for valid long name like WYE
2076fca56fbSSascha Wildner#>>>4	ulelong		>0x001F1f1F
2086fca56fbSSascha Wildner# skip Microsoft WinWord 2.0 ./msdos by looking for positive offset to font data
2096fca56fbSSascha Wildner#>>>>76	ulelong		>83
2106fca56fbSSascha Wildner#>>>>>0	use		gdos-font
2116fca56fbSSascha Wildner0	name		gdos-font
2126fca56fbSSascha Wildner>0	uleshort	x		GEM GDOS font
2136fca56fbSSascha Wildner!:mime	application/x-font-gdos
2146fca56fbSSascha Wildner# also .eps found like AA070GEP.EPS AI360GEP.EPS
2156fca56fbSSascha Wildner!:ext	fnt/gtf
2166fca56fbSSascha Wildner# font name like Big&Tall, Celtic #s, Courier, University Bold, WYE
2176fca56fbSSascha Wildner>4	string		x		%.32s
2186fca56fbSSascha Wildner# face size in points 3-72 SLSS03CG.FNT H1CELT72.FNT
2196fca56fbSSascha Wildner>2	uleshort	x		%u
2206fca56fbSSascha Wildner# face ID (must be unique)
221614728caSSascha Wildner>0	uleshort	x		\b, ID %#4.4x
2226fca56fbSSascha Wildner# lowest character index in face (4 but usually 32 for disk-loaded fonts)
2236fca56fbSSascha Wildner#>36	uleshort	!32		\b, unusual character index %u
2246fca56fbSSascha Wildner# width of the widest character like 0 8 10 12 16 24 32
2256fca56fbSSascha Wildner#>50	uleshort	x		\b, %u char width
2266fca56fbSSascha Wildner# width of the widest character cell like 8 11 12 14 15 16 33 67
2276fca56fbSSascha Wildner#>52	uleshort	x		\b, %u cell width
2286fca56fbSSascha Wildner# thickening size in pixel like 0 1 2 3 4 5 6 7 8
2296fca56fbSSascha Wildner#>58	uleshort	x		\b, %u thick
2306fca56fbSSascha Wildner# lightening mask to eliminate pixels, usually 5555h
231614728caSSascha Wildner>62	uleshort	!0x5555		\b, lightening mask %#x
2326fca56fbSSascha Wildner# skewing mask to determine when to perform additional rotation when skewing, usually 5555h
233614728caSSascha Wildner>64	uleshort	!0x5555		\b, skewing mask %#x
2346fca56fbSSascha Wildner# offset to optional horizontal offset table 0 58h~88 5eh 252h
235614728caSSascha Wildner#>68	ulelong		x		\b, %#x horizontal table offset
2366fca56fbSSascha Wildner# offset of character offset table 54h for many *.GFT 55h 58h 5Eh 120h 1D4h 202h 220h
237614728caSSascha Wildner#>72	ulelong		x		\b, %#x coffset
2386fca56fbSSascha Wildner# offset to font data like 116h 118h 158 20Ah 20Eh
239614728caSSascha Wildner>76	ulelong		x		\b, %#x foffset
2406fca56fbSSascha Wildner# form width in bytes like 58 67 156 190 227 317 345
2416fca56fbSSascha Wildner#>80	uleshort	x		\b, %u fwidth
2426fca56fbSSascha Wildner# form height in bytes like 4 8 11 17 26 56 70 90 120 146 150
2436fca56fbSSascha Wildner#>82	uleshort	x		\b, %u fheight
2446fca56fbSSascha Wildner# pointer to the next font like 0 10000h 20000h 30000h 40000h 60000h 80000h E0000h D0000h
245614728caSSascha Wildner#>84	ulelong		x		\b, %#x noffset
2466fca56fbSSascha Wildner
247327e51cbSPeter Avalos# downloadable fonts for browser (prints type) anthon@mnt.org
248c30bd091SSascha Wildner# https://tools.ietf.org/html/rfc3073
249c30bd091SSascha Wildner0	string		PFR1		Portable Font Resource font data (new)
250327e51cbSPeter Avalos>102	string		>0		\b: %s
251c30bd091SSascha Wildner0	string		PFR0		Portable Font Resource font data (old)
252c30bd091SSascha Wildner>4	beshort		>0		version %d
253327e51cbSPeter Avalos
254327e51cbSPeter Avalos# True Type fonts
255c30bd091SSascha Wildner# Modified by: Joerg Jenderek
256c30bd091SSascha Wildner# URL: https://en.wikipedia.org/wiki/TrueType
257c30bd091SSascha Wildner# Reference: https://developer.apple.com/fonts/TrueType-Reference-Manual/
258c30bd091SSascha Wildner#
259c30bd091SSascha Wildner# sfnt version "typ1" used by some Apple, but no example found
260c30bd091SSascha Wildner0	string	typ1
261c30bd091SSascha Wildner>0	use		sfnt-font
262c30bd091SSascha Wildner>0	use		sfnt-names
263c30bd091SSascha Wildner# sfnt version "true" used by some Apple
264c30bd091SSascha Wildner0	string	true
265c30bd091SSascha Wildner>0	use		sfnt-font
266c30bd091SSascha Wildner>0	use		sfnt-names
267c30bd091SSascha Wildner# GRR: below test is too general
268c30bd091SSascha Wildner# sfnt version often 0x00010000
269c30bd091SSascha Wildner0	string	\000\001\000\000
270c30bd091SSascha Wildner>0	use		sfnt-font
271c30bd091SSascha Wildner>0	use		sfnt-names
272c30bd091SSascha Wildner#	validate and display sfnt font data like number of tables
273c30bd091SSascha Wildner0	name		sfnt-font
274c30bd091SSascha Wildner# file 5.30 version assumes 00FFh as maximal number of tables
275c30bd091SSascha Wildner#>4	ubeshort	<0x0100
276c30bd091SSascha Wildner# maximal 27 tables found like in Skia.ttf
277c30bd091SSascha Wildner# 46 different table names mentioned on Apple specification
278c30bd091SSascha Wildner# skip 1st sequence of DOS 2 backup with path separator (\~92 or /~47) misinterpreted as table number
279c30bd091SSascha Wildner>4	ubeshort	<47
280c30bd091SSascha Wildner# skip bad examples with garbage table names like in a5.show HYPERC MAC
281c30bd091SSascha Wildner# tag names consist of up to four characters padded with spaces at end like
282c30bd091SSascha Wildner# BASE DSIG OS/2 Zapf acnt glyf cvt vmtx xref ...
283c30bd091SSascha Wildner>>12	regex/4l	\^[A-Za-z][A-Za-z][A-Za-z/][A-Za-z2\ ]
284614728caSSascha Wildner#>>>0	ubelong	x	\b, sfnt version %#x
285c30bd091SSascha Wildner>>>0	ubelong	!0x4f54544f	TrueType
2866fca56fbSSascha Wildner!:mime	font/sfnt
287c30bd091SSascha Wildner!:apple	????tfil
288c30bd091SSascha Wildner# .ttf for TrueType font
289c30bd091SSascha Wildner# EUDC.tte created by privat character editor %WINDIR%\system32\eudcedit.exe
290c30bd091SSascha Wildner!:ext	ttf/tte
291c30bd091SSascha Wildner# sfnt version 4F54544Fh~OTTO
292c30bd091SSascha Wildner>>>0	ubelong	=0x4f54544f	OpenType
2936fca56fbSSascha Wildner!:mime	font/otf
294c30bd091SSascha Wildner!:apple	????OTTO
295c30bd091SSascha Wildner!:ext	otf
296c30bd091SSascha Wildner>>>0	ubelong	x		Font data
297c30bd091SSascha Wildner# DSIG=44454947h table name implies a digitally signed font
298c30bd091SSascha Wildner# search range = number of tables * 16 =< maximal number of tables * 16 = 27 * 16 = 432
299c30bd091SSascha Wildner>>>12	search/432	DSIG		\b, digitally signed
300c30bd091SSascha Wildner>>>4	ubeshort	x		\b, %d tables
301c30bd091SSascha Wildner# minimal 9 tables found like in NISC18030.ttf
302c30bd091SSascha Wildner#>>>4	ubeshort	<10		TMIN
303c30bd091SSascha Wildner#>>>4	ubeshort	>24		TBIG
304c30bd091SSascha Wildner# table directory entries
305c30bd091SSascha Wildner>>>12	string		x		\b, 1st "%4.4s"
306c30bd091SSascha Wildner
307c30bd091SSascha Wildner#	search and display 1st name in sfnt font which is often copyright text
308c30bd091SSascha Wildner#	does not work inside font collections
309c30bd091SSascha Wildner0	name		sfnt-names
310c30bd091SSascha Wildner# search for naming table
311c30bd091SSascha Wildner>12	search/432/s	name
312c30bd091SSascha Wildner# biggest offset 0x0100bd28 like Windows10 Fonts\simsunb.ttf
313c30bd091SSascha Wildner#>>>>&8	ubelong		>0x0100bd27	BIGGEST OFFSET
314c30bd091SSascha Wildner>>&8	ubelong		>0x00100000
315c30bd091SSascha Wildner# offset of name table
316614728caSSascha Wildner>>>&-4	ubelong		x		\b, name offset %#x
317c30bd091SSascha Wildner# GRR: pointer to name table only works if offset ~< FILE_BYTES_MAX = 100000h defined in src\file.h
318c30bd091SSascha Wildner>>&8	ubelong		<0x00100000
319c30bd091SSascha Wildner>>>&-16	ubelong		x
320c30bd091SSascha Wildner# name table
321c30bd091SSascha Wildner>>>>(&8.L)	ubequad	x
322c30bd091SSascha Wildner# invalid format selector
323c30bd091SSascha Wildner#>>>>>&-8	ubeshort	!0	\b, invalid selector %x
324c30bd091SSascha Wildner# minimal 3 name records found like in c:\Program Files (x86)\Tesseract-OCR\tessdata\pdf.ttf
325c30bd091SSascha Wildner# maximal 1227 name records found like in Apple Chancery.ttf
326c30bd091SSascha Wildner#>>>>>&-6	ubeshort	<0x4	mincount
327c30bd091SSascha Wildner#>>>>>&-6	ubeshort	>130	maxcount
328c30bd091SSascha Wildner>>>>>&-6	ubeshort	x	\b, %d names
329c30bd091SSascha Wildner# offset to start of string storage from start of table
330c30bd091SSascha Wildner#>>>>>&-4	ubeshort	x	\b, record offset %d
331c30bd091SSascha Wildner# 1st name record
332c30bd091SSascha Wildner# string offset from start of storage area
333c30bd091SSascha Wildner#>>>>>&8		ubeshort	x	\b, string offset %d
334c30bd091SSascha Wildner# string length
335c30bd091SSascha Wildner#>>>>>&6		ubeshort	x	\b, string length %d
336c30bd091SSascha Wildner# minimal name string 7 like in c:\Program Files (x86)\Kodi\addons\webinterface.default\lib\video-js\font\VideoJS.ttf
337c30bd091SSascha Wildner# also found 0 like in SWZCONLN.TTF
338c30bd091SSascha Wildner#>>>>>&6		ubeshort	<8	MIN STRING
339c30bd091SSascha Wildner# maximal name string 806 like in c:\Windows\Fonts\palabi.ttf
340c30bd091SSascha Wildner#>>>>>&6		ubeshort	>805	MAX STRING
341c30bd091SSascha Wildner# platform identifier: 0~Apple Unicode, 1~Macintosh, 3~Microsoft
342c30bd091SSascha Wildner#>>>>>&-2	ubeshort	>3	BAD PLATFORM
343c30bd091SSascha Wildner>>>>>&-2	ubeshort	0	\b, Unicode
344c30bd091SSascha Wildner>>>>>&-2	ubeshort	1	\b, Macintosh
345c30bd091SSascha Wildner>>>>>&-2	ubeshort	3	\b, Microsoft
346c30bd091SSascha Wildner# languageID (0~english Macintosh, 0409h~english Microsoft, ...)
347614728caSSascha Wildner>>>>>&2		ubeshort	>0	\b, language %#x
348c30bd091SSascha Wildner# name identifiers
349c30bd091SSascha Wildner# often 0~copyright, 1~font, 2~font subfamily, 5~version, 13~license, 19~sample, ...
350c30bd091SSascha Wildner>>>>>&4		ubeshort	>0	\b, type %d string
351c30bd091SSascha Wildner# platform specific encoding:
352c30bd091SSascha Wildner# 0~undefined character set, 1~UGL set with Unicode, 3~Unicode 2.0 BMP only, 4~Unicode 2.0
353c30bd091SSascha Wildner#>>>>>&0		ubeshort	x	\b, %d encoding
354c30bd091SSascha Wildner>>>>>&0		ubeshort	0
355c30bd091SSascha Wildner# handle only name string offset 0 because do not know how to add 2 relative offsets
356c30bd091SSascha Wildner>>>>>>&6		ubeshort	0
357c30bd091SSascha Wildner>>>>>>>&(&-14.S-18)	ubyte		!0
358c30bd091SSascha Wildner# GRR: instead 806 only first MAXstring = 96 characters are displayed as defined in src\file.h
359c30bd091SSascha Wildner# often copyright string that starts like \251 2006 The Monotype Corporation
360c30bd091SSascha Wildner>>>>>>>>&-1		string		x	\b, %-11.96s
361c30bd091SSascha Wildner# test for unicode string
362c30bd091SSascha Wildner>>>>>>>&(&-14.S-18)	ubyte		0
363c30bd091SSascha Wildner>>>>>>>>&0		lestring16	x	\b, %-11.96s
364c30bd091SSascha Wildner# unicode encoding
365c30bd091SSascha Wildner>>>>>&0		ubeshort	>0
366c30bd091SSascha Wildner>>>>>>&6		ubeshort	0
367c30bd091SSascha Wildner>>>>>>>&(&-14.S-17)	lestring16	x	\b, %-11.96s
368327e51cbSPeter Avalos
369327e51cbSPeter Avalos0	string		\007\001\001\000Copyright\ (c)\ 199	Adobe Multiple Master font
370327e51cbSPeter Avalos0	string		\012\001\001\000Copyright\ (c)\ 199	Adobe Multiple Master font
371327e51cbSPeter Avalos
372e4d4ce0cSPeter Avalos# TrueType/OpenType font collections (.ttc)
373c30bd091SSascha Wildner# URL: https://en.wikipedia.org/wiki/OpenType
3746fca56fbSSascha Wildner# https://www.microsoft.com/typography/otspec/otff.htm
375c30bd091SSascha Wildner# Modified by: Joerg Jenderek
376c30bd091SSascha Wildner# Note:	container for TrueType, OpenType font
377c30bd091SSascha Wildner0	string		ttcf
378c30bd091SSascha Wildner# skip ASCII text
379c30bd091SSascha Wildner>4	ubyte		0
380c30bd091SSascha Wildner# sfnt version often 0x00010000 of 1st table is TrueType
381c30bd091SSascha Wildner>>(12.L)	ubelong	!0x4f54544f	TrueType
3826fca56fbSSascha Wildner!:mime	font/ttf
383c30bd091SSascha Wildner!:apple	????tfil
384c30bd091SSascha Wildner!:ext	ttc
385c30bd091SSascha Wildner# sfnt version 4F54544Fh~OTTO of 1st table is OpenType font
386c30bd091SSascha Wildner>>(12.L)	ubelong	=0x4f54544f	OpenType
3876fca56fbSSascha Wildner!:mime	font/otf
388c30bd091SSascha Wildner!:apple	????OTTO
389c30bd091SSascha Wildner# no example found for otc
390c30bd091SSascha Wildner!:ext	ttc/otc
391c30bd091SSascha Wildner>>4	ubyte		x		font collection data
392c30bd091SSascha Wildner#!:mime	font/collection
393c30bd091SSascha Wildner# TCC version
394c30bd091SSascha Wildner>>4	belong		0x00010000	\b, 1.0
395c30bd091SSascha Wildner>>4	belong		0x00020000	\b, 2.0
396c30bd091SSascha Wildner>>8	ubelong		>0		\b, %d fonts
397c30bd091SSascha Wildner# array offset size = fonts * offsetsize = fonts * 4
398c30bd091SSascha Wildner>>(8.L*4) ubequad	x
399e4d4ce0cSPeter Avalos# 0x44454947 = 'DSIG'
400c30bd091SSascha Wildner>>>&4	belong		0x44534947	\b, digitally signed
401c30bd091SSascha Wildner# offset to 1st font
402614728caSSascha Wildner>>12	ubelong		x		\b, at %#x
403c30bd091SSascha Wildner# point to 1st font that starts with sfnt version
404c30bd091SSascha Wildner>>(12.L) use		sfnt-font
40579343712SPeter Avalos
406327e51cbSPeter Avalos# Opentype font data from Avi Bercovich
407327e51cbSPeter Avalos0	string		OTTO		OpenType font data
408f72f8299SJan Lentfer!:mime application/vnd.ms-opentype
409327e51cbSPeter Avalos
4106fca56fbSSascha Wildner# From: Alex Myczko <alex@aiei.ch>
411327e51cbSPeter Avalos0	string		SplineFontDB:	Spline Font Database
412f72f8299SJan Lentfer!:mime application/vnd.font-fontforge-sfd
413327e51cbSPeter Avalos>14	string		x		version %s
414e4d4ce0cSPeter Avalos
415e4d4ce0cSPeter Avalos# EOT
416c30bd091SSascha Wildner0x40	string		\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
417c30bd091SSascha Wildner>0x22	string		LP		Embedded OpenType (EOT)
418c30bd091SSascha Wildner# workaround until there's lepstring16
419c30bd091SSascha Wildner# >>0x52	lepstring16/h	>\0		\b, %s family
420c30bd091SSascha Wildner>>0x52	short	!0
421c30bd091SSascha Wildner>>>0x54	lestring16	x		\b, %s family
422e4d4ce0cSPeter Avalos!:mime application/vnd.ms-fontobject
423e8af9738SPeter Avalos
424e8af9738SPeter Avalos# Web Open Font Format (.woff)
425c30bd091SSascha Wildner0	name		woff
426c30bd091SSascha Wildner>4	belong		0x00010000	\b, TrueType
427c30bd091SSascha Wildner>4	belong		0x4F54544F	\b, CFF
428c30bd091SSascha Wildner>4	belong		0x74727565	\b, TrueType
429c30bd091SSascha Wildner>4	default		x
430c30bd091SSascha Wildner>>4	belong		x		\b, flavor %d
431c30bd091SSascha Wildner>8	belong		x		\b, length %d
432c30bd091SSascha Wildner#>12	beshort		x		\b, numTables %d
433c30bd091SSascha Wildner#>14	beshort		x		\b, reserved %d
434c30bd091SSascha Wildner#>16	belong		x		\b, totalSfntSize %d
435c30bd091SSascha Wildner
4366fca56fbSSascha Wildner# https://www.w3.org/TR/WOFF/
437e8af9738SPeter Avalos0	string		wOFF	Web Open Font Format
438*3b9cdfa3SAntonio Huete Jimenez!:mime font/woff
439c30bd091SSascha Wildner>0	use		woff
44082c5fa3eSPeter Avalos>20	beshort		x	\b, version %d
44182c5fa3eSPeter Avalos>22	beshort		x	\b.%d
4426fca56fbSSascha Wildner# https://www.w3.org/TR/WOFF2/
443c30bd091SSascha Wildner0	string		wOF2	Web Open Font Format (Version 2)
444*3b9cdfa3SAntonio Huete Jimenez!:mime font/woff2
445*3b9cdfa3SAntonio Huete Jimenez!:ext	woff2
446c30bd091SSascha Wildner>0	use		woff
447c30bd091SSascha Wildner#>20	belong		x	\b, totalCompressedSize %d
448c30bd091SSascha Wildner>24	beshort		x	\b, version %d
449c30bd091SSascha Wildner>26	beshort		x	\b.%d
450