#include "core/fpdfdoc/cpdf_bafontmap.h"
#include <memory>
#include <utility>
#include "constants/annotation_common.h"
#include "core/fpdfapi/font/cpdf_font.h"
#include "core/fpdfapi/font/cpdf_fontencoding.h"
#include "core/fpdfapi/page/cpdf_docpagedata.h"
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_parser.h"
#include "core/fpdfapi/parser/cpdf_reference.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/fpdf_parser_utility.h"
#include "core/fpdfdoc/cpdf_defaultappearance.h"
#include "core/fpdfdoc/cpdf_formfield.h"
#include "core/fpdfdoc/ipvt_fontmap.h"
#include "core/fxcrt/fx_codepage.h"
#include "core/fxcrt/stl_util.h"
#include "core/fxge/cfx_fontmapper.h"
#include "core/fxge/cfx_fontmgr.h"
#include "core/fxge/cfx_gemodule.h"
namespace {
bool FindNativeTrueTypeFont(ByteStringView sFontFaceName) { … }
RetainPtr<CPDF_Font> AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc,
ByteString sFontFaceName,
FX_Charset nCharset) { … }
ByteString EncodeFontAlias(ByteString sFontName, FX_Charset nCharset) { … }
}
CPDF_BAFontMap::Data::Data() = default;
CPDF_BAFontMap::Data::~Data() = default;
CPDF_BAFontMap::CPDF_BAFontMap(CPDF_Document* pDocument,
RetainPtr<CPDF_Dictionary> pAnnotDict,
const ByteString& sAPType)
: … { … }
CPDF_BAFontMap::~CPDF_BAFontMap() = default;
RetainPtr<CPDF_Font> CPDF_BAFontMap::GetPDFFont(int32_t nFontIndex) { … }
ByteString CPDF_BAFontMap::GetPDFFontAlias(int32_t nFontIndex) { … }
int32_t CPDF_BAFontMap::GetWordFontIndex(uint16_t word,
FX_Charset nCharset,
int32_t nFontIndex) { … }
int32_t CPDF_BAFontMap::CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) { … }
FX_Charset CPDF_BAFontMap::CharSetFromUnicode(uint16_t word,
FX_Charset nOldCharset) { … }
FX_Charset CPDF_BAFontMap::GetNativeCharset() { … }
RetainPtr<CPDF_Font> CPDF_BAFontMap::FindFontSameCharset(ByteString* sFontAlias,
FX_Charset nCharset) { … }
RetainPtr<CPDF_Font> CPDF_BAFontMap::FindResFontSameCharset(
const CPDF_Dictionary* pResDict,
ByteString* sFontAlias,
FX_Charset nCharset) { … }
RetainPtr<CPDF_Font> CPDF_BAFontMap::GetAnnotDefaultFont(ByteString* sAlias) { … }
void CPDF_BAFontMap::AddFontToAnnotDict(const RetainPtr<CPDF_Font>& pFont,
const ByteString& sAlias) { … }
bool CPDF_BAFontMap::KnowWord(int32_t nFontIndex, uint16_t word) { … }
int32_t CPDF_BAFontMap::GetFontIndex(const ByteString& sFontName,
FX_Charset nCharset,
bool bFind) { … }
int32_t CPDF_BAFontMap::AddFontData(const RetainPtr<CPDF_Font>& pFont,
const ByteString& sFontAlias,
FX_Charset nCharset) { … }
int32_t CPDF_BAFontMap::FindFont(const ByteString& sFontName,
FX_Charset nCharset) { … }
ByteString CPDF_BAFontMap::GetNativeFontName(FX_Charset nCharset) { … }
ByteString CPDF_BAFontMap::GetCachedNativeFontName(FX_Charset nCharset) { … }
RetainPtr<CPDF_Font> CPDF_BAFontMap::AddFontToDocument(ByteString sFontName,
FX_Charset nCharset) { … }
RetainPtr<CPDF_Font> CPDF_BAFontMap::AddStandardFont(ByteString sFontName) { … }
RetainPtr<CPDF_Font> CPDF_BAFontMap::AddSystemFont(ByteString sFontName,
FX_Charset nCharset) { … }