Skip to content

Commit 3e576a6

Browse files
authored
Add support for OpenType Font Collection (TTC) (#737)
1 parent 0743dd4 commit 3e576a6

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

core.js

+7
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,13 @@ export class FileTypeParser {
917917
};
918918
}
919919

920+
if (this.checkString('ttcf')) {
921+
return {
922+
ext: 'ttc',
923+
mime: 'font/collection',
924+
};
925+
}
926+
920927
if (this.check([0xCF, 0xFA, 0xED, 0xFE])) {
921928
return {
922929
ext: 'macho',

fixture/fixture.ttc

5 Bytes
Binary file not shown.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
"eot",
125125
"ttf",
126126
"otf",
127+
"ttc",
127128
"ico",
128129
"flv",
129130
"ps",

readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
578578
- [`swf`](https://en.wikipedia.org/wiki/SWF) - Adobe Flash Player file
579579
- [`tar`](https://en.wikipedia.org/wiki/Tar_(computing)#File_format) - Tarball archive file
580580
- [`tif`](https://en.wikipedia.org/wiki/Tagged_Image_File_Format) - Tagged Image file
581+
- [`ttc`](https://en.wikipedia.org/wiki/TrueType#TrueType_Collection) - TrueType Collection font
581582
- [`ttf`](https://en.wikipedia.org/wiki/TrueType) - TrueType font
582583
- [`vcf`](https://en.wikipedia.org/wiki/VCard) - vCard
583584
- [`voc`](https://wiki.multimedia.cx/index.php/Creative_Voice) - Creative Voice File

supported.js

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const extensions = [
5858
'eot',
5959
'ttf',
6060
'otf',
61+
'ttc',
6162
'ico',
6263
'flv',
6364
'ps',
@@ -239,6 +240,7 @@ export const mimeTypes = [
239240
'application/vnd.ms-fontobject',
240241
'font/ttf',
241242
'font/otf',
243+
'font/collection',
242244
'image/x-icon',
243245
'video/x-flv',
244246
'application/postscript',

0 commit comments

Comments
 (0)