31 struct FeatureRecord {
35 uint32_t feature_tag = 0;
36 DataVector<uint16_t> lookup_list_indices;
44 uint16_t start_coverage_index = 0;
54 SubTable(
const SubTable& that) =
delete;
55 SubTable& operator=(
const SubTable& that) =
delete;
56 SubTable(SubTable&& that)
noexcept;
57 SubTable& operator=(SubTable&& that)
noexcept;
60 CoverageFormat coverage;
63 absl::variant<absl::monostate, int16_t, DataVector<uint16_t>> table_data;
67 using SubTables = std::vector<SubTable>;
70 Lookup(
const Lookup& that) =
delete;
71 Lookup& operator=(
const Lookup& that) =
delete;
72 Lookup(Lookup&& that)
noexcept;
73 Lookup& operator=(Lookup&& that)
noexcept;
76 uint16_t lookup_type = 0;
80 bool LoadGSUBTable(pdfium::span<
const uint8_t> gsub);
81 void Parse(pdfium::span<
const uint8_t> scriptlist,
82 pdfium::span<
const uint8_t> featurelist,
83 pdfium::span<
const uint8_t> lookuplist);
84 void ParseScriptList(pdfium::span<
const uint8_t> raw);
85 ScriptRecord ParseScript(
const uint8_t* raw);
86 FeatureIndices ParseLangSys(
const uint8_t* raw);
87 void ParseFeatureList(pdfium::span<
const uint8_t> raw);
88 DataVector<uint16_t> ParseFeatureLookupListIndices(
const uint8_t* raw);
89 void ParseLookupList(pdfium::span<
const uint8_t> raw);
90 Lookup ParseLookup(
const uint8_t* raw);
91 CoverageFormat ParseCoverage(
const uint8_t* raw);
92 SubTable ParseSingleSubst(
const uint8_t* raw);
94 absl::optional<uint32_t> GetVerticalGlyphSub(
const FeatureRecord& feature,
95 uint32_t glyphnum)
const;
96 absl::optional<uint32_t> GetVerticalGlyphSub2(
const Lookup& lookup,
97 uint32_t glyphnum)
const;
98 int GetCoverageIndex(
const CoverageFormat& coverage, uint32_t g)
const;
100 uint8_t GetUInt8(
const uint8_t*& p)
const;
101 int16_t GetInt16(
const uint8_t*& p)
const;
102 uint16_t GetUInt16(
const uint8_t*& p)
const;
103 int32_t GetInt32(
const uint8_t*& p)
const;
104 uint32_t GetUInt32(
const uint8_t*& p)
const;
106 std::set<uint32_t> feature_set_;
107 std::vector<ScriptRecord> script_list_;
108 std::vector<FeatureRecord> feature_list_;
109 std::vector<Lookup> lookup_list_;