35 if (fontData->
read(&sfntHeader,
sizeof(sfntHeader)) <
sizeof(sfntHeader)) {
43 for (tableIndex = 0; tableIndex < numTables; ++tableIndex) {
44 if (fontData->
read(&tableEntry,
sizeof(tableEntry)) <
sizeof(tableEntry)) {
51 if (tableIndex == numTables) {
60 static constexpr std::array<SkOTTableName::Record::NameID::Predefined::Value, 5>
names{{
69 static constexpr std::array<SkOTTableName::Record::EncodingID::Windows::Value, 2> encodings{{
79 size_t nameTablePhysicalSize = (nameTableLogicalSize + 3) & ~3;
85 size_t originalDataSize = fontData->
getLength() - oldNameTablePhysicalSize;
86 size_t newDataSize = originalDataSize + nameTablePhysicalSize;
91 if (fontData->
read(
data, oldNameTableOffset) < oldNameTableOffset) {
94 if (fontData->
skip(oldNameTablePhysicalSize) < oldNameTablePhysicalSize) {
97 if (fontData->
read(
data + oldNameTableOffset, originalDataSize - oldNameTableOffset) < originalDataSize - oldNameTableOffset) {
105 for (; currentEntry < endEntry; ++currentEntry) {
107 if (oldOffset > oldNameTableOffset) {
112 headTableEntry = currentEntry;
129 for (
const auto& encoding : encodings) {
142 for (
int i = 0;
i < fontNameLen; ++
i) {
146 unsigned char* logical =
data + originalDataSize + nameTableLogicalSize;
147 unsigned char* physical =
data + originalDataSize + nameTablePhysicalSize;
148 for (; logical < physical; ++logical) {
156 if (headTableEntry) {
158 if (headTableOffset +
sizeof(
SkOTTableHead) < originalDataSize) {
166 return rewrittenFontData.release();
176 if (0 == nameTableSize) {
179 std::unique_ptr<uint8_t[]> nameTableData(
new uint8_t[nameTableSize]);
180 size_t copied = typeface.
getTableData(nameTag, 0, nameTableSize, nameTableData.get());
181 if (copied != nameTableSize) {
192 return Make(typeface,
193 SkOTUtils::LocalizedStrings_NameTable::familyNameTypes,
194 std::size(SkOTUtils::LocalizedStrings_NameTable::familyNameTypes));
200 if (fFamilyNameIter.next(record)) {
205 if (fTypesCount == fTypesIndex + 1) {
209 fFamilyNameIter.
reset(fTypes[fTypesIndex]);
213SK_OT_USHORT SkOTUtils::LocalizedStrings_NameTable::familyNameTypes[3] = {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define SkEndian_SwapBE32(n)
#define SkEndian_SwapBE16(n)
constexpr uint16_t SkToU16(S x)
static constexpr bool SkToBool(const T &x)
constexpr uint32_t SkToU32(S x)
static constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d)
static sk_sp< SkData > MakeUninitialized(size_t length)
size_t getLength() const override=0
virtual size_t read(void *buffer, size_t size)=0
size_t getTableSize(SkFontTableTag) const
size_t getTableData(SkFontTableTag tag, size_t offset, size_t length, void *data) const
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
static const char *const names[]
DEF_SWITCHES_START aot vmservice shared library name
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
@ kNotEmbeddable_FontFlag
May not be embedded.
@ kNotSubsettable_FontFlag
May not be subset.
SK_OT_ULONG checksumAdjustment
static const SK_OT_ULONG TAG
static const uint32_t fontChecksum
enum SkOTTableName::Record::EncodingID::Windows::Value value
enum SkOTTableName::Record::LanguageID::Windows::Value value
enum SkOTTableName::Record::NameID::Predefined::Value value
struct SkOTTableName::Record::PlatformID platformID
union SkOTTableName::Record::NameID nameID
union SkOTTableName::Record::LanguageID languageID
union SkOTTableName::Record::EncodingID encodingID
static const SK_OT_USHORT format_0
SK_OT_USHORT stringOffset
static const SK_OT_ULONG TAG
static uint32_t CalcTableChecksum(SK_OT_ULONG *data, size_t length)
static SkData * RenameFont(SkStreamAsset *fontData, const char *fontName, int fontNameLen)
static void SetAdvancedTypefaceFlags(SkOTTableOS2_V4::Type fsType, SkAdvancedTypefaceMetrics *info)
std::shared_ptr< const fml::Mapping > data
struct SkOTTableName::Record::EncodingID::Windows windows
struct SkOTTableName::Record::LanguageID::Windows windows
struct SkOTTableName::Record::NameID::Predefined predefined
struct SkOTTableOS2_V4::Type::Field field
struct SkOTTableOS2_V4::Type::Raw raw