summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cfx_cttgsubtable.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-11 05:37:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-11 05:37:47 +0000
commit0c7cf97859dd38f2cd94532cdd423abff7130853 (patch)
tree94f98372f3a5735fce9cd819f46f067b6214d6b0 /core/fpdfapi/font/cfx_cttgsubtable.h
parent74d2389d206da5638b642ca8084e140cfbf04c92 (diff)
downloadpdfium-0c7cf97859dd38f2cd94532cdd423abff7130853.tar.xz
Cleanup CFX_CTTGSUBTable.chromium/3521chromium/3520
Do all the parsing inside the constructor. Make GetVerticalGlyph() and related getters const methods. Change-Id: I21118cf98048cb6bbfc0999604d2434d4acafef6 Reviewed-on: https://pdfium-review.googlesource.com/39496 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/font/cfx_cttgsubtable.h')
-rw-r--r--core/fpdfapi/font/cfx_cttgsubtable.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/core/fpdfapi/font/cfx_cttgsubtable.h b/core/fpdfapi/font/cfx_cttgsubtable.h
index fc1caf5ef2..ff488a5ed7 100644
--- a/core/fpdfapi/font/cfx_cttgsubtable.h
+++ b/core/fpdfapi/font/cfx_cttgsubtable.h
@@ -17,11 +17,10 @@
class CFX_CTTGSUBTable {
public:
- CFX_CTTGSUBTable();
+ explicit CFX_CTTGSUBTable(FT_Bytes gsub);
~CFX_CTTGSUBTable();
- bool LoadGSUBTable(FT_Bytes gsub);
- bool GetVerticalGlyph(uint32_t glyphnum, uint32_t* vglyphnum);
+ uint32_t GetVerticalGlyph(uint32_t glyphnum) const;
private:
struct TLangSysRecord {
@@ -118,6 +117,7 @@ class CFX_CTTGSUBTable {
std::vector<std::unique_ptr<TSubTableBase>> SubTables;
};
+ bool LoadGSUBTable(FT_Bytes gsub);
bool Parse(FT_Bytes scriptlist, FT_Bytes featurelist, FT_Bytes lookuplist);
void ParseScriptList(FT_Bytes raw);
void ParseScript(FT_Bytes raw, TScriptRecord* rec);
@@ -133,12 +133,12 @@ class CFX_CTTGSUBTable {
void ParseSingleSubstFormat1(FT_Bytes raw, TSubTable1* rec);
void ParseSingleSubstFormat2(FT_Bytes raw, TSubTable2* rec);
- bool GetVerticalGlyphSub(uint32_t glyphnum,
- uint32_t* vglyphnum,
- TFeatureRecord* Feature);
- bool GetVerticalGlyphSub2(uint32_t glyphnum,
- uint32_t* vglyphnum,
- TLookup* Lookup);
+ bool GetVerticalGlyphSub(const TFeatureRecord& feature,
+ uint32_t glyphnum,
+ uint32_t* vglyphnum) const;
+ bool GetVerticalGlyphSub2(const TLookup& lookup,
+ uint32_t glyphnum,
+ uint32_t* vglyphnum) const;
int GetCoverageIndex(TCoverageFormatBase* Coverage, uint32_t g) const;
uint8_t GetUInt8(FT_Bytes& p) const;
@@ -148,7 +148,6 @@ class CFX_CTTGSUBTable {
uint32_t GetUInt32(FT_Bytes& p) const;
std::set<uint32_t> m_featureSet;
- bool m_bFeautureMapLoad;
std::vector<TScriptRecord> ScriptList;
std::vector<TFeatureRecord> FeatureList;
std::vector<TLookup> LookupList;