fontisan 0.4.12 → 0.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e97f99deb241e5abd1bbdaeb27849efb3a4597bf2139fc8a1fa815fcccbfdfcb
4
- data.tar.gz: ced71eac0e00e479581c5460e33672aa80ded30cd40cb590b5a09621c5441290
3
+ metadata.gz: 47e074b8c2bbdcfa377c95733f56fdd978dfa4d824dbae3e29f3bd75935dddd6
4
+ data.tar.gz: a1a348db0bd6dde039c0a43f62ac3ab43792cc7414e995a72c47798663a1cd59
5
5
  SHA512:
6
- metadata.gz: cc72fc9f58560fddf2440ecead8a54060a06a6da38ac3de2212d893cb3dbb2dea88649c82c30ff8fb10d25389058a63770d4309e414856f031ab3d88659f4150
7
- data.tar.gz: bac0c91aa712516256d2ae7fb7ccee7dd31fe1549ace5bb533ea9d2b27b7087da4b0b200412794b3677b44c43bae79c87cbcaa849db3f6d993d00dac91a1e3a3
6
+ metadata.gz: e8917cc8c995f0ca2cbdc9e94ad5d5d629ab95d8809b7eb728d360f0743a2b26e5cfd059254497c5a1df10ddb3b53258ee703c441a106d4febd42b26ea3b6e08
7
+ data.tar.gz: d35a8138d7cdbc5389b619ed757863cc0d61e1d8d025655d0fb6736a21815f04d24802f24236fdffdc8d430192db79798f77f7b9343193e0c16035d2be8fc5eb
data/README.adoc CHANGED
@@ -120,7 +120,7 @@ Font format support::
120
120
  * TTF, OTF (CFF1), OTF2 (CFF2), TTC, OTC font formats (production ready)
121
121
  * CFF2 with variable-font blend/vsindex operators, FDSelect, subroutines
122
122
  * Adobe Type 1 fonts (PFB/PFA) with bidirectional conversion (see link:docs/TYPE1_FONTS.adoc[Type 1 Fonts Guide])
123
- * WOFF/WOFF2 format support with reading, writing, and conversion (see link:docs/WOFF_WOFF2_FORMATS.adoc[WOFF/WOFF2 Guide])
123
+ * WOFF/WOFF2 format support with reading, writing, and conversion — fully compliant with W3C WOFF 1.0 (https://www.w3.org/TR/WOFF/[Recommendation 13 December 2012]) and WOFF 2.0 (https://www.w3.org/TR/WOFF2/[Recommendation 08 August 2024]) specifications. See link:docs/WOFF_WOFF2_FORMATS.adoc[WOFF/WOFF2 Guide].
124
124
  * Apple legacy font support: 'true' signature TrueType fonts and dfont format (see link:docs/APPLE_LEGACY_FONTS.adoc[Apple Legacy Fonts Guide])
125
125
  * SVG font generation and SVG-to-glyph conversion (complete)
126
126
 
@@ -8,6 +8,79 @@ including reading, writing, and conversion between these and other font formats.
8
8
  WOFF is a wrapper around SFNT fonts (TTF/OTF) using zlib compression, while WOFF2
9
9
  uses Brotli compression for better compression ratios and table transformations.
10
10
 
11
+ == W3C specification compliance
12
+
13
+ Fontisan's WOFF and WOFF2 implementations are fully compliant with the
14
+ W3C Recommendations:
15
+
16
+ * **WOFF 1.0** (W3C Recommendation, 13 December 2012):
17
+ https://www.w3.org/TR/WOFF/[spec] — reading and writing
18
+ * **WOFF 2.0** (W3C Recommendation, 08 August 2024):
19
+ https://www.w3.org/TR/WOFF2/[spec] — reading and writing
20
+
21
+ === WOFF 2.0 (spec section references below)
22
+
23
+ Compliance covers every normative requirement of the WOFF2 spec:
24
+
25
+ * *Section 3.2 (WOFF2 Header)*: 48-byte header with correct signature
26
+ (`wOF2`), flavor, file length, reserved=0, totalSfntSize,
27
+ totalCompressedSize, version, and meta/private offset/length fields.
28
+ * *Section 4.1 (Table directory)*: flags byte structure (bits 0-5 tag
29
+ index, bits 6-7 transform version); optional 4-byte custom tag when
30
+ index=63; `transformLength` field present IFF table is transformed.
31
+ * *Section 4.2 (Collection directory)*: full support for flavor=`ttcf`
32
+ font collections — CollectionHeader + CollectionFontEntry per font,
33
+ with deduplicated tables shared across fonts via directory indices.
34
+ * *Section 5 (Compressed data)*: single Brotli stream of all tables in
35
+ directory order; `DSIG` table removed per encoder rule; `head.flags`
36
+ bit 11 set to indicate lossless modifying transform.
37
+ * *Section 5.1 (Transformed glyf table)*: 36-byte header (uint16
38
+ version + uint16 optionFlags + uint16 numGlyphs + uint16 indexFormat
39
+ + 7 × uint32 stream sizes); 7 streams in spec order (nContour,
40
+ nPoints, flags, glyph, composite, bbox with bboxBitmap prefix,
41
+ instructions); optional overlapSimpleBitmap when optionFlags bit 0
42
+ is set; bboxBitmap semantics per spec (composite glyphs always have
43
+ explicit bbox, simple glyphs omit when calculated bbox matches,
44
+ empty glyphs MUST have all-zero bbox).
45
+ * *Section 5.2 (Triplet coordinate encoding)*: variable-length
46
+ coordinate codec with all 128 flag index variants (1-4 byte
47
+ payloads based on coordinate magnitude); bit 7 = off-curve flag.
48
+ * *Section 5.3 (Transformed loca table)*: `transformLength` MUST be 0;
49
+ loca data omitted from compressed stream (reconstructed by decoder
50
+ from glyf).
51
+ * *Section 5.4 (Transformed hmtx table)*: optional version 1 transform
52
+ exploiting `lsb == xMin` redundancy.
53
+ * *Section 5.5 (Table order constraints)*: loca MUST immediately
54
+ follow glyf in table directory; for collections, loca MUST
55
+ immediately follow its corresponding glyf with no other tables in
56
+ between.
57
+
58
+ Validation: fontisan's WOFF2 output is verified byte-identical to
59
+ fontTools' output for transformed glyf tables, and round-trips
60
+ correctly through the W3C `woff2_decompress` reference tool.
61
+
62
+ === WOFF 1.0
63
+
64
+ * *Section 4 (WOFF Header)*: 44-byte header with correct signature
65
+ (`wOFF`), flavor, length, numTables, reserved=0, totalSfntSize,
66
+ version, and meta/private offset/length fields.
67
+ * *Section 5 (Table directory)*: 20-byte entries with tag, offset,
68
+ compLength, origLength, origChecksum. Tables sorted in input font
69
+ order per spec ("MUST be stored in the same order as the
70
+ well-formed input font").
71
+ * *Section 6 (Font data tables)*: tables compressed individually with
72
+ zlib (compress2-compatible); each table 4-byte aligned and
73
+ zero-padded to next boundary ("MUST begin on 4-byte boundaries and
74
+ be zero-padded to the next 4-byte boundary").
75
+ * *Section 7 (Extended metadata)*: optional block of XML data,
76
+ always zlib-compressed ("it is never stored in uncompressed form").
77
+ * *Section 8 (Private data)*: optional block of arbitrary bytes,
78
+ always 4-byte aligned.
79
+
80
+ Validation: fontisan's WOFF 1 output round-trips through fontTools
81
+ without errors; all 4-byte alignment, padding, and compression
82
+ requirements verified by spec-conformance specs.
83
+
11
84
  === Display WOFF/WOFF2 font information
12
85
 
13
86
  Show metadata specific to WOFF/WOFF2 fonts including version, compression details,