summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/font')
-rw-r--r--core/fpdfapi/font/cpdf_fontglobals.h29
1 files changed, 9 insertions, 20 deletions
diff --git a/core/fpdfapi/font/cpdf_fontglobals.h b/core/fpdfapi/font/cpdf_fontglobals.h
index 2663490925..d5156aae65 100644
--- a/core/fpdfapi/font/cpdf_fontglobals.h
+++ b/core/fpdfapi/font/cpdf_fontglobals.h
@@ -29,36 +29,25 @@ class CPDF_FontGlobals {
uint32_t index,
std::unique_ptr<CPDF_Font> pFont);
- void SetEmbeddedCharset(size_t idx, const FXCMAP_CMap* map, uint32_t count) {
- m_EmbeddedCharsets[idx].m_pMapList = map;
- m_EmbeddedCharsets[idx].m_Count = count;
+ void SetEmbeddedCharset(size_t idx, pdfium::span<const FXCMAP_CMap> map) {
+ m_EmbeddedCharsets[idx] = map;
}
- std::pair<uint32_t, const FXCMAP_CMap*> GetEmbeddedCharset(size_t idx) const {
- return {m_EmbeddedCharsets[idx].m_Count,
- m_EmbeddedCharsets[idx].m_pMapList.Get()};
+ pdfium::span<const FXCMAP_CMap> GetEmbeddedCharset(size_t idx) const {
+ return m_EmbeddedCharsets[idx];
}
- void SetEmbeddedToUnicode(size_t idx, const uint16_t* map, uint32_t count) {
- m_EmbeddedToUnicodes[idx].m_pMap = map;
- m_EmbeddedToUnicodes[idx].m_Count = count;
+ void SetEmbeddedToUnicode(size_t idx, pdfium::span<const uint16_t> map) {
+ m_EmbeddedToUnicodes[idx] = map;
}
pdfium::span<const uint16_t> GetEmbeddedToUnicode(size_t idx) {
- return pdfium::make_span(m_EmbeddedToUnicodes[idx].m_pMap,
- m_EmbeddedToUnicodes[idx].m_Count);
+ return m_EmbeddedToUnicodes[idx];
}
CPDF_CMapManager* GetCMapManager() { return &m_CMapManager; }
private:
CPDF_CMapManager m_CMapManager;
- struct {
- UnownedPtr<const FXCMAP_CMap> m_pMapList;
- uint32_t m_Count;
- } m_EmbeddedCharsets[CIDSET_NUM_SETS];
- struct {
- const uint16_t* m_pMap;
- uint32_t m_Count;
- } m_EmbeddedToUnicodes[CIDSET_NUM_SETS];
-
+ pdfium::span<const FXCMAP_CMap> m_EmbeddedCharsets[CIDSET_NUM_SETS];
+ pdfium::span<const uint16_t> m_EmbeddedToUnicodes[CIDSET_NUM_SETS];
std::map<CPDF_Document*, std::unique_ptr<CFX_StockFontArray>> m_StockMap;
};