Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_simplefont.h
Go to the documentation of this file.
1// Copyright 2016 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FPDFAPI_FONT_CPDF_SIMPLEFONT_H_
8#define CORE_FPDFAPI_FONT_CPDF_SIMPLEFONT_H_
9
10#include <stdint.h>
11
12#include <vector>
13
14#include "core/fpdfapi/font/cpdf_font.h"
15#include "core/fpdfapi/font/cpdf_fontencoding.h"
16#include "core/fxcrt/fx_string.h"
17
18class CPDF_SimpleFont : public CPDF_Font {
19 public:
20 ~CPDF_SimpleFont() override;
21
22 // CPDF_Font
23 int GetCharWidthF(uint32_t charcode) override;
24 FX_RECT GetCharBBox(uint32_t charcode) override;
25 int GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) override;
26 bool IsUnicodeCompatible() const override;
27 WideString UnicodeFromCharCode(uint32_t charcode) const override;
28 uint32_t CharCodeFromUnicode(wchar_t Unicode) const override;
29
30 const CPDF_FontEncoding* GetEncoding() const { return &m_Encoding; }
31
32 bool HasFontWidths() const override;
33
34 protected:
35 static constexpr size_t kInternalTableSize = 256;
36
38 RetainPtr<CPDF_Dictionary> pFontDict);
39
40 virtual void LoadGlyphMap() = 0;
41
42 bool LoadCommon();
43 void LoadSubstFont();
44 void LoadCharMetrics(int charcode);
45 void LoadCharWidths(const CPDF_Dictionary* font_desc);
46 void LoadDifferences(const CPDF_Dictionary* encoding);
47 void LoadPDFEncoding(bool bEmbedded, bool bTrueType);
48
51 bool m_bUseFontWidth = false;
53 uint16_t m_GlyphIndex[kInternalTableSize];
54 uint16_t m_CharWidth[kInternalTableSize];
55 FX_RECT m_CharBBox[kInternalTableSize];
56};
57
58#endif // CORE_FPDFAPI_FONT_CPDF_SIMPLEFONT_H_
float GetLineDashPhase() const
float GetLineWidth() const
CFX_GraphStateData::LineCap GetLineCap() const
CFX_GraphStateData::LineJoin GetLineJoin() const
bool HasRef() const
const CPDF_Color * GetStrokeColor() const
const CPDF_Color * GetFillColor() const
bool GetRGB(int *R, int *G, int *B) const
bool IsColorSpaceRGB() const
const ByteString & GetName() const
const ByteString & GetPropertyName() const
ParamType GetParamType() const
const CFX_Matrix & form_matrix() const
float GetStrokeAlpha() const
BlendMode GetBlendType() const
ByteString GetBlendMode() const
void SetImage(RetainPtr< CPDF_Image > pImage)
const CFX_Matrix & matrix() const
bool ProcessPageObjects(fxcrt::ostringstream *buf)
CPDF_PageContentGenerator(CPDF_PageObjectHolder *pObjHolder)
void UpdateStream(size_t stream_index, fxcrt::ostringstream *buf)
size_t AddStream(fxcrt::ostringstream *buf)
CPDF_PageContentManager(CPDF_PageObjectHolder *page_obj_holder, CPDF_Document *document)
const CPDF_ColorState & color_state() const
void SetDirty(bool value)
const CPDF_GeneralState & general_state() const
const ByteString & GetResourceName() const
const CPDF_ClipPath & clip_path() const
virtual Type GetType() const =0
CPDF_GeneralState & mutable_general_state()
const CPDF_ContentMarks * GetContentMarks() const
void SetResourceName(const ByteString &resource_name)
const CFX_GraphState & graph_state() const
bool has_winding_filltype() const
bool stroke() const
const CFX_Matrix & matrix() const
bool has_alternate_filltype() const
bool has_no_filltype() const
bool IsRect() const
Definition cpdf_path.cpp:37
CPDF_SimpleFont(CPDF_Document *pDocument, RetainPtr< CPDF_Dictionary > pFontDict)
std::vector< ByteString > m_CharNames
~CPDF_SimpleFont() override
uint16_t m_GlyphIndex[kInternalTableSize]
int GlyphFromCharCode(uint32_t charcode, bool *pVertGlyph) override
static constexpr size_t kInternalTableSize
int GetCharWidthF(uint32_t charcode) override
void LoadCharMetrics(int charcode)
CPDF_FontEncoding m_Encoding
uint32_t CharCodeFromUnicode(wchar_t Unicode) const override
bool IsUnicodeCompatible() const override
void LoadCharWidths(const CPDF_Dictionary *font_desc)
FX_RECT m_CharBBox[kInternalTableSize]
FX_RECT GetCharBBox(uint32_t charcode) override
void LoadPDFEncoding(bool bEmbedded, bool bTrueType)
uint16_t m_CharWidth[kInternalTableSize]
FontEncoding m_BaseEncoding
bool HasFontWidths() const override
void LoadDifferences(const CPDF_Dictionary *encoding)
const CPDF_FontEncoding * GetEncoding() const
WideString UnicodeFromCharCode(uint32_t charcode) const override
virtual void LoadGlyphMap()=0
~CPDF_StringArchiveStream() override
CPDF_StringArchiveStream(fxcrt::ostringstream *stream)
FX_FILESIZE CurrentOffset() const override
bool WriteBlock(pdfium::span< const uint8_t > buffer) override
CFX_Matrix GetTextMatrix() const
float GetFontSize() const
TextRenderingMode GetTextRenderMode() const
bool IsTrueTypeFont() const override
void LoadGlyphMap() override
CPDF_TrueTypeFont * AsTrueTypeFont() override
const CPDF_TrueTypeFont * AsTrueTypeFont() const override
~CPDF_TrueTypeFont() override
static ByteString Format(const char *pFormat,...)
ByteString & operator=(ByteString &&that) noexcept
bool IsEmpty() const
Definition bytestring.h:119
CharType operator[](const size_t index) const
Definition bytestring.h:150
FontEncoding
ByteString PDF_NameEncode(const ByteString &orig)
BlendMode
Definition fx_dib.h:49
#define FX_FILESIZE
Definition fx_types.h:19
#define CHECK(cvref)
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:224