Flutter Engine
The Flutter Engine
third_party
skia
src
sfnt
SkSFNTHeader.h
Go to the documentation of this file.
1
/*
2
* Copyright 2012 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef SkSFNTHeader_DEFINED
9
#define SkSFNTHeader_DEFINED
10
11
#include "
src/base/SkEndian.h
"
12
#include "
src/sfnt/SkOTTableTypes.h
"
13
14
//All SK_SFNT_ prefixed types should be considered as big endian.
15
typedef
uint16_t
SK_SFNT_USHORT
;
16
typedef
uint32_t
SK_SFNT_ULONG
;
17
18
#pragma pack(push, 1)
19
20
struct
SkSFNTHeader
{
21
SK_SFNT_ULONG
fontType
;
22
struct
fontType_WindowsTrueType
{
23
static
const
SK_OT_CHAR
TAG0
= 0;
24
static
const
SK_OT_CHAR
TAG1
= 1;
25
static
const
SK_OT_CHAR
TAG2
= 0;
26
static
const
SK_OT_CHAR
TAG3
= 0;
27
static
const
SK_OT_ULONG
TAG
=
SkOTTableTAG<fontType_WindowsTrueType>::value
;
28
};
29
struct
fontType_MacTrueType
{
30
static
const
SK_OT_CHAR
TAG0
=
't'
;
31
static
const
SK_OT_CHAR
TAG1
=
'r'
;
32
static
const
SK_OT_CHAR
TAG2
=
'u'
;
33
static
const
SK_OT_CHAR
TAG3
=
'e'
;
34
static
const
SK_OT_ULONG
TAG
=
SkOTTableTAG<fontType_MacTrueType>::value
;
35
};
36
struct
fontType_PostScript
{
37
static
const
SK_OT_CHAR
TAG0
=
't'
;
38
static
const
SK_OT_CHAR
TAG1
=
'y'
;
39
static
const
SK_OT_CHAR
TAG2
=
'p'
;
40
static
const
SK_OT_CHAR
TAG3
=
'1'
;
41
static
const
SK_OT_ULONG
TAG
=
SkOTTableTAG<fontType_PostScript>::value
;
42
};
43
struct
fontType_OpenTypeCFF
{
44
static
const
SK_OT_CHAR
TAG0
=
'O'
;
45
static
const
SK_OT_CHAR
TAG1
=
'T'
;
46
static
const
SK_OT_CHAR
TAG2
=
'T'
;
47
static
const
SK_OT_CHAR
TAG3
=
'O'
;
48
static
const
SK_OT_ULONG
TAG
=
SkOTTableTAG<fontType_OpenTypeCFF>::value
;
49
};
50
51
SK_SFNT_USHORT
numTables
;
52
SK_SFNT_USHORT
searchRange
;
53
SK_SFNT_USHORT
entrySelector
;
54
SK_SFNT_USHORT
rangeShift
;
55
56
struct
TableDirectoryEntry
{
57
SK_SFNT_ULONG
tag
;
58
SK_SFNT_ULONG
checksum
;
59
SK_SFNT_ULONG
offset
;
//From beginning of header.
60
SK_SFNT_ULONG
logicalLength
;
61
};
//tableDirectoryEntries[numTables]
62
};
63
64
#pragma pack(pop)
65
66
67
static_assert
(
sizeof
(
SkSFNTHeader
) == 12,
"sizeof_SkSFNTHeader_not_12"
);
68
static_assert
(
sizeof
(
SkSFNTHeader::TableDirectoryEntry
) == 16,
"sizeof_SkSFNTHeader_TableDirectoryEntry_not_16"
);
69
70
#endif
SkEndian.h
SkOTTableTypes.h
SK_OT_ULONG
uint32_t SK_OT_ULONG
Definition:
SkOTTableTypes.h:23
SK_OT_CHAR
int8_t SK_OT_CHAR
Definition:
SkOTTableTypes.h:19
SK_SFNT_ULONG
uint32_t SK_SFNT_ULONG
Definition:
SkSFNTHeader.h:16
SK_SFNT_USHORT
uint16_t SK_SFNT_USHORT
Definition:
SkSFNTHeader.h:15
SkOTTableTAG
Definition:
SkOTTableTypes.h:37
SkSFNTHeader::TableDirectoryEntry
Definition:
SkSFNTHeader.h:56
SkSFNTHeader::TableDirectoryEntry::offset
SK_SFNT_ULONG offset
Definition:
SkSFNTHeader.h:59
SkSFNTHeader::TableDirectoryEntry::logicalLength
SK_SFNT_ULONG logicalLength
Definition:
SkSFNTHeader.h:60
SkSFNTHeader::TableDirectoryEntry::checksum
SK_SFNT_ULONG checksum
Definition:
SkSFNTHeader.h:58
SkSFNTHeader::TableDirectoryEntry::tag
SK_SFNT_ULONG tag
Definition:
SkSFNTHeader.h:57
SkSFNTHeader::fontType_MacTrueType
Definition:
SkSFNTHeader.h:29
SkSFNTHeader::fontType_MacTrueType::TAG3
static const SK_OT_CHAR TAG3
Definition:
SkSFNTHeader.h:33
SkSFNTHeader::fontType_MacTrueType::TAG1
static const SK_OT_CHAR TAG1
Definition:
SkSFNTHeader.h:31
SkSFNTHeader::fontType_MacTrueType::TAG2
static const SK_OT_CHAR TAG2
Definition:
SkSFNTHeader.h:32
SkSFNTHeader::fontType_MacTrueType::TAG
static const SK_OT_ULONG TAG
Definition:
SkSFNTHeader.h:34
SkSFNTHeader::fontType_MacTrueType::TAG0
static const SK_OT_CHAR TAG0
Definition:
SkSFNTHeader.h:30
SkSFNTHeader::fontType_OpenTypeCFF
Definition:
SkSFNTHeader.h:43
SkSFNTHeader::fontType_OpenTypeCFF::TAG1
static const SK_OT_CHAR TAG1
Definition:
SkSFNTHeader.h:45
SkSFNTHeader::fontType_OpenTypeCFF::TAG3
static const SK_OT_CHAR TAG3
Definition:
SkSFNTHeader.h:47
SkSFNTHeader::fontType_OpenTypeCFF::TAG
static const SK_OT_ULONG TAG
Definition:
SkSFNTHeader.h:48
SkSFNTHeader::fontType_OpenTypeCFF::TAG2
static const SK_OT_CHAR TAG2
Definition:
SkSFNTHeader.h:46
SkSFNTHeader::fontType_OpenTypeCFF::TAG0
static const SK_OT_CHAR TAG0
Definition:
SkSFNTHeader.h:44
SkSFNTHeader::fontType_PostScript
Definition:
SkSFNTHeader.h:36
SkSFNTHeader::fontType_PostScript::TAG0
static const SK_OT_CHAR TAG0
Definition:
SkSFNTHeader.h:37
SkSFNTHeader::fontType_PostScript::TAG1
static const SK_OT_CHAR TAG1
Definition:
SkSFNTHeader.h:38
SkSFNTHeader::fontType_PostScript::TAG3
static const SK_OT_CHAR TAG3
Definition:
SkSFNTHeader.h:40
SkSFNTHeader::fontType_PostScript::TAG2
static const SK_OT_CHAR TAG2
Definition:
SkSFNTHeader.h:39
SkSFNTHeader::fontType_PostScript::TAG
static const SK_OT_ULONG TAG
Definition:
SkSFNTHeader.h:41
SkSFNTHeader::fontType_WindowsTrueType
Definition:
SkSFNTHeader.h:22
SkSFNTHeader::fontType_WindowsTrueType::TAG
static const SK_OT_ULONG TAG
Definition:
SkSFNTHeader.h:27
SkSFNTHeader::fontType_WindowsTrueType::TAG2
static const SK_OT_CHAR TAG2
Definition:
SkSFNTHeader.h:25
SkSFNTHeader::fontType_WindowsTrueType::TAG3
static const SK_OT_CHAR TAG3
Definition:
SkSFNTHeader.h:26
SkSFNTHeader::fontType_WindowsTrueType::TAG1
static const SK_OT_CHAR TAG1
Definition:
SkSFNTHeader.h:24
SkSFNTHeader::fontType_WindowsTrueType::TAG0
static const SK_OT_CHAR TAG0
Definition:
SkSFNTHeader.h:23
SkSFNTHeader
Definition:
SkFontStream.cpp:17
SkSFNTHeader::rangeShift
SK_SFNT_USHORT rangeShift
Definition:
SkSFNTHeader.h:54
SkSFNTHeader::searchRange
SK_SFNT_USHORT searchRange
Definition:
SkSFNTHeader.h:52
SkSFNTHeader::entrySelector
SK_SFNT_USHORT entrySelector
Definition:
SkSFNTHeader.h:53
SkSFNTHeader::fontType
SK_SFNT_ULONG fontType
Definition:
SkSFNTHeader.h:21
SkSFNTHeader::numTables
SK_SFNT_USHORT numTables
Definition:
SkSFNTHeader.h:51
Generated on Sun Jun 23 2024 21:56:32 for Flutter Engine by
1.9.4