Rename most "pFont" instances to "font"
Mass rename some common variable names to follow Google C++ style. Also
rename most "pFontFoo" instances to "font_foo".
Bug: 42271580
Change-Id: I8e625265372d39551d273802249dcacbbde0ff25
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/132310
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
index f21d51d..1ed6ee8 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
@@ -946,44 +946,44 @@
WriteMatrix(*buf, matrix) << " Tm ";
}
- RetainPtr<CPDF_Font> pFont(pTextObj->GetFont());
- if (!pFont) {
- pFont = CPDF_Font::GetStockFont(document_, "Helvetica");
+ RetainPtr<CPDF_Font> font(pTextObj->GetFont());
+ if (!font) {
+ font = CPDF_Font::GetStockFont(document_, "Helvetica");
}
FontData data;
const CPDF_FontEncoding* pEncoding = nullptr;
- if (pFont->IsType1Font()) {
+ if (font->IsType1Font()) {
data.type = "Type1";
- pEncoding = pFont->AsType1Font()->GetEncoding();
- } else if (pFont->IsTrueTypeFont()) {
+ pEncoding = font->AsType1Font()->GetEncoding();
+ } else if (font->IsTrueTypeFont()) {
data.type = "TrueType";
- pEncoding = pFont->AsTrueTypeFont()->GetEncoding();
- } else if (pFont->IsCIDFont()) {
+ pEncoding = font->AsTrueTypeFont()->GetEncoding();
+ } else if (font->IsCIDFont()) {
data.type = "Type0";
} else {
return;
}
- data.baseFont = pFont->GetBaseFontName();
+ data.baseFont = font->GetBaseFontName();
ByteString dict_name;
std::optional<ByteString> maybe_name = obj_holder_->FontsMapSearch(data);
if (maybe_name.has_value()) {
dict_name = std::move(maybe_name.value());
} else {
- RetainPtr<const CPDF_Object> pIndirectFont = pFont->GetFontDict();
+ RetainPtr<const CPDF_Object> pIndirectFont = font->GetFontDict();
if (pIndirectFont->IsInline()) {
// In this case we assume it must be a standard font
- auto pFontDict = pdfium::MakeRetain<CPDF_Dictionary>();
- pFontDict->SetNewFor<CPDF_Name>("Type", "Font");
- pFontDict->SetNewFor<CPDF_Name>("Subtype", data.type);
- pFontDict->SetNewFor<CPDF_Name>("BaseFont", data.baseFont);
+ auto font_dict = pdfium::MakeRetain<CPDF_Dictionary>();
+ font_dict->SetNewFor<CPDF_Name>("Type", "Font");
+ font_dict->SetNewFor<CPDF_Name>("Subtype", data.type);
+ font_dict->SetNewFor<CPDF_Name>("BaseFont", data.baseFont);
if (pEncoding) {
- pFontDict->SetFor("Encoding",
+ font_dict->SetFor("Encoding",
pEncoding->Realize(document_->GetByteStringPool()));
}
- document_->AddIndirectObject(pFontDict);
- pIndirectFont = std::move(pFontDict);
+ document_->AddIndirectObject(font_dict);
+ pIndirectFont = std::move(font_dict);
}
dict_name = RealizeResource(std::move(pIndirectFont), "Font");
obj_holder_->FontsMapInsert(data, dict_name);
@@ -996,7 +996,7 @@
ByteString text;
for (uint32_t charcode : pTextObj->GetCharCodes()) {
if (charcode != CPDF_Font::kInvalidCharCode) {
- pFont->AppendChar(&text, charcode);
+ font->AppendChar(&text, charcode);
}
}
*buf << PDF_HexEncodeString(text.AsStringView()) << " Tj ET";
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
index f276a24..38e3f95 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
@@ -345,12 +345,12 @@
pDict->SetNewFor<CPDF_Name>("Type", "Font");
pDict->SetNewFor<CPDF_Name>("Subtype", "TrueType");
- RetainPtr<CPDF_Font> pFont = CPDF_Font::GetStockFont(pDoc.get(), "Arial");
- pDict->SetNewFor<CPDF_Name>("BaseFont", pFont->GetBaseFontName());
+ RetainPtr<CPDF_Font> font = CPDF_Font::GetStockFont(pDoc.get(), "Arial");
+ pDict->SetNewFor<CPDF_Name>("BaseFont", font->GetBaseFontName());
auto pDesc = pDoc->NewIndirect<CPDF_Dictionary>();
pDesc->SetNewFor<CPDF_Name>("Type", "FontDescriptor");
- pDesc->SetNewFor<CPDF_Name>("FontName", pFont->GetBaseFontName());
+ pDesc->SetNewFor<CPDF_Name>("FontName", font->GetBaseFontName());
pDict->SetNewFor<CPDF_Reference>("FontDescriptor", pDoc.get(),
pDesc->GetObjNum());
diff --git a/core/fpdfapi/font/cfx_stockfontarray.cpp b/core/fpdfapi/font/cfx_stockfontarray.cpp
index b09005b..cebf6b4 100644
--- a/core/fpdfapi/font/cfx_stockfontarray.cpp
+++ b/core/fpdfapi/font/cfx_stockfontarray.cpp
@@ -34,8 +34,8 @@
}
void CFX_StockFontArray::SetFont(CFX_FontMapper::StandardFont index,
- RetainPtr<CPDF_Font> pFont) {
+ RetainPtr<CPDF_Font> font) {
if (index < std::size(stock_fonts_)) {
- stock_fonts_[index] = std::move(pFont);
+ stock_fonts_[index] = std::move(font);
}
}
diff --git a/core/fpdfapi/font/cfx_stockfontarray.h b/core/fpdfapi/font/cfx_stockfontarray.h
index 646ac69..89cf30d 100644
--- a/core/fpdfapi/font/cfx_stockfontarray.h
+++ b/core/fpdfapi/font/cfx_stockfontarray.h
@@ -20,7 +20,7 @@
~CFX_StockFontArray();
RetainPtr<CPDF_Font> GetFont(CFX_FontMapper::StandardFont index) const;
- void SetFont(CFX_FontMapper::StandardFont index, RetainPtr<CPDF_Font> pFont);
+ void SetFont(CFX_FontMapper::StandardFont index, RetainPtr<CPDF_Font> font);
private:
std::array<RetainPtr<CPDF_Font>, 14> stock_fonts_;
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp
index bfd14e1..a1dc253 100644
--- a/core/fpdfapi/font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/font/cpdf_cidfont.cpp
@@ -282,8 +282,8 @@
} // namespace
CPDF_CIDFont::CPDF_CIDFont(CPDF_Document* document,
- RetainPtr<CPDF_Dictionary> pFontDict)
- : CPDF_Font(document, std::move(pFontDict)) {
+ RetainPtr<CPDF_Dictionary> font_dict)
+ : CPDF_Font(document, std::move(font_dict)) {
for (size_t i = 0; i < std::size(char_bbox_); ++i) {
char_bbox_[i] = FX_RECT(-1, -1, -1, -1);
}
@@ -427,13 +427,13 @@
return true;
}
- RetainPtr<const CPDF_Array> pFonts =
+ RetainPtr<const CPDF_Array> fonts =
font_dict_->GetArrayFor("DescendantFonts");
- if (!pFonts || pFonts->size() != 1) {
+ if (!fonts || fonts->size() != 1) {
return false;
}
- RetainPtr<const CPDF_Dictionary> pCIDFontDict = pFonts->GetDictAt(0);
+ RetainPtr<const CPDF_Dictionary> pCIDFontDict = fonts->GetDictAt(0);
if (!pCIDFontDict) {
return false;
}
@@ -461,7 +461,7 @@
return false;
}
- auto* pFontGlobals = CPDF_FontGlobals::GetInstance();
+ auto* font_globals = CPDF_FontGlobals::GetInstance();
const CPDF_Stream* pEncodingStream = pEncoding->AsStream();
if (pEncodingStream) {
auto pAcc =
@@ -472,13 +472,13 @@
} else {
DCHECK(pEncoding->IsName());
ByteString cmap = pEncoding->GetString();
- cmap_ = pFontGlobals->GetPredefinedCMap(cmap);
+ cmap_ = font_globals->GetPredefinedCMap(cmap);
}
- RetainPtr<const CPDF_Dictionary> pFontDesc =
+ RetainPtr<const CPDF_Dictionary> font_desc =
pCIDFontDict->GetDictFor("FontDescriptor");
- if (pFontDesc) {
- LoadFontDescriptor(pFontDesc.Get());
+ if (font_desc) {
+ LoadFontDescriptor(font_desc.Get());
}
charset_ = cmap_->GetCharset();
@@ -491,7 +491,7 @@
}
}
if (charset_ != CIDSET_UNKNOWN) {
- cid2unicode_map_ = pFontGlobals->GetCID2UnicodeMap(charset_);
+ cid2unicode_map_ = font_globals->GetCID2UnicodeMap(charset_);
}
RetainPtr<CFX_Face> face = font_.GetFace();
if (face) {
@@ -880,13 +880,13 @@
base_font_name_ = font_dict_->GetByteStringFor("BaseFont");
charset_ = CIDSET_GB1;
- auto* pFontGlobals = CPDF_FontGlobals::GetInstance();
- cmap_ = pFontGlobals->GetPredefinedCMap("GBK-EUC-H");
- cid2unicode_map_ = pFontGlobals->GetCID2UnicodeMap(charset_);
- RetainPtr<const CPDF_Dictionary> pFontDesc =
+ auto* font_globals = CPDF_FontGlobals::GetInstance();
+ cmap_ = font_globals->GetPredefinedCMap("GBK-EUC-H");
+ cid2unicode_map_ = font_globals->GetCID2UnicodeMap(charset_);
+ RetainPtr<const CPDF_Dictionary> font_desc =
font_dict_->GetDictFor("FontDescriptor");
- if (pFontDesc) {
- LoadFontDescriptor(pFontDesc.Get());
+ if (font_desc) {
+ LoadFontDescriptor(font_desc.Get());
}
if (!IsEmbedded()) {
diff --git a/core/fpdfapi/font/cpdf_cidfont.h b/core/fpdfapi/font/cpdf_cidfont.h
index 6c9535f..e4d2e01 100644
--- a/core/fpdfapi/font/cpdf_cidfont.h
+++ b/core/fpdfapi/font/cpdf_cidfont.h
@@ -79,7 +79,7 @@
kTrueType // CIDFontType2
};
- CPDF_CIDFont(CPDF_Document* document, RetainPtr<CPDF_Dictionary> pFontDict);
+ CPDF_CIDFont(CPDF_Document* document, RetainPtr<CPDF_Dictionary> font_dict);
void LoadGB2312();
int GetGlyphIndex(uint32_t unicodeb, bool* pVertGlyph);
diff --git a/core/fpdfapi/font/cpdf_font.cpp b/core/fpdfapi/font/cpdf_font.cpp
index fbb5f58..f2b0b85 100644
--- a/core/fpdfapi/font/cpdf_font.cpp
+++ b/core/fpdfapi/font/cpdf_font.cpp
@@ -48,9 +48,9 @@
} // namespace
CPDF_Font::CPDF_Font(CPDF_Document* document,
- RetainPtr<CPDF_Dictionary> pFontDict)
+ RetainPtr<CPDF_Dictionary> font_dict)
: document_(document),
- font_dict_(std::move(pFontDict)),
+ font_dict_(std::move(font_dict)),
base_font_name_(font_dict_->GetByteStringFor("BaseFont")) {}
CPDF_Font::~CPDF_Font() {
@@ -150,12 +150,12 @@
return true;
}
-void CPDF_Font::LoadFontDescriptor(const CPDF_Dictionary* pFontDesc) {
- flags_ = pFontDesc->GetIntegerFor("Flags", pdfium::kFontStyleNonSymbolic);
+void CPDF_Font::LoadFontDescriptor(const CPDF_Dictionary* font_desc) {
+ flags_ = font_desc->GetIntegerFor("Flags", pdfium::kFontStyleNonSymbolic);
int ItalicAngle = 0;
bool bExistItalicAngle = false;
- if (pFontDesc->KeyExist("ItalicAngle")) {
- ItalicAngle = pFontDesc->GetIntegerFor("ItalicAngle");
+ if (font_desc->KeyExist("ItalicAngle")) {
+ ItalicAngle = font_desc->GetIntegerFor("ItalicAngle");
bExistItalicAngle = true;
}
if (ItalicAngle < 0) {
@@ -163,22 +163,22 @@
italic_angle_ = ItalicAngle;
}
bool bExistStemV = false;
- if (pFontDesc->KeyExist("StemV")) {
- stem_v_ = pFontDesc->GetIntegerFor("StemV");
+ if (font_desc->KeyExist("StemV")) {
+ stem_v_ = font_desc->GetIntegerFor("StemV");
bExistStemV = true;
}
bool bExistAscent = false;
- if (pFontDesc->KeyExist("Ascent")) {
- ascent_ = pFontDesc->GetIntegerFor("Ascent");
+ if (font_desc->KeyExist("Ascent")) {
+ ascent_ = font_desc->GetIntegerFor("Ascent");
bExistAscent = true;
}
bool bExistDescent = false;
- if (pFontDesc->KeyExist("Descent")) {
- descent_ = pFontDesc->GetIntegerFor("Descent");
+ if (font_desc->KeyExist("Descent")) {
+ descent_ = font_desc->GetIntegerFor("Descent");
bExistDescent = true;
}
bool bExistCapHeight = false;
- if (pFontDesc->KeyExist("CapHeight")) {
+ if (font_desc->KeyExist("CapHeight")) {
bExistCapHeight = true;
}
if (bExistItalicAngle && bExistAscent && bExistCapHeight && bExistDescent &&
@@ -188,7 +188,7 @@
if (descent_ > 10) {
descent_ = -descent_;
}
- RetainPtr<const CPDF_Array> pBBox = pFontDesc->GetArrayFor("FontBBox");
+ RetainPtr<const CPDF_Array> pBBox = font_desc->GetArrayFor("FontBBox");
if (pBBox) {
font_bbox_.left = pBBox->GetIntegerAt(0);
font_bbox_.bottom = pBBox->GetIntegerAt(1);
@@ -196,19 +196,19 @@
font_bbox_.top = pBBox->GetIntegerAt(3);
}
- RetainPtr<const CPDF_Stream> pFontFile = pFontDesc->GetStreamFor("FontFile");
- if (!pFontFile) {
- pFontFile = pFontDesc->GetStreamFor("FontFile2");
+ RetainPtr<const CPDF_Stream> font_file = font_desc->GetStreamFor("FontFile");
+ if (!font_file) {
+ font_file = font_desc->GetStreamFor("FontFile2");
}
- if (!pFontFile) {
- pFontFile = pFontDesc->GetStreamFor("FontFile3");
+ if (!font_file) {
+ font_file = font_desc->GetStreamFor("FontFile3");
}
- if (!pFontFile) {
+ if (!font_file) {
return;
}
- const uint64_t key = pFontFile->KeyForCache();
- font_file_ = document_->GetFontFileStreamAcc(std::move(pFontFile));
+ const uint64_t key = font_file->KeyForCache();
+ font_file_ = document_->GetFontFileStreamAcc(std::move(font_file));
if (!font_file_) {
return;
}
@@ -288,10 +288,10 @@
return nullptr;
}
- auto* pFontGlobals = CPDF_FontGlobals::GetInstance();
- RetainPtr<CPDF_Font> pFont = pFontGlobals->Find(pDoc, font_id.value());
- if (pFont) {
- return pFont;
+ auto* font_globals = CPDF_FontGlobals::GetInstance();
+ RetainPtr<CPDF_Font> font = font_globals->Find(pDoc, font_id.value());
+ if (font) {
+ return font;
}
auto pDict = pDoc->New<CPDF_Dictionary>();
@@ -300,45 +300,45 @@
pDict->SetNewFor<CPDF_Name>("BaseFont", fontname);
pDict->SetNewFor<CPDF_Name>("Encoding",
pdfium::font_encodings::kWinAnsiEncoding);
- pFont = CPDF_Font::Create(nullptr, std::move(pDict), nullptr);
- pFontGlobals->Set(pDoc, font_id.value(), pFont);
- return pFont;
+ font = CPDF_Font::Create(nullptr, std::move(pDict), nullptr);
+ font_globals->Set(pDoc, font_id.value(), font);
+ return font;
}
// static
RetainPtr<CPDF_Font> CPDF_Font::Create(CPDF_Document* pDoc,
- RetainPtr<CPDF_Dictionary> pFontDict,
+ RetainPtr<CPDF_Dictionary> font_dict,
FormFactoryIface* pFactory) {
- ByteString type = pFontDict->GetByteStringFor("Subtype");
- RetainPtr<CPDF_Font> pFont;
+ ByteString type = font_dict->GetByteStringFor("Subtype");
+ RetainPtr<CPDF_Font> font;
if (type == "TrueType") {
- ByteString tag = pFontDict->GetByteStringFor("BaseFont").First(4);
+ ByteString tag = font_dict->GetByteStringFor("BaseFont").First(4);
for (const char* chinese_font_name : kChineseFontNames) {
if (tag == chinese_font_name) {
- RetainPtr<const CPDF_Dictionary> pFontDesc =
- pFontDict->GetDictFor("FontDescriptor");
- if (!pFontDesc || !pFontDesc->KeyExist("FontFile2")) {
- pFont = pdfium::MakeRetain<CPDF_CIDFont>(pDoc, std::move(pFontDict));
+ RetainPtr<const CPDF_Dictionary> font_desc =
+ font_dict->GetDictFor("FontDescriptor");
+ if (!font_desc || !font_desc->KeyExist("FontFile2")) {
+ font = pdfium::MakeRetain<CPDF_CIDFont>(pDoc, std::move(font_dict));
}
break;
}
}
- if (!pFont) {
- pFont = pdfium::MakeRetain<CPDF_TrueTypeFont>(pDoc, std::move(pFontDict));
+ if (!font) {
+ font = pdfium::MakeRetain<CPDF_TrueTypeFont>(pDoc, std::move(font_dict));
}
} else if (type == "Type3") {
- pFont = pdfium::MakeRetain<CPDF_Type3Font>(pDoc, std::move(pFontDict),
- pFactory);
+ font = pdfium::MakeRetain<CPDF_Type3Font>(pDoc, std::move(font_dict),
+ pFactory);
} else if (type == "Type0") {
- pFont = pdfium::MakeRetain<CPDF_CIDFont>(pDoc, std::move(pFontDict));
+ font = pdfium::MakeRetain<CPDF_CIDFont>(pDoc, std::move(font_dict));
} else {
- pFont = pdfium::MakeRetain<CPDF_Type1Font>(pDoc, std::move(pFontDict));
+ font = pdfium::MakeRetain<CPDF_Type1Font>(pDoc, std::move(font_dict));
}
- if (!pFont->Load()) {
+ if (!font->Load()) {
return nullptr;
}
- return pFont;
+ return font;
}
uint32_t CPDF_Font::GetNextChar(ByteStringView pString, size_t* pOffset) const {
@@ -361,11 +361,11 @@
}
std::optional<FX_Charset> CPDF_Font::GetSubstFontCharset() const {
- CFX_SubstFont* pFont = font_.GetSubstFont();
- if (!pFont) {
+ CFX_SubstFont* font = font_.GetSubstFont();
+ if (!font) {
return std::nullopt;
}
- return pFont->charset_;
+ return font->charset_;
}
// static
diff --git a/core/fpdfapi/font/cpdf_font.h b/core/fpdfapi/font/cpdf_font.h
index eb87666..8ffde74 100644
--- a/core/fpdfapi/font/cpdf_font.h
+++ b/core/fpdfapi/font/cpdf_font.h
@@ -63,7 +63,7 @@
// |pFactory| only required for Type3 fonts.
static RetainPtr<CPDF_Font> Create(CPDF_Document* pDoc,
- RetainPtr<CPDF_Dictionary> pFontDict,
+ RetainPtr<CPDF_Dictionary> font_dict,
FormFactoryIface* pFactory);
static RetainPtr<CPDF_Font> GetStockFont(CPDF_Document* pDoc,
ByteStringView fontname);
@@ -137,7 +137,7 @@
void SetResourceName(const ByteString& name) { resource_name_ = name; }
protected:
- CPDF_Font(CPDF_Document* document, RetainPtr<CPDF_Dictionary> pFontDict);
+ CPDF_Font(CPDF_Document* document, RetainPtr<CPDF_Dictionary> font_dict);
~CPDF_Font() override;
// Commonly used wrappers for UseTTCharmap().
@@ -161,7 +161,7 @@
virtual bool Load() = 0;
void LoadUnicodeMap() const; // logically const only.
- void LoadFontDescriptor(const CPDF_Dictionary* pFontDesc);
+ void LoadFontDescriptor(const CPDF_Dictionary* font_desc);
void CheckFontMetrics();
UnownedPtr<CPDF_Document> const document_;
diff --git a/core/fpdfapi/font/cpdf_fontglobals.cpp b/core/fpdfapi/font/cpdf_fontglobals.cpp
index e87c1c6..c4edcd6 100644
--- a/core/fpdfapi/font/cpdf_fontglobals.cpp
+++ b/core/fpdfapi/font/cpdf_fontglobals.cpp
@@ -75,12 +75,12 @@
void CPDF_FontGlobals::Set(CPDF_Document* pDoc,
CFX_FontMapper::StandardFont index,
- RetainPtr<CPDF_Font> pFont) {
+ RetainPtr<CPDF_Font> font) {
UnownedPtr<CPDF_Document> pKey(pDoc);
if (!pdfium::Contains(stock_map_, pKey)) {
stock_map_[pKey] = std::make_unique<CFX_StockFontArray>();
}
- stock_map_[pKey]->SetFont(index, std::move(pFont));
+ stock_map_[pKey]->SetFont(index, std::move(font));
}
void CPDF_FontGlobals::Clear(CPDF_Document* pDoc) {
diff --git a/core/fpdfapi/font/cpdf_fontglobals.h b/core/fpdfapi/font/cpdf_fontglobals.h
index e17dc56..92553cb 100644
--- a/core/fpdfapi/font/cpdf_fontglobals.h
+++ b/core/fpdfapi/font/cpdf_fontglobals.h
@@ -37,7 +37,7 @@
CFX_FontMapper::StandardFont index);
void Set(CPDF_Document* pDoc,
CFX_FontMapper::StandardFont index,
- RetainPtr<CPDF_Font> pFont);
+ RetainPtr<CPDF_Font> font);
void SetEmbeddedCharset(CIDSet idx, pdfium::span<const fxcmap::CMap> map) {
embedded_charsets_[idx] = map;
diff --git a/core/fpdfapi/font/cpdf_simplefont.cpp b/core/fpdfapi/font/cpdf_simplefont.cpp
index d091681..8470431 100644
--- a/core/fpdfapi/font/cpdf_simplefont.cpp
+++ b/core/fpdfapi/font/cpdf_simplefont.cpp
@@ -36,8 +36,8 @@
} // namespace
CPDF_SimpleFont::CPDF_SimpleFont(CPDF_Document* document,
- RetainPtr<CPDF_Dictionary> pFontDict)
- : CPDF_Font(document, std::move(pFontDict)) {
+ RetainPtr<CPDF_Dictionary> font_dict)
+ : CPDF_Font(document, std::move(font_dict)) {
char_width_.fill(0xffff);
glyph_index_.fill(0xffff);
char_bbox_.fill(FX_RECT(-1, -1, -1, -1));
@@ -243,12 +243,12 @@
}
bool CPDF_SimpleFont::LoadCommon() {
- RetainPtr<const CPDF_Dictionary> pFontDesc =
+ RetainPtr<const CPDF_Dictionary> font_desc =
font_dict_->GetDictFor("FontDescriptor");
- if (pFontDesc) {
- LoadFontDescriptor(pFontDesc.Get());
+ if (font_desc) {
+ LoadFontDescriptor(font_desc.Get());
}
- LoadCharWidths(pFontDesc.Get());
+ LoadCharWidths(font_desc.Get());
if (font_file_) {
if (base_font_name_.GetLength() > 7 && base_font_name_[6] == '+') {
base_font_name_ = base_font_name_.Last(base_font_name_.GetLength() - 7);
diff --git a/core/fpdfapi/font/cpdf_simplefont.h b/core/fpdfapi/font/cpdf_simplefont.h
index 5d46023..a81b05d 100644
--- a/core/fpdfapi/font/cpdf_simplefont.h
+++ b/core/fpdfapi/font/cpdf_simplefont.h
@@ -39,7 +39,7 @@
static constexpr size_t kInternalTableSize = 256;
CPDF_SimpleFont(CPDF_Document* document,
- RetainPtr<CPDF_Dictionary> pFontDict);
+ RetainPtr<CPDF_Dictionary> font_dict);
virtual void LoadGlyphMap() = 0;
diff --git a/core/fpdfapi/font/cpdf_truetypefont.cpp b/core/fpdfapi/font/cpdf_truetypefont.cpp
index b1b7f80..8fcdc41 100644
--- a/core/fpdfapi/font/cpdf_truetypefont.cpp
+++ b/core/fpdfapi/font/cpdf_truetypefont.cpp
@@ -36,8 +36,8 @@
} // namespace
CPDF_TrueTypeFont::CPDF_TrueTypeFont(CPDF_Document* document,
- RetainPtr<CPDF_Dictionary> pFontDict)
- : CPDF_SimpleFont(document, std::move(pFontDict)) {}
+ RetainPtr<CPDF_Dictionary> font_dict)
+ : CPDF_SimpleFont(document, std::move(font_dict)) {}
CPDF_TrueTypeFont::~CPDF_TrueTypeFont() = default;
diff --git a/core/fpdfapi/font/cpdf_truetypefont.h b/core/fpdfapi/font/cpdf_truetypefont.h
index 4ec3409..7f48d36 100644
--- a/core/fpdfapi/font/cpdf_truetypefont.h
+++ b/core/fpdfapi/font/cpdf_truetypefont.h
@@ -24,7 +24,7 @@
enum class CharmapType { kMSUnicode, kMSSymbol, kMacRoman, kOther };
CPDF_TrueTypeFont(CPDF_Document* document,
- RetainPtr<CPDF_Dictionary> pFontDict);
+ RetainPtr<CPDF_Dictionary> font_dict);
// CPDF_Font:
bool Load() override;
diff --git a/core/fpdfapi/font/cpdf_type1font.cpp b/core/fpdfapi/font/cpdf_type1font.cpp
index 66d826a..7b6f581 100644
--- a/core/fpdfapi/font/cpdf_type1font.cpp
+++ b/core/fpdfapi/font/cpdf_type1font.cpp
@@ -72,8 +72,8 @@
} // namespace
CPDF_Type1Font::CPDF_Type1Font(CPDF_Document* document,
- RetainPtr<CPDF_Dictionary> pFontDict)
- : CPDF_SimpleFont(document, std::move(pFontDict)) {
+ RetainPtr<CPDF_Dictionary> font_dict)
+ : CPDF_SimpleFont(document, std::move(font_dict)) {
#if BUILDFLAG(IS_APPLE)
ext_gid_.fill(0xffff);
#endif
@@ -99,10 +99,10 @@
return LoadCommon();
}
- RetainPtr<const CPDF_Dictionary> pFontDesc =
+ RetainPtr<const CPDF_Dictionary> font_desc =
font_dict_->GetDictFor("FontDescriptor");
- if (pFontDesc && pFontDesc->KeyExist("Flags")) {
- flags_ = pFontDesc->GetIntegerFor("Flags");
+ if (font_desc && font_desc->KeyExist("Flags")) {
+ flags_ = font_desc->GetIntegerFor("Flags");
} else if (IsSymbolicFont()) {
flags_ = pdfium::kFontStyleSymbolic;
} else {
diff --git a/core/fpdfapi/font/cpdf_type1font.h b/core/fpdfapi/font/cpdf_type1font.h
index 182734d..ca097b0 100644
--- a/core/fpdfapi/font/cpdf_type1font.h
+++ b/core/fpdfapi/font/cpdf_type1font.h
@@ -32,7 +32,7 @@
bool IsBase14Font() const { return base14_font_.has_value(); }
private:
- CPDF_Type1Font(CPDF_Document* document, RetainPtr<CPDF_Dictionary> pFontDict);
+ CPDF_Type1Font(CPDF_Document* document, RetainPtr<CPDF_Dictionary> font_dict);
// CPDF_Font:
bool Load() override;
diff --git a/core/fpdfapi/font/cpdf_type3font.cpp b/core/fpdfapi/font/cpdf_type3font.cpp
index 9752fb3..00d9529 100644
--- a/core/fpdfapi/font/cpdf_type3font.cpp
+++ b/core/fpdfapi/font/cpdf_type3font.cpp
@@ -26,9 +26,9 @@
} // namespace
CPDF_Type3Font::CPDF_Type3Font(CPDF_Document* document,
- RetainPtr<CPDF_Dictionary> pFontDict,
+ RetainPtr<CPDF_Dictionary> font_dict,
FormFactoryIface* pFormFactory)
- : CPDF_SimpleFont(document, std::move(pFontDict)),
+ : CPDF_SimpleFont(document, std::move(font_dict)),
form_factory_(pFormFactory) {
DCHECK(GetDocument());
}
diff --git a/core/fpdfapi/font/cpdf_type3font.h b/core/fpdfapi/font/cpdf_type3font.h
index 32fc29c..2653e02 100644
--- a/core/fpdfapi/font/cpdf_type3font.h
+++ b/core/fpdfapi/font/cpdf_type3font.h
@@ -45,7 +45,7 @@
private:
CPDF_Type3Font(CPDF_Document* document,
- RetainPtr<CPDF_Dictionary> pFontDict,
+ RetainPtr<CPDF_Dictionary> font_dict,
FormFactoryIface* pFormFactory);
// CPDF_Font:
diff --git a/core/fpdfapi/page/cpdf_allstates.cpp b/core/fpdfapi/page/cpdf_allstates.cpp
index 9a6c268..7ca03cf 100644
--- a/core/fpdfapi/page/cpdf_allstates.cpp
+++ b/core/fpdfapi/page/cpdf_allstates.cpp
@@ -79,14 +79,14 @@
mutable_general_state().SetRenderIntent(pObject->GetString());
break;
case FXBSTR_ID('F', 'o', 'n', 't'): {
- const CPDF_Array* pFont = pObject->AsArray();
- if (!pFont) {
+ const CPDF_Array* font = pObject->AsArray();
+ if (!font) {
break;
}
- mutable_text_state().SetFontSize(pFont->GetFloatAt(1));
+ mutable_text_state().SetFontSize(font->GetFloatAt(1));
mutable_text_state().SetFont(
- pParser->FindFont(pFont->GetByteStringAt(0)));
+ pParser->FindFont(font->GetByteStringAt(0)));
break;
}
case FXBSTR_ID('T', 'R', 0, 0):
diff --git a/core/fpdfapi/page/cpdf_docpagedata.cpp b/core/fpdfapi/page/cpdf_docpagedata.cpp
index 04de649..32bd86d 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.cpp
+++ b/core/fpdfapi/page/cpdf_docpagedata.cpp
@@ -87,7 +87,7 @@
}
#endif // BUILDFLAG(IS_WIN)
-void InsertWidthArray1(CFX_Font* pFont,
+void InsertWidthArray1(CFX_Font* font,
CFX_UnicodeEncoding* pEncoding,
wchar_t start,
wchar_t end,
@@ -95,7 +95,7 @@
std::vector<int> widths(end - start + 1);
for (size_t i = 0; i < widths.size(); ++i) {
int glyph_index = pEncoding->GlyphFromCharCode(start + i);
- widths[i] = pFont->GetGlyphWidth(glyph_index);
+ widths[i] = font->GetGlyphWidth(glyph_index);
}
InsertWidthArrayImpl(std::move(widths), pWidthArray);
}
@@ -157,16 +157,16 @@
int descend,
RetainPtr<CPDF_Array> bbox,
int32_t stemV) {
- auto pFontDesc = pDoc->New<CPDF_Dictionary>();
- pFontDesc->SetNewFor<CPDF_Name>("Type", "FontDescriptor");
- pFontDesc->SetNewFor<CPDF_Name>("FontName", basefont);
- pFontDesc->SetNewFor<CPDF_Number>("Flags", flags);
- pFontDesc->SetFor("FontBBox", bbox);
- pFontDesc->SetNewFor<CPDF_Number>("ItalicAngle", italicangle);
- pFontDesc->SetNewFor<CPDF_Number>("Ascent", ascend);
- pFontDesc->SetNewFor<CPDF_Number>("Descent", descend);
- pFontDesc->SetNewFor<CPDF_Number>("StemV", stemV);
- return pFontDesc;
+ auto font_desc = pDoc->New<CPDF_Dictionary>();
+ font_desc->SetNewFor<CPDF_Name>("Type", "FontDescriptor");
+ font_desc->SetNewFor<CPDF_Name>("FontName", basefont);
+ font_desc->SetNewFor<CPDF_Number>("Flags", flags);
+ font_desc->SetFor("FontBBox", bbox);
+ font_desc->SetNewFor<CPDF_Number>("ItalicAngle", italicangle);
+ font_desc->SetNewFor<CPDF_Number>("Ascent", ascend);
+ font_desc->SetNewFor<CPDF_Number>("Descent", descend);
+ font_desc->SetNewFor<CPDF_Number>("StemV", stemV);
+ return font_desc;
}
} // namespace
@@ -210,24 +210,23 @@
}
RetainPtr<CPDF_Font> CPDF_DocPageData::GetFont(
- RetainPtr<CPDF_Dictionary> pFontDict) {
- if (!pFontDict) {
+ RetainPtr<CPDF_Dictionary> font_dict) {
+ if (!font_dict) {
return nullptr;
}
- auto it = font_map_.find(pFontDict);
+ auto it = font_map_.find(font_dict);
if (it != font_map_.end() && it->second) {
return pdfium::WrapRetain(it->second.Get());
}
- RetainPtr<CPDF_Font> pFont =
- CPDF_Font::Create(GetDocument(), pFontDict, this);
- if (!pFont) {
+ RetainPtr<CPDF_Font> font = CPDF_Font::Create(GetDocument(), font_dict, this);
+ if (!font) {
return nullptr;
}
- font_map_[std::move(pFontDict)].Reset(pFont.Get());
- return pFont;
+ font_map_[std::move(font_dict)].Reset(font.Get());
+ return font;
}
RetainPtr<CPDF_Font> CPDF_DocPageData::GetStandardFont(
@@ -238,29 +237,29 @@
}
for (auto& it : font_map_) {
- CPDF_Font* pFont = it.second.Get();
- if (!pFont) {
+ CPDF_Font* font = it.second.Get();
+ if (!font) {
continue;
}
- if (pFont->GetBaseFontName() != fontName) {
+ if (font->GetBaseFontName() != fontName) {
continue;
}
- if (pFont->IsEmbedded()) {
+ if (font->IsEmbedded()) {
continue;
}
- if (!pFont->IsType1Font()) {
+ if (!font->IsType1Font()) {
continue;
}
- if (pFont->GetFontDict()->KeyExist("Widths")) {
+ if (font->GetFontDict()->KeyExist("Widths")) {
continue;
}
- CPDF_Type1Font* pT1Font = pFont->AsType1Font();
+ CPDF_Type1Font* pT1Font = font->AsType1Font();
if (pEncoding && !pT1Font->GetEncoding()->IsIdentical(pEncoding)) {
continue;
}
- return pdfium::WrapRetain(pFont);
+ return pdfium::WrapRetain(font);
}
auto pDict = GetDocument()->NewIndirect<CPDF_Dictionary>();
@@ -273,13 +272,13 @@
}
// Note: NULL FormFactoryIface OK since known Type1 font from above.
- RetainPtr<CPDF_Font> pFont = CPDF_Font::Create(GetDocument(), pDict, nullptr);
- if (!pFont) {
+ RetainPtr<CPDF_Font> font = CPDF_Font::Create(GetDocument(), pDict, nullptr);
+ if (!font) {
return nullptr;
}
- font_map_[std::move(pDict)].Reset(pFont.Get());
- return pFont;
+ font_map_[std::move(pDict)].Reset(font.Get());
+ return font;
}
RetainPtr<CPDF_ColorSpace> CPDF_DocPageData::GetColorSpace(
@@ -480,17 +479,17 @@
}
RetainPtr<CPDF_StreamAcc> CPDF_DocPageData::GetFontFileStreamAcc(
- RetainPtr<const CPDF_Stream> pFontStream) {
- DCHECK(pFontStream);
- auto it = font_file_map_.find(pFontStream);
+ RetainPtr<const CPDF_Stream> font_stream) {
+ DCHECK(font_stream);
+ auto it = font_file_map_.find(font_stream);
if (it != font_file_map_.end()) {
return it->second;
}
- RetainPtr<const CPDF_Dictionary> pFontDict = pFontStream->GetDict();
- int32_t len1 = pFontDict->GetIntegerFor("Length1");
- int32_t len2 = pFontDict->GetIntegerFor("Length2");
- int32_t len3 = pFontDict->GetIntegerFor("Length3");
+ RetainPtr<const CPDF_Dictionary> font_dict = font_stream->GetDict();
+ int32_t len1 = font_dict->GetIntegerFor("Length1");
+ int32_t len2 = font_dict->GetIntegerFor("Length2");
+ int32_t len3 = font_dict->GetIntegerFor("Length3");
uint32_t org_size = 0;
if (len1 >= 0 && len2 >= 0 && len3 >= 0) {
FX_SAFE_UINT32 safe_org_size = len1;
@@ -499,10 +498,10 @@
org_size = safe_org_size.ValueOrDefault(0);
}
- auto pFontAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pFontStream);
- pFontAcc->LoadAllDataFilteredWithEstimatedSize(org_size);
- font_file_map_[std::move(pFontStream)] = pFontAcc;
- return pFontAcc;
+ auto font_acc = pdfium::MakeRetain<CPDF_StreamAcc>(font_stream);
+ font_acc->LoadAllDataFilteredWithEstimatedSize(org_size);
+ font_file_map_[std::move(font_stream)] = font_acc;
+ return font_acc;
}
void CPDF_DocPageData::MaybePurgeFontFileStreamAcc(
@@ -511,13 +510,13 @@
return;
}
- RetainPtr<const CPDF_Stream> pFontStream = pStreamAcc->GetStream();
- if (!pFontStream) {
+ RetainPtr<const CPDF_Stream> font_stream = pStreamAcc->GetStream();
+ if (!font_stream) {
return;
}
pStreamAcc.Reset(); // Drop moved caller's reference.
- auto it = font_file_map_.find(pFontStream);
+ auto it = font_file_map_.find(font_stream);
if (it != font_file_map_.end() && it->second->HasOneRef()) {
font_file_map_.erase(it);
}
@@ -543,29 +542,29 @@
return GetStandardFont(mutable_name, pEncoding);
}
-RetainPtr<CPDF_Font> CPDF_DocPageData::AddFont(std::unique_ptr<CFX_Font> pFont,
+RetainPtr<CPDF_Font> CPDF_DocPageData::AddFont(std::unique_ptr<CFX_Font> font,
FX_Charset charset) {
- if (!pFont) {
+ if (!font) {
return nullptr;
}
const bool bCJK = FX_CharSetIsCJK(charset);
- ByteString basefont = pFont->GetFamilyName();
+ ByteString basefont = font->GetFamilyName();
basefont.Replace(" ", "");
int flags =
- CalculateFlags(pFont->IsBold(), pFont->IsItalic(), pFont->IsFixedWidth(),
+ CalculateFlags(font->IsBold(), font->IsItalic(), font->IsFixedWidth(),
false, false, charset == FX_Charset::kSymbol);
auto pBaseDict = GetDocument()->NewIndirect<CPDF_Dictionary>();
pBaseDict->SetNewFor<CPDF_Name>("Type", "Font");
- auto pEncoding = std::make_unique<CFX_UnicodeEncoding>(pFont.get());
- RetainPtr<CPDF_Dictionary> pFontDict = pBaseDict;
+ auto pEncoding = std::make_unique<CFX_UnicodeEncoding>(font.get());
+ RetainPtr<CPDF_Dictionary> font_dict = pBaseDict;
if (!bCJK) {
auto pWidths = pdfium::MakeRetain<CPDF_Array>();
for (int charcode = 32; charcode < 128; charcode++) {
int glyph_index = pEncoding->GlyphFromCharCode(charcode);
- int char_width = pFont->GetGlyphWidth(glyph_index);
+ int char_width = font->GetGlyphWidth(glyph_index);
pWidths->AppendNew<CPDF_Number>(char_width);
}
if (charset == FX_Charset::kANSI || charset == FX_Charset::kDefault ||
@@ -574,7 +573,7 @@
pdfium::font_encodings::kWinAnsiEncoding);
for (int charcode = 128; charcode <= 255; charcode++) {
int glyph_index = pEncoding->GlyphFromCharCode(charcode);
- int char_width = pFont->GetGlyphWidth(glyph_index);
+ int char_width = font->GetGlyphWidth(glyph_index);
pWidths->AppendNew<CPDF_Number>(char_width);
}
} else {
@@ -584,49 +583,49 @@
kFX_CharsetUnicodes[i].unicodes_;
for (int j = 0; j < 128; j++) {
int glyph_index = pEncoding->GlyphFromCharCode(pUnicodes[j]);
- int char_width = pFont->GetGlyphWidth(glyph_index);
+ int char_width = font->GetGlyphWidth(glyph_index);
pWidths->AppendNew<CPDF_Number>(char_width);
}
}
}
- ProcessNonbCJK(pBaseDict, pFont->IsBold(), pFont->IsItalic(), basefont,
+ ProcessNonbCJK(pBaseDict, font->IsBold(), font->IsItalic(), basefont,
std::move(pWidths));
} else {
- pFontDict = ProcessbCJK(
+ font_dict = ProcessbCJK(
pBaseDict, charset, basefont,
- [&pFont, &pEncoding](wchar_t start, wchar_t end, CPDF_Array* widthArr) {
- InsertWidthArray1(pFont.get(), pEncoding.get(), start, end, widthArr);
+ [&font, &pEncoding](wchar_t start, wchar_t end, CPDF_Array* widthArr) {
+ InsertWidthArray1(font.get(), pEncoding.get(), start, end, widthArr);
});
}
- int italicangle = pFont->GetSubstFontItalicAngle();
- FX_RECT bbox = pFont->GetBBox().value_or(FX_RECT());
+ int italicangle = font->GetSubstFontItalicAngle();
+ FX_RECT bbox = font->GetBBox().value_or(FX_RECT());
auto pBBox = pdfium::MakeRetain<CPDF_Array>();
pBBox->AppendNew<CPDF_Number>(bbox.left);
pBBox->AppendNew<CPDF_Number>(bbox.bottom);
pBBox->AppendNew<CPDF_Number>(bbox.right);
pBBox->AppendNew<CPDF_Number>(bbox.top);
int32_t nStemV = 0;
- if (pFont->GetSubstFont()) {
- nStemV = pFont->GetSubstFont()->weight_ / 5;
+ if (font->GetSubstFont()) {
+ nStemV = font->GetSubstFont()->weight_ / 5;
} else {
static constexpr char kStemChars[] = {'i', 'I', '!', '1'};
static constexpr pdfium::span<const char> kStemSpan{kStemChars};
uint32_t glyph = pEncoding->GlyphFromCharCode(kStemSpan.front());
const auto remaining = kStemSpan.subspan<1>();
- nStemV = pFont->GetGlyphWidth(glyph);
+ nStemV = font->GetGlyphWidth(glyph);
for (auto ch : remaining) {
glyph = pEncoding->GlyphFromCharCode(ch);
- int width = pFont->GetGlyphWidth(glyph);
+ int width = font->GetGlyphWidth(glyph);
if (width > 0 && width < nStemV) {
nStemV = width;
}
}
}
- RetainPtr<CPDF_Dictionary> pFontDesc = CalculateFontDesc(
- GetDocument(), basefont, flags, italicangle, pFont->GetAscent(),
- pFont->GetDescent(), std::move(pBBox), nStemV);
- uint32_t new_objnum = GetDocument()->AddIndirectObject(std::move(pFontDesc));
- pFontDict->SetNewFor<CPDF_Reference>("FontDescriptor", GetDocument(),
+ RetainPtr<CPDF_Dictionary> font_desc = CalculateFontDesc(
+ GetDocument(), basefont, flags, italicangle, font->GetAscent(),
+ font->GetDescent(), std::move(pBBox), nStemV);
+ uint32_t new_objnum = GetDocument()->AddIndirectObject(std::move(font_desc));
+ font_dict->SetNewFor<CPDF_Reference>("FontDescriptor", GetDocument(),
new_objnum);
return GetFont(pBaseDict);
}
@@ -677,7 +676,7 @@
basefont.Replace(" ", "");
auto pBaseDict = GetDocument()->NewIndirect<CPDF_Dictionary>();
pBaseDict->SetNewFor<CPDF_Name>("Type", "Font");
- RetainPtr<CPDF_Dictionary> pFontDict = pBaseDict;
+ RetainPtr<CPDF_Dictionary> font_dict = pBaseDict;
if (!bCJK) {
if (eCharset == FX_Charset::kANSI || eCharset == FX_Charset::kDefault ||
eCharset == FX_Charset::kSymbol) {
@@ -695,7 +694,7 @@
ProcessNonbCJK(pBaseDict, pLogFont->lfWeight > FW_MEDIUM,
pLogFont->lfItalic != 0, basefont, std::move(pWidths));
} else {
- pFontDict =
+ font_dict =
ProcessbCJK(pBaseDict, eCharset, basefont,
[&hDC](wchar_t start, wchar_t end, CPDF_Array* widthArr) {
InsertWidthArray(hDC, start, end, widthArr);
@@ -705,12 +704,12 @@
for (const auto bound : bbox) {
pBBox->AppendNew<CPDF_Number>(bound);
}
- RetainPtr<CPDF_Dictionary> pFontDesc =
+ RetainPtr<CPDF_Dictionary> font_desc =
CalculateFontDesc(GetDocument(), basefont, flags, italicangle, ascend,
descend, std::move(pBBox), pLogFont->lfWeight / 5);
- pFontDesc->SetNewFor<CPDF_Number>("CapHeight", capheight);
- GetDocument()->AddIndirectObject(pFontDesc);
- pFontDict->SetFor("FontDescriptor", pFontDesc->MakeReference(GetDocument()));
+ font_desc->SetNewFor<CPDF_Number>("CapHeight", capheight);
+ GetDocument()->AddIndirectObject(font_desc);
+ font_dict->SetFor("FontDescriptor", font_desc->MakeReference(GetDocument()));
hFont = SelectObject(hDC, hFont);
DeleteObject(hFont);
DeleteDC(hDC);
@@ -752,11 +751,11 @@
FX_Charset charset,
ByteString basefont,
std::function<void(wchar_t, wchar_t, CPDF_Array*)> Insert) {
- auto pFontDict = GetDocument()->NewIndirect<CPDF_Dictionary>();
+ auto font_dict = GetDocument()->NewIndirect<CPDF_Dictionary>();
ByteString cmap;
ByteString ordering;
int supplement = 0;
- auto pWidthArray = pFontDict->SetNewFor<CPDF_Array>("W");
+ auto pWidthArray = font_dict->SetNewFor<CPDF_Array>("W");
switch (charset) {
case FX_Charset::kChineseTraditional:
cmap = "ETenms-B5-H";
@@ -800,16 +799,16 @@
pBaseDict->SetNewFor<CPDF_Name>("Subtype", "Type0");
pBaseDict->SetNewFor<CPDF_Name>("BaseFont", basefont);
pBaseDict->SetNewFor<CPDF_Name>("Encoding", cmap);
- pFontDict->SetNewFor<CPDF_Name>("Type", "Font");
- pFontDict->SetNewFor<CPDF_Name>("Subtype", "CIDFontType2");
- pFontDict->SetNewFor<CPDF_Name>("BaseFont", basefont);
+ font_dict->SetNewFor<CPDF_Name>("Type", "Font");
+ font_dict->SetNewFor<CPDF_Name>("Subtype", "CIDFontType2");
+ font_dict->SetNewFor<CPDF_Name>("BaseFont", basefont);
- auto pCIDSysInfo = pFontDict->SetNewFor<CPDF_Dictionary>("CIDSystemInfo");
+ auto pCIDSysInfo = font_dict->SetNewFor<CPDF_Dictionary>("CIDSystemInfo");
pCIDSysInfo->SetNewFor<CPDF_String>("Registry", "Adobe");
pCIDSysInfo->SetNewFor<CPDF_String>("Ordering", ordering);
pCIDSysInfo->SetNewFor<CPDF_Number>("Supplement", supplement);
auto pArray = pBaseDict->SetNewFor<CPDF_Array>("DescendantFonts");
- pArray->AppendNew<CPDF_Reference>(GetDocument(), pFontDict->GetObjNum());
- return pFontDict;
+ pArray->AppendNew<CPDF_Reference>(GetDocument(), font_dict->GetObjNum());
+ return font_dict;
}
diff --git a/core/fpdfapi/page/cpdf_docpagedata.h b/core/fpdfapi/page/cpdf_docpagedata.h
index 9430799..ed90d27 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.h
+++ b/core/fpdfapi/page/cpdf_docpagedata.h
@@ -41,7 +41,7 @@
// CPDF_Document::PageDataIface:
void ClearStockFont() override;
RetainPtr<CPDF_StreamAcc> GetFontFileStreamAcc(
- RetainPtr<const CPDF_Stream> pFontStream) override;
+ RetainPtr<const CPDF_Stream> font_stream) override;
void MaybePurgeFontFileStreamAcc(
RetainPtr<CPDF_StreamAcc>&& pStreamAcc) override;
void MaybePurgeImage(uint32_t dwStreamObjNum) override;
@@ -54,9 +54,9 @@
bool IsForceClear() const { return force_clear_; }
- RetainPtr<CPDF_Font> AddFont(std::unique_ptr<CFX_Font> pFont,
+ RetainPtr<CPDF_Font> AddFont(std::unique_ptr<CFX_Font> font,
FX_Charset charset);
- RetainPtr<CPDF_Font> GetFont(RetainPtr<CPDF_Dictionary> pFontDict);
+ RetainPtr<CPDF_Font> GetFont(RetainPtr<CPDF_Dictionary> font_dict);
RetainPtr<CPDF_Font> AddStandardFont(const ByteString& fontName,
const CPDF_FontEncoding* pEncoding);
RetainPtr<CPDF_Font> GetStandardFont(const ByteString& fontName,
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index d5d4506..642d1d8 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -1191,9 +1191,9 @@
void CPDF_StreamContentParser::Handle_SetFont() {
cur_states_->mutable_text_state().SetFontSize(GetNumber(0));
- RetainPtr<CPDF_Font> pFont = FindFont(GetString(1));
- if (pFont) {
- cur_states_->mutable_text_state().SetFont(std::move(pFont));
+ RetainPtr<CPDF_Font> font = FindFont(GetString(1));
+ if (font) {
+ cur_states_->mutable_text_state().SetFont(std::move(font));
}
}
@@ -1225,23 +1225,23 @@
RetainPtr<CPDF_Font> CPDF_StreamContentParser::FindFont(
const ByteString& name) {
- RetainPtr<CPDF_Dictionary> pFontDict(
+ RetainPtr<CPDF_Dictionary> font_dict(
ToDictionary(FindResourceObj("Font", name)));
- if (!pFontDict) {
+ if (!font_dict) {
return CPDF_Font::GetStockFont(document_, CFX_Font::kDefaultAnsiFontName);
}
- RetainPtr<CPDF_Font> pFont =
- CPDF_DocPageData::FromDocument(document_)->GetFont(std::move(pFontDict));
- if (pFont) {
+ RetainPtr<CPDF_Font> font =
+ CPDF_DocPageData::FromDocument(document_)->GetFont(std::move(font_dict));
+ if (font) {
// Save `name` for later retrieval by the CPDF_TextObject that uses the
// font.
- pFont->SetResourceName(name);
- if (pFont->IsType3Font()) {
- pFont->AsType3Font()->SetPageResources(resources_.Get());
- pFont->AsType3Font()->CheckType3FontMetrics();
+ font->SetResourceName(name);
+ if (font->IsType3Font()) {
+ font->AsType3Font()->SetPageResources(resources_.Get());
+ font->AsType3Font()->CheckType3FontMetrics();
}
}
- return pFont;
+ return font;
}
CPDF_PageObjectHolder::CTMMap CPDF_StreamContentParser::TakeAllCTMs() {
@@ -1307,12 +1307,12 @@
pdfium::span<const ByteString> strings,
pdfium::span<const float> kernings,
float initial_kerning) {
- RetainPtr<CPDF_Font> pFont = cur_states_->text_state().GetFont();
- if (!pFont) {
+ RetainPtr<CPDF_Font> font = cur_states_->text_state().GetFont();
+ if (!font) {
return;
}
if (initial_kerning != 0) {
- if (pFont->IsVertWriting()) {
+ if (font->IsVertWriting()) {
cur_states_->IncrementTextPositionY(
-GetVerticalTextSize(initial_kerning));
} else {
@@ -1324,11 +1324,11 @@
return;
}
const TextRenderingMode text_mode =
- pFont->IsType3Font() ? TextRenderingMode::MODE_FILL
- : cur_states_->text_state().GetTextMode();
+ font->IsType3Font() ? TextRenderingMode::MODE_FILL
+ : cur_states_->text_state().GetTextMode();
{
auto pText = std::make_unique<CPDF_TextObject>(GetCurrentStreamIndex());
- pText->SetResourceName(pFont->GetResourceName());
+ pText->SetResourceName(font->GetResourceName());
SetGraphicStates(pText.get(), true, true, true);
if (TextRenderingModeIsStrokeMode(text_mode)) {
const CFX_Matrix& ctm = cur_states_->current_transformation_matrix();
@@ -1353,7 +1353,7 @@
object_holder_->AppendPageObject(std::move(pText));
}
if (!kernings.empty() && kernings.back() != 0) {
- if (pFont->IsVertWriting()) {
+ if (font->IsVertWriting()) {
cur_states_->IncrementTextPositionY(
-GetVerticalTextSize(kernings.back()));
} else {
diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp
index 3907ee3..624b21e 100644
--- a/core/fpdfapi/page/cpdf_textobject.cpp
+++ b/core/fpdfapi/page/cpdf_textobject.cpp
@@ -52,8 +52,8 @@
return info;
}
- RetainPtr<CPDF_Font> pFont = GetFont();
- const CPDF_CIDFont* pCIDFont = pFont->AsCIDFont();
+ RetainPtr<CPDF_Font> font = GetFont();
+ const CPDF_CIDFont* pCIDFont = font->AsCIDFont();
if (!IsVertWritingCIDFont(pCIDFont)) {
return info;
}
@@ -107,13 +107,13 @@
}
int CPDF_TextObject::CountWords() const {
- RetainPtr<CPDF_Font> pFont = GetFont();
+ RetainPtr<CPDF_Font> font = GetFont();
bool bInLatinWord = false;
int nWords = 0;
for (size_t i = 0, sz = CountChars(); i < sz; ++i) {
uint32_t charcode = GetCharCode(i);
- WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
+ WideString swUnicode = font->UnicodeFromCharCode(charcode);
uint16_t unicode = 0;
if (swUnicode.GetLength() > 0) {
unicode = swUnicode[0];
@@ -134,14 +134,14 @@
}
WideString CPDF_TextObject::GetWordString(int nWordIndex) const {
- RetainPtr<CPDF_Font> pFont = GetFont();
+ RetainPtr<CPDF_Font> font = GetFont();
WideString swRet;
int nWords = 0;
bool bInLatinWord = false;
for (size_t i = 0, sz = CountChars(); i < sz; ++i) {
uint32_t charcode = GetCharCode(i);
- WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
+ WideString swUnicode = font->UnicodeFromCharCode(charcode);
uint16_t unicode = 0;
if (swUnicode.GetLength() > 0) {
unicode = swUnicode[0];
@@ -213,10 +213,10 @@
CHECK(nSegs);
char_codes_.clear();
char_pos_.clear();
- RetainPtr<CPDF_Font> pFont = GetFont();
+ RetainPtr<CPDF_Font> font = GetFont();
size_t nChars = nSegs - 1;
for (const auto& str : strings) {
- nChars += pFont->CountChar(str.AsStringView());
+ nChars += font->CountChar(str.AsStringView());
}
CHECK(nChars);
char_codes_.resize(nChars);
@@ -227,7 +227,7 @@
size_t offset = 0;
while (offset < segment.GetLength()) {
DCHECK(index < char_codes_.size());
- char_codes_[index++] = pFont->GetNextChar(segment, &offset);
+ char_codes_[index++] = font->GetNextChar(segment, &offset);
}
if (i != nSegs - 1) {
char_pos_[index - 1] = kernings[i];
@@ -244,10 +244,10 @@
float CPDF_TextObject::GetCharWidth(uint32_t charcode) const {
const float fontsize = GetFontSize() / 1000;
- RetainPtr<CPDF_Font> pFont = GetFont();
- const CPDF_CIDFont* pCIDFont = pFont->AsCIDFont();
+ RetainPtr<CPDF_Font> font = GetFont();
+ const CPDF_CIDFont* pCIDFont = font->AsCIDFont();
if (!IsVertWritingCIDFont(pCIDFont)) {
- return pFont->GetCharWidthF(charcode) * fontsize;
+ return font->GetCharWidthF(charcode) * fontsize;
}
uint16_t cid = pCIDFont->CIDFromCharCode(charcode);
@@ -272,22 +272,22 @@
}
CFX_PointF CPDF_TextObject::CalcPositionData(float horz_scale) {
- RetainPtr<CPDF_Font> pFont = GetFont();
- const float curpos = CalcPositionDataInternal(pFont);
- if (IsVertWritingCIDFont(pFont->AsCIDFont())) {
+ RetainPtr<CPDF_Font> font = GetFont();
+ const float curpos = CalcPositionDataInternal(font);
+ if (IsVertWritingCIDFont(font->AsCIDFont())) {
return {0, curpos};
}
return {curpos * horz_scale, 0};
}
float CPDF_TextObject::CalcPositionDataInternal(
- const RetainPtr<CPDF_Font>& pFont) {
+ const RetainPtr<CPDF_Font>& font) {
float curpos = 0;
float min_x = 10000.0f;
float max_x = -10000.0f;
float min_y = 10000.0f;
float max_y = -10000.0f;
- const CPDF_CIDFont* pCIDFont = pFont->AsCIDFont();
+ const CPDF_CIDFont* pCIDFont = font->AsCIDFont();
const bool bVertWriting = IsVertWritingCIDFont(pCIDFont);
const float fontsize = GetFontSize();
@@ -301,7 +301,7 @@
char_pos_[i - 1] = curpos;
}
- FX_RECT char_rect = pFont->GetCharBBox(charcode);
+ FX_RECT char_rect = font->GetCharBBox(charcode);
float charwidth;
if (bVertWriting) {
uint16_t cid = pCIDFont->CIDFromCharCode(charcode);
@@ -325,7 +325,7 @@
const float char_right = curpos + char_rect.right * fontsize / 1000;
min_x = std::min({min_x, char_left, char_right});
max_x = std::max({max_x, char_left, char_right});
- charwidth = pFont->GetCharWidthF(charcode) * fontsize / 1000;
+ charwidth = font->GetCharWidthF(charcode) * fontsize / 1000;
}
curpos += charwidth;
if (charcode == ' ' && (!pCIDFont || pCIDFont->GetCharSize(' ') == 1)) {
diff --git a/core/fpdfapi/page/cpdf_textobject.h b/core/fpdfapi/page/cpdf_textobject.h
index e823900..2415b76 100644
--- a/core/fpdfapi/page/cpdf_textobject.h
+++ b/core/fpdfapi/page/cpdf_textobject.h
@@ -77,7 +77,7 @@
CFX_PointF CalcPositionData(float horz_scale);
private:
- float CalcPositionDataInternal(const RetainPtr<CPDF_Font>& pFont);
+ float CalcPositionDataInternal(const RetainPtr<CPDF_Font>& font);
CFX_PointF pos_;
std::vector<uint32_t> char_codes_;
diff --git a/core/fpdfapi/page/cpdf_textstate.cpp b/core/fpdfapi/page/cpdf_textstate.cpp
index 17e1e3b..ab6008c 100644
--- a/core/fpdfapi/page/cpdf_textstate.cpp
+++ b/core/fpdfapi/page/cpdf_textstate.cpp
@@ -29,8 +29,8 @@
return ref_.GetObject()->font_;
}
-void CPDF_TextState::SetFont(RetainPtr<CPDF_Font> pFont) {
- ref_.GetPrivateCopy()->SetFont(std::move(pFont));
+void CPDF_TextState::SetFont(RetainPtr<CPDF_Font> font) {
+ ref_.GetPrivateCopy()->SetFont(std::move(font));
}
float CPDF_TextState::GetFontSize() const {
@@ -116,9 +116,9 @@
return pdfium::MakeRetain<CPDF_TextState::TextData>(*this);
}
-void CPDF_TextState::TextData::SetFont(RetainPtr<CPDF_Font> pFont) {
- document_ = pFont ? pFont->GetDocument() : nullptr;
- font_ = std::move(pFont);
+void CPDF_TextState::TextData::SetFont(RetainPtr<CPDF_Font> font) {
+ document_ = font ? font->GetDocument() : nullptr;
+ font_ = std::move(font);
}
float CPDF_TextState::TextData::GetFontSizeH() const {
diff --git a/core/fpdfapi/page/cpdf_textstate.h b/core/fpdfapi/page/cpdf_textstate.h
index 3e325f7..81f8916 100644
--- a/core/fpdfapi/page/cpdf_textstate.h
+++ b/core/fpdfapi/page/cpdf_textstate.h
@@ -41,7 +41,7 @@
void Emplace();
RetainPtr<CPDF_Font> GetFont() const;
- void SetFont(RetainPtr<CPDF_Font> pFont);
+ void SetFont(RetainPtr<CPDF_Font> font);
float GetFontSize() const;
void SetFontSize(float size);
@@ -70,7 +70,7 @@
RetainPtr<TextData> Clone() const;
- void SetFont(RetainPtr<CPDF_Font> pFont);
+ void SetFont(RetainPtr<CPDF_Font> font);
float GetFontSizeV() const;
float GetFontSizeH() const;
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index e13c159..8604909 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -472,8 +472,8 @@
}
RetainPtr<CPDF_StreamAcc> CPDF_Document::GetFontFileStreamAcc(
- RetainPtr<const CPDF_Stream> pFontStream) {
- return doc_page_->GetFontFileStreamAcc(std::move(pFontStream));
+ RetainPtr<const CPDF_Stream> font_stream) {
+ return doc_page_->GetFontFileStreamAcc(std::move(font_stream));
}
void CPDF_Document::MaybePurgeFontFileStreamAcc(
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index f38516f..0aeea56 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -52,7 +52,7 @@
virtual void ClearStockFont() = 0;
virtual RetainPtr<CPDF_StreamAcc> GetFontFileStreamAcc(
- RetainPtr<const CPDF_Stream> pFontStream) = 0;
+ RetainPtr<const CPDF_Stream> font_stream) = 0;
virtual void MaybePurgeFontFileStreamAcc(
RetainPtr<CPDF_StreamAcc>&& pStreamAcc) = 0;
virtual void MaybePurgeImage(uint32_t objnum) = 0;
@@ -118,7 +118,7 @@
// PageDataIface wrappers, try to avoid explicit getter calls.
RetainPtr<CPDF_StreamAcc> GetFontFileStreamAcc(
- RetainPtr<const CPDF_Stream> pFontStream);
+ RetainPtr<const CPDF_Stream> font_stream);
void MaybePurgeFontFileStreamAcc(RetainPtr<CPDF_StreamAcc>&& pStreamAcc);
void MaybePurgeImage(uint32_t objnum);
diff --git a/core/fpdfapi/render/cpdf_textrenderer.h b/core/fpdfapi/render/cpdf_textrenderer.h
index 1a5ecea..4119ee6 100644
--- a/core/fpdfapi/render/cpdf_textrenderer.h
+++ b/core/fpdfapi/render/cpdf_textrenderer.h
@@ -26,7 +26,7 @@
static void DrawTextString(CFX_RenderDevice* pDevice,
float origin_x,
float origin_y,
- CPDF_Font* pFont,
+ CPDF_Font* font,
float font_size,
const CFX_Matrix& matrix,
const ByteString& str,
@@ -36,7 +36,7 @@
static bool DrawTextPath(CFX_RenderDevice* pDevice,
pdfium::span<const uint32_t> char_codes,
pdfium::span<const float> char_pos,
- CPDF_Font* pFont,
+ CPDF_Font* font,
float font_size,
const CFX_Matrix& mtText2User,
const CFX_Matrix* pUser2Device,
@@ -49,7 +49,7 @@
static bool DrawNormalText(CFX_RenderDevice* pDevice,
pdfium::span<const uint32_t> char_codes,
pdfium::span<const float> char_pos,
- CPDF_Font* pFont,
+ CPDF_Font* font,
float font_size,
const CFX_Matrix& mtText2Device,
FX_ARGB fill_argb,
diff --git a/core/fpdfapi/render/cpdf_type3cache.cpp b/core/fpdfapi/render/cpdf_type3cache.cpp
index 2ea2b92..6fa8b3b 100644
--- a/core/fpdfapi/render/cpdf_type3cache.cpp
+++ b/core/fpdfapi/render/cpdf_type3cache.cpp
@@ -81,7 +81,7 @@
} // namespace
-CPDF_Type3Cache::CPDF_Type3Cache(CPDF_Type3Font* pFont) : font_(pFont) {}
+CPDF_Type3Cache::CPDF_Type3Cache(CPDF_Type3Font* font) : font_(font) {}
CPDF_Type3Cache::~CPDF_Type3Cache() = default;
diff --git a/core/fpdfapi/render/cpdf_type3cache.h b/core/fpdfapi/render/cpdf_type3cache.h
index b46e2c3..6d61ef9 100644
--- a/core/fpdfapi/render/cpdf_type3cache.h
+++ b/core/fpdfapi/render/cpdf_type3cache.h
@@ -32,7 +32,7 @@
private:
using SizeKey = std::tuple<int, int, int, int>;
- explicit CPDF_Type3Cache(CPDF_Type3Font* pFont);
+ explicit CPDF_Type3Cache(CPDF_Type3Font* font);
~CPDF_Type3Cache() override;
std::unique_ptr<CFX_GlyphBitmap> RenderGlyph(CPDF_Type3GlyphMap* pSize,
diff --git a/core/fpdfdoc/cpdf_bafontmap.cpp b/core/fpdfdoc/cpdf_bafontmap.cpp
index af4a2be..9bca83c 100644
--- a/core/fpdfdoc/cpdf_bafontmap.cpp
+++ b/core/fpdfdoc/cpdf_bafontmap.cpp
@@ -32,11 +32,11 @@
namespace {
bool FindNativeTrueTypeFont(ByteStringView sFontFaceName) {
- CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
- CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper();
- pFontMapper->LoadInstalledFonts();
- return pFontMapper->HasInstalledFont(sFontFaceName) ||
- pFontMapper->HasLocalizedFont(sFontFaceName);
+ CFX_FontMgr* font_mgr = CFX_GEModule::Get()->GetFontMgr();
+ CFX_FontMapper* font_mapper = font_mgr->GetBuiltinMapper();
+ font_mapper->LoadInstalledFonts();
+ return font_mapper->HasInstalledFont(sFontFaceName) ||
+ font_mapper->HasLocalizedFont(sFontFaceName);
}
RetainPtr<CPDF_Font> AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc,
@@ -99,7 +99,7 @@
RetainPtr<CPDF_Font> CPDF_BAFontMap::GetPDFFont(int32_t nFontIndex) {
if (fxcrt::IndexInBounds(data_, nFontIndex)) {
- return data_[nFontIndex]->pFont;
+ return data_[nFontIndex]->font;
}
return nullptr;
}
@@ -154,12 +154,12 @@
}
Data* pData = data_[nFontIndex].get();
- if (!pData->pFont) {
+ if (!pData->font) {
return -1;
}
- if (pData->pFont->IsUnicodeCompatible()) {
- return pData->pFont->CharCodeFromUnicode(word);
+ if (pData->font->IsUnicodeCompatible()) {
+ return pData->font->CharCodeFromUnicode(word);
}
return word < 0xFF ? word : -1;
@@ -217,13 +217,13 @@
return nullptr;
}
- RetainPtr<const CPDF_Dictionary> pFonts = pResDict->GetDictFor("Font");
- if (!pFonts) {
+ RetainPtr<const CPDF_Dictionary> fonts = pResDict->GetDictFor("Font");
+ if (!fonts) {
return nullptr;
}
RetainPtr<CPDF_Font> pFind;
- CPDF_DictionaryLocker locker(pFonts);
+ CPDF_DictionaryLocker locker(fonts);
for (const auto& it : locker) {
const ByteString& csKey = it.first;
RetainPtr<CPDF_Dictionary> pElement =
@@ -233,15 +233,15 @@
}
auto* pData = CPDF_DocPageData::FromDocument(document_);
- RetainPtr<CPDF_Font> pFont = pData->GetFont(std::move(pElement));
- if (!pFont) {
+ RetainPtr<CPDF_Font> font = pData->GetFont(std::move(pElement));
+ if (!font) {
continue;
}
- auto maybe_charset = pFont->GetSubstFontCharset();
+ auto maybe_charset = font->GetSubstFontCharset();
if (maybe_charset.has_value() && maybe_charset.value() == nCharset) {
*sFontAlias = csKey;
- pFind = std::move(pFont);
+ pFind = std::move(font);
}
}
return pFind;
@@ -283,7 +283,7 @@
sAlias->clear();
}
- RetainPtr<CPDF_Dictionary> pFontDict;
+ RetainPtr<CPDF_Dictionary> font_dict;
if (RetainPtr<CPDF_Dictionary> pAPDict =
annot_dict_->GetMutableDictFor(pdfium::annotation::kAP)) {
if (RetainPtr<CPDF_Dictionary> pNormalDict =
@@ -292,30 +292,30 @@
pNormalDict->GetMutableDictFor("Resources")) {
if (RetainPtr<CPDF_Dictionary> pResFontDict =
pNormalResDict->GetMutableDictFor("Font")) {
- pFontDict = pResFontDict->GetMutableDictFor(sAlias->AsStringView());
+ font_dict = pResFontDict->GetMutableDictFor(sAlias->AsStringView());
}
}
}
}
- if (bWidget && !pFontDict && pAcroFormDict) {
+ if (bWidget && !font_dict && pAcroFormDict) {
if (RetainPtr<CPDF_Dictionary> pDRDict =
pAcroFormDict->GetMutableDictFor("DR")) {
if (RetainPtr<CPDF_Dictionary> pDRFontDict =
pDRDict->GetMutableDictFor("Font")) {
- pFontDict = pDRFontDict->GetMutableDictFor(sAlias->AsStringView());
+ font_dict = pDRFontDict->GetMutableDictFor(sAlias->AsStringView());
}
}
}
- if (!pFontDict) {
+ if (!font_dict) {
return nullptr;
}
- return CPDF_DocPageData::FromDocument(document_)->GetFont(pFontDict);
+ return CPDF_DocPageData::FromDocument(document_)->GetFont(font_dict);
}
-void CPDF_BAFontMap::AddFontToAnnotDict(const RetainPtr<CPDF_Font>& pFont,
+void CPDF_BAFontMap::AddFontToAnnotDict(const RetainPtr<CPDF_Font>& font,
const ByteString& sAlias) {
- if (!pFont) {
+ if (!font) {
return;
}
@@ -346,10 +346,10 @@
pStreamResFontList->GetObjNum());
}
if (!pStreamResFontList->KeyExist(sAlias.AsStringView())) {
- RetainPtr<const CPDF_Dictionary> pFontDict = pFont->GetFontDict();
- RetainPtr<CPDF_Object> pObject = pFontDict->IsInline()
- ? pFontDict->Clone()
- : pFontDict->MakeReference(document_);
+ RetainPtr<const CPDF_Dictionary> font_dict = font->GetFontDict();
+ RetainPtr<CPDF_Object> pObject = font_dict->IsInline()
+ ? font_dict->Clone()
+ : font_dict->MakeReference(document_);
pStreamResFontList->SetFor(sAlias, std::move(pObject));
}
}
@@ -368,21 +368,21 @@
}
ByteString sAlias;
- RetainPtr<CPDF_Font> pFont =
+ RetainPtr<CPDF_Font> font =
bFind ? FindFontSameCharset(&sAlias, nCharset) : nullptr;
- if (!pFont) {
- pFont = AddFontToDocument(sFontName, nCharset);
+ if (!font) {
+ font = AddFontToDocument(sFontName, nCharset);
sAlias = EncodeFontAlias(sFontName, nCharset);
}
- AddFontToAnnotDict(pFont, sAlias);
- return AddFontData(pFont, sAlias, nCharset);
+ AddFontToAnnotDict(font, sAlias);
+ return AddFontData(font, sAlias, nCharset);
}
-int32_t CPDF_BAFontMap::AddFontData(const RetainPtr<CPDF_Font>& pFont,
+int32_t CPDF_BAFontMap::AddFontData(const RetainPtr<CPDF_Font>& font,
const ByteString& sFontAlias,
FX_Charset nCharset) {
auto pNewData = std::make_unique<Data>();
- pNewData->pFont = pFont;
+ pNewData->font = font;
pNewData->sFontName = sFontAlias;
pNewData->nCharset = nCharset;
data_.push_back(std::move(pNewData));
diff --git a/core/fpdfdoc/cpdf_bafontmap.h b/core/fpdfdoc/cpdf_bafontmap.h
index 16215b4..d49285c 100644
--- a/core/fpdfdoc/cpdf_bafontmap.h
+++ b/core/fpdfdoc/cpdf_bafontmap.h
@@ -42,7 +42,7 @@
~Data();
FX_Charset nCharset = FX_Charset::kANSI;
- RetainPtr<CPDF_Font> pFont;
+ RetainPtr<CPDF_Font> font;
ByteString sFontName;
};
@@ -57,7 +57,7 @@
ByteString* sFontAlias,
FX_Charset nCharset);
RetainPtr<CPDF_Font> GetAnnotDefaultFont(ByteString* sAlias);
- void AddFontToAnnotDict(const RetainPtr<CPDF_Font>& pFont,
+ void AddFontToAnnotDict(const RetainPtr<CPDF_Font>& font,
const ByteString& sAlias);
bool KnowWord(int32_t nFontIndex, uint16_t word);
@@ -65,7 +65,7 @@
int32_t GetFontIndex(const ByteString& sFontName,
FX_Charset nCharset,
bool bFind);
- int32_t AddFontData(const RetainPtr<CPDF_Font>& pFont,
+ int32_t AddFontData(const RetainPtr<CPDF_Font>& font,
const ByteString& sFontAlias,
FX_Charset nCharset);
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp
index 893415d..d712745 100644
--- a/core/fpdfdoc/cpdf_formcontrol.cpp
+++ b/core/fpdfdoc/cpdf_formcontrol.cpp
@@ -205,12 +205,12 @@
}
std::optional<WideString> CPDF_FormControl::GetDefaultControlFontName() const {
- RetainPtr<CPDF_Font> pFont = GetDefaultControlFont();
- if (!pFont) {
+ RetainPtr<CPDF_Font> font = GetDefaultControlFont();
+ if (!font) {
return std::nullopt;
}
- return WideString::FromDefANSI(pFont->GetBaseFontName().AsStringView());
+ return WideString::FromDefANSI(font->GetBaseFontName().AsStringView());
}
RetainPtr<CPDF_Font> CPDF_FormControl::GetDefaultControlFont() const {
@@ -225,15 +225,15 @@
RetainPtr<CPDF_Dictionary> pDRDict = ToDictionary(
CPDF_FormField::GetMutableFieldAttrForDict(widget_dict_.Get(), "DR"));
if (pDRDict) {
- RetainPtr<CPDF_Dictionary> pFonts = pDRDict->GetMutableDictFor("Font");
- if (ValidateFontResourceDict(pFonts.Get())) {
+ RetainPtr<CPDF_Dictionary> fonts = pDRDict->GetMutableDictFor("Font");
+ if (ValidateFontResourceDict(fonts.Get())) {
RetainPtr<CPDF_Dictionary> pElement =
- pFonts->GetMutableDictFor(font_name.AsStringView());
+ fonts->GetMutableDictFor(font_name.AsStringView());
if (pElement) {
- RetainPtr<CPDF_Font> pFont =
+ RetainPtr<CPDF_Font> font =
form_->GetFontForElement(std::move(pElement));
- if (pFont) {
- return pFont;
+ if (font) {
+ return font;
}
}
}
@@ -250,13 +250,13 @@
return nullptr;
}
- RetainPtr<CPDF_Dictionary> pFonts = pDict->GetMutableDictFor("Font");
- if (!ValidateFontResourceDict(pFonts.Get())) {
+ RetainPtr<CPDF_Dictionary> fonts = pDict->GetMutableDictFor("Font");
+ if (!ValidateFontResourceDict(fonts.Get())) {
return nullptr;
}
RetainPtr<CPDF_Dictionary> pElement =
- pFonts->GetMutableDictFor(font_name.AsStringView());
+ fonts->GetMutableDictFor(font_name.AsStringView());
if (!pElement) {
return nullptr;
}
diff --git a/core/fpdfdoc/cpvt_fontmap.cpp b/core/fpdfdoc/cpvt_fontmap.cpp
index 8e975cb..12a0f8a 100644
--- a/core/fpdfdoc/cpvt_fontmap.cpp
+++ b/core/fpdfdoc/cpvt_fontmap.cpp
@@ -41,10 +41,10 @@
return;
}
- RetainPtr<CPDF_Dictionary> pFontList = res_dict_->GetMutableDictFor("Font");
- if (ValidateFontResourceDict(pFontList.Get()) &&
- !pFontList->KeyExist(sys_font_alias_.AsStringView())) {
- pFontList->SetNewFor<CPDF_Reference>(sys_font_alias_, document_,
+ RetainPtr<CPDF_Dictionary> font_list = res_dict_->GetMutableDictFor("Font");
+ if (ValidateFontResourceDict(font_list.Get()) &&
+ !font_list->KeyExist(sys_font_alias_.AsStringView())) {
+ font_list->SetNewFor<CPDF_Reference>(sys_font_alias_, document_,
pPDFFont->GetFontDictObjNum());
}
sys_font_ = std::move(pPDFFont);
diff --git a/core/fpdfdoc/cpvt_variabletext.cpp b/core/fpdfdoc/cpvt_variabletext.cpp
index 46758b7..60cb93a 100644
--- a/core/fpdfdoc/cpvt_variabletext.cpp
+++ b/core/fpdfdoc/cpvt_variabletext.cpp
@@ -33,8 +33,8 @@
} // namespace
-CPVT_VariableText::Provider::Provider(IPVT_FontMap* pFontMap)
- : font_map_(pFontMap) {
+CPVT_VariableText::Provider::Provider(IPVT_FontMap* font_map)
+ : font_map_(font_map) {
DCHECK(font_map_);
}
diff --git a/core/fpdfdoc/cpvt_variabletext.h b/core/fpdfdoc/cpvt_variabletext.h
index 7f09e68..2feb95d 100644
--- a/core/fpdfdoc/cpvt_variabletext.h
+++ b/core/fpdfdoc/cpvt_variabletext.h
@@ -49,7 +49,7 @@
class Provider {
public:
- explicit Provider(IPVT_FontMap* pFontMap);
+ explicit Provider(IPVT_FontMap* font_map);
virtual ~Provider();
virtual int GetCharWidth(int32_t nFontIndex, uint16_t word);
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index 9fb7d24..bca5145 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -180,24 +180,24 @@
CFX_BidiChar::Direction::kRight;
}
-int GetCharWidth(uint32_t charCode, CPDF_Font* pFont) {
+int GetCharWidth(uint32_t charCode, CPDF_Font* font) {
if (charCode == CPDF_Font::kInvalidCharCode) {
return 0;
}
- int w = pFont->GetCharWidthF(charCode);
+ int w = font->GetCharWidthF(charCode);
if (w > 0) {
return w;
}
ByteString str;
- pFont->AppendChar(&str, charCode);
- w = pFont->GetStringWidth(str.AsStringView());
+ font->AppendChar(&str, charCode);
+ w = font->GetStringWidth(str.AsStringView());
if (w > 0) {
return w;
}
- FX_RECT rect = pFont->GetCharBBox(charCode);
+ FX_RECT rect = font->GetCharBBox(charCode);
if (!rect.Valid()) {
return 0;
}
@@ -980,10 +980,10 @@
return MarkedContentState::kPass;
}
- RetainPtr<CPDF_Font> pFont = pTextObj->GetFont();
+ RetainPtr<CPDF_Font> font = pTextObj->GetFont();
bExist = false;
for (size_t i = 0; i < actual_text.GetLength(); ++i) {
- if (pFont->CharCodeFromUnicode(actual_text[i]) !=
+ if (font->CharCodeFromUnicode(actual_text[i]) !=
CPDF_Font::kInvalidCharCode) {
bExist = true;
break;
diff --git a/core/fxcrt/css/cfx_cssdeclaration.cpp b/core/fxcrt/css/cfx_cssdeclaration.cpp
index 8ff2e0d..7ace32c 100644
--- a/core/fxcrt/css/cfx_cssdeclaration.cpp
+++ b/core/fxcrt/css/cfx_cssdeclaration.cpp
@@ -476,7 +476,7 @@
RetainPtr<CFX_CSSValue> pStyle;
RetainPtr<CFX_CSSValue> pVariant;
RetainPtr<CFX_CSSValue> pWeight;
- RetainPtr<CFX_CSSValue> pFontSize;
+ RetainPtr<CFX_CSSValue> font_size;
RetainPtr<CFX_CSSValue> pLineHeight;
std::vector<RetainPtr<CFX_CSSValue>> family_list;
CFX_CSSValueListParser parser(value, '/');
@@ -500,8 +500,8 @@
case CFX_CSSPropertyValue::XxLarge:
case CFX_CSSPropertyValue::Smaller:
case CFX_CSSPropertyValue::Larger:
- if (!pFontSize) {
- pFontSize = pdfium::MakeRetain<CFX_CSSEnumValue>(pValue->eName);
+ if (!font_size) {
+ font_size = pdfium::MakeRetain<CFX_CSSEnumValue>(pValue->eName);
}
continue;
case CFX_CSSPropertyValue::Bold:
@@ -529,8 +529,8 @@
pVariant = pdfium::MakeRetain<CFX_CSSEnumValue>(pValue->eName);
} else if (!pWeight) {
pWeight = pdfium::MakeRetain<CFX_CSSEnumValue>(pValue->eName);
- } else if (!pFontSize) {
- pFontSize = pdfium::MakeRetain<CFX_CSSEnumValue>(pValue->eName);
+ } else if (!font_size) {
+ font_size = pdfium::MakeRetain<CFX_CSSEnumValue>(pValue->eName);
} else if (!pLineHeight) {
pLineHeight =
pdfium::MakeRetain<CFX_CSSEnumValue>(pValue->eName);
@@ -540,7 +540,7 @@
break;
}
}
- if (pFontSize) {
+ if (font_size) {
family_list.push_back(pdfium::MakeRetain<CFX_CSSStringValue>(
maybe_next.value().string_view));
}
@@ -570,8 +570,8 @@
continue;
}
}
- if (!pFontSize) {
- pFontSize =
+ if (!font_size) {
+ font_size =
pdfium::MakeRetain<CFX_CSSNumberValue>(maybe_number.value());
} else if (!pLineHeight) {
pLineHeight =
@@ -595,8 +595,8 @@
pWeight =
pdfium::MakeRetain<CFX_CSSEnumValue>(CFX_CSSPropertyValue::Normal);
}
- if (!pFontSize) {
- pFontSize =
+ if (!font_size) {
+ font_size =
pdfium::MakeRetain<CFX_CSSEnumValue>(CFX_CSSPropertyValue::Medium);
}
if (!pLineHeight) {
@@ -607,7 +607,7 @@
AddPropertyHolder(CFX_CSSProperty::FontStyle, pStyle, bImportant);
AddPropertyHolder(CFX_CSSProperty::FontVariant, pVariant, bImportant);
AddPropertyHolder(CFX_CSSProperty::FontWeight, pWeight, bImportant);
- AddPropertyHolder(CFX_CSSProperty::FontSize, pFontSize, bImportant);
+ AddPropertyHolder(CFX_CSSProperty::FontSize, font_size, bImportant);
AddPropertyHolder(CFX_CSSProperty::LineHeight, pLineHeight, bImportant);
if (!family_list.empty()) {
auto value_list =
diff --git a/core/fxge/agg/cfx_agg_devicedriver.cpp b/core/fxge/agg/cfx_agg_devicedriver.cpp
index 6afb1f9..6babd3b 100644
--- a/core/fxge/agg/cfx_agg_devicedriver.cpp
+++ b/core/fxge/agg/cfx_agg_devicedriver.cpp
@@ -962,7 +962,7 @@
bool CFX_AggDeviceDriver::DrawDeviceText(
pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
diff --git a/core/fxge/agg/cfx_agg_devicedriver.h b/core/fxge/agg/cfx_agg_devicedriver.h
index e3957e0..0454e18 100644
--- a/core/fxge/agg/cfx_agg_devicedriver.h
+++ b/core/fxge/agg/cfx_agg_devicedriver.h
@@ -88,7 +88,7 @@
bool ContinueDIBits(CFX_AggImageRenderer* handle,
PauseIndicatorIface* pPause) override;
bool DrawDeviceText(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
diff --git a/core/fxge/android/cfpf_skiafont.cpp b/core/fxge/android/cfpf_skiafont.cpp
index c45a61f..b879a09 100644
--- a/core/fxge/android/cfpf_skiafont.cpp
+++ b/core/fxge/android/cfpf_skiafont.cpp
@@ -16,11 +16,11 @@
#include "core/fxge/android/cfpf_skiapathfont.h"
#include "core/fxge/fx_fontencoding.h"
-CFPF_SkiaFont::CFPF_SkiaFont(CFPF_SkiaFontMgr* pFontMgr,
- const CFPF_SkiaPathFont* pFont,
+CFPF_SkiaFont::CFPF_SkiaFont(CFPF_SkiaFontMgr* font_mgr,
+ const CFPF_SkiaPathFont* font,
FX_Charset uCharset)
- : font_mgr_(pFontMgr),
- font_(pFont),
+ : font_mgr_(font_mgr),
+ font_(font),
face_(font_mgr_->GetFontFace(font_->path(), font_->face_index())),
charset_(uCharset) {}
diff --git a/core/fxge/android/cfpf_skiafont.h b/core/fxge/android/cfpf_skiafont.h
index d8407cd..dfff1c7 100644
--- a/core/fxge/android/cfpf_skiafont.h
+++ b/core/fxge/android/cfpf_skiafont.h
@@ -21,8 +21,8 @@
class CFPF_SkiaFont {
public:
- CFPF_SkiaFont(CFPF_SkiaFontMgr* pFontMgr,
- const CFPF_SkiaPathFont* pFont,
+ CFPF_SkiaFont(CFPF_SkiaFontMgr* font_mgr,
+ const CFPF_SkiaPathFont* font,
FX_Charset uCharset);
~CFPF_SkiaFont();
diff --git a/core/fxge/android/cfx_androidfontinfo.cpp b/core/fxge/android/cfx_androidfontinfo.cpp
index 20a3a4d..50baa43 100644
--- a/core/fxge/android/cfx_androidfontinfo.cpp
+++ b/core/fxge/android/cfx_androidfontinfo.cpp
@@ -16,13 +16,13 @@
CFX_AndroidFontInfo::~CFX_AndroidFontInfo() = default;
-bool CFX_AndroidFontInfo::Init(CFPF_SkiaFontMgr* pFontMgr,
+bool CFX_AndroidFontInfo::Init(CFPF_SkiaFontMgr* font_mgr,
const char** user_paths) {
- if (!pFontMgr) {
+ if (!font_mgr) {
return false;
}
- font_mgr_ = pFontMgr;
+ font_mgr_ = font_mgr;
font_mgr_->LoadFonts(user_paths);
return true;
}
diff --git a/core/fxge/android/cfx_androidfontinfo.h b/core/fxge/android/cfx_androidfontinfo.h
index 8eefee5..3c287fe 100644
--- a/core/fxge/android/cfx_androidfontinfo.h
+++ b/core/fxge/android/cfx_androidfontinfo.h
@@ -21,7 +21,7 @@
CFX_AndroidFontInfo();
~CFX_AndroidFontInfo() override;
- bool Init(CFPF_SkiaFontMgr* pFontMgr, const char** user_paths);
+ bool Init(CFPF_SkiaFontMgr* font_mgr, const char** user_paths);
// SystemFontInfoIface:
void EnumFontList(CFX_FontMapper* pMapper) override;
diff --git a/core/fxge/android/fx_android_impl.cpp b/core/fxge/android/fx_android_impl.cpp
index c252e6c..050d7f3 100644
--- a/core/fxge/android/fx_android_impl.cpp
+++ b/core/fxge/android/fx_android_impl.cpp
@@ -25,14 +25,14 @@
void Init() override { device_module_ = CFPF_GetSkiaDeviceModule(); }
std::unique_ptr<SystemFontInfoIface> CreateDefaultSystemFontInfo() override {
- CFPF_SkiaFontMgr* pFontMgr = device_module_->GetFontMgr();
- if (!pFontMgr) {
+ CFPF_SkiaFontMgr* font_mgr = device_module_->GetFontMgr();
+ if (!font_mgr) {
return nullptr;
}
- auto pFontInfo = std::make_unique<CFX_AndroidFontInfo>();
- pFontInfo->Init(pFontMgr, CFX_GEModule::Get()->GetUserFontPaths());
- return pFontInfo;
+ auto font_info = std::make_unique<CFX_AndroidFontInfo>();
+ font_info->Init(font_mgr, CFX_GEModule::Get()->GetUserFontPaths());
+ return font_info;
}
private:
diff --git a/core/fxge/apple/fx_apple_impl.cpp b/core/fxge/apple/fx_apple_impl.cpp
index 537d4b6..4f9cbd0 100644
--- a/core/fxge/apple/fx_apple_impl.cpp
+++ b/core/fxge/apple/fx_apple_impl.cpp
@@ -30,7 +30,7 @@
bool CGDrawGlyphRun(CGContextRef pContext,
pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t argb) {
@@ -47,13 +47,13 @@
CQuartz2D& quartz2d =
static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatform())
->quartz_2d_;
- if (!pFont->GetPlatformFont()) {
- if (pFont->GetPsName() == "DFHeiStd-W5") {
+ if (!font->GetPlatformFont()) {
+ if (font->GetPsName() == "DFHeiStd-W5") {
return false;
}
- pFont->SetPlatformFont(quartz2d.CreateFont(pFont->GetFontSpan()));
- if (!pFont->GetPlatformFont()) {
+ font->SetPlatformFont(quartz2d.CreateFont(font->GetFontSpan()));
+ if (!font->GetPlatformFont()) {
return false;
}
}
@@ -77,7 +77,7 @@
new_matrix.d = -new_matrix.d;
}
quartz2d.SetGraphicsTextMatrix(pContext, new_matrix);
- return quartz2d.DrawGraphicsString(pContext, pFont->GetPlatformFont(),
+ return quartz2d.DrawGraphicsString(pContext, font->GetPlatformFont(),
font_size, glyph_indices, glyph_positions,
argb);
}
@@ -105,19 +105,18 @@
bool CFX_AggDeviceDriver::DrawDeviceText(
pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
const CFX_TextRenderOptions& /*options*/) {
- if (!pFont) {
+ if (!font) {
return false;
}
- bool bBold = pFont->IsBold();
- if (!bBold && pFont->GetSubstFont() &&
- pFont->GetSubstFont()->weight_ >= 500 &&
- pFont->GetSubstFont()->weight_ <= 600) {
+ bool bBold = font->IsBold();
+ if (!bBold && font->GetSubstFont() && font->GetSubstFont()->weight_ >= 500 &&
+ font->GetSubstFont()->weight_ <= 600) {
return false;
}
for (const auto& cp : pCharPos) {
@@ -167,7 +166,7 @@
color = ArgbEncode(a, b, g, r);
}
bool ret =
- CGDrawGlyphRun(ctx, pCharPos, pFont, mtObject2Device, font_size, color);
+ CGDrawGlyphRun(ctx, pCharPos, font, mtObject2Device, font_size, color);
if (pImageCG) {
CGImageRelease(pImageCG);
}
@@ -178,7 +177,7 @@
} // namespace pdfium
std::unique_ptr<CFX_GlyphBitmap> CFX_GlyphCache::RenderGlyph_Nativetext(
- const CFX_Font* pFont,
+ const CFX_Font* font,
uint32_t glyph_index,
const CFX_Matrix& matrix,
int dest_width,
diff --git a/core/fxge/cfx_face.cpp b/core/fxge/cfx_face.cpp
index fa02d5b..0c6e068 100644
--- a/core/fxge/cfx_face.cpp
+++ b/core/fxge/cfx_face.cpp
@@ -431,7 +431,7 @@
return pdfium::checked_cast<int>(GetRec()->num_glyphs);
}
-std::unique_ptr<CFX_GlyphBitmap> CFX_Face::RenderGlyph(const CFX_Font* pFont,
+std::unique_ptr<CFX_GlyphBitmap> CFX_Face::RenderGlyph(const CFX_Font* font,
uint32_t glyph_index,
bool bFontStyle,
const CFX_Matrix& matrix,
@@ -443,7 +443,7 @@
ft_matrix.yx = matrix.b / 64 * 65536;
ft_matrix.yy = matrix.d / 64 * 65536;
bool bUseCJKSubFont = false;
- const CFX_SubstFont* pSubstFont = pFont->GetSubstFont();
+ const CFX_SubstFont* pSubstFont = font->GetSubstFont();
if (pSubstFont) {
bUseCJKSubFont = pSubstFont->subst_cjk_ && bFontStyle;
int angle;
@@ -454,15 +454,15 @@
}
if (angle) {
int skew = GetSkewFromAngle(angle);
- if (pFont->IsVertical()) {
+ if (font->IsVertical()) {
ft_matrix.yx += ft_matrix.yy * skew / 100;
} else {
ft_matrix.xy -= ft_matrix.xx * skew / 100;
}
}
if (pSubstFont->IsBuiltInGenericFont()) {
- pFont->GetFace()->AdjustVariationParams(glyph_index, dest_width,
- pFont->GetSubstFont()->weight_);
+ font->GetFace()->AdjustVariationParams(glyph_index, dest_width,
+ font->GetSubstFont()->weight_);
}
}
diff --git a/core/fxge/cfx_face.h b/core/fxge/cfx_face.h
index 02a3c6d..d11adb9 100644
--- a/core/fxge/cfx_face.h
+++ b/core/fxge/cfx_face.h
@@ -81,7 +81,7 @@
int GetGlyphCount() const;
// TODO(crbug.com/pdfium/2037): Can this method be private?
FX_RECT GetGlyphBBox() const;
- std::unique_ptr<CFX_GlyphBitmap> RenderGlyph(const CFX_Font* pFont,
+ std::unique_ptr<CFX_GlyphBitmap> RenderGlyph(const CFX_Font* font,
uint32_t glyph_index,
bool bFontStyle,
const CFX_Matrix& matrix,
diff --git a/core/fxge/cfx_folderfontinfo.cpp b/core/fxge/cfx_folderfontinfo.cpp
index 3808b52..2976da3 100644
--- a/core/fxge/cfx_folderfontinfo.cpp
+++ b/core/fxge/cfx_folderfontinfo.cpp
@@ -348,14 +348,14 @@
// baseline similarity score.
auto direct_it = font_list_.find(family);
if (direct_it != font_list_.end()) {
- FontFaceInfo* pFont = direct_it->second.get();
- if (pFont->IsEligibleForFindFont(charset_flag, charset)) {
+ FontFaceInfo* font = direct_it->second.get();
+ if (font->IsEligibleForFindFont(charset_flag, charset)) {
iBestSimilar =
- pFont->SimilarityScore(weight, bItalic, pitch_family, bMatchName);
+ font->SimilarityScore(weight, bItalic, pitch_family, bMatchName);
if (iBestSimilar == FontFaceInfo::kSimilarityScoreMax) {
- return pFont;
+ return font;
}
- pFind = pFont;
+ pFind = font;
}
}
}
@@ -364,11 +364,11 @@
ByteStringView bsFamily = family.AsStringView();
for (const auto& it : font_list_) {
const ByteString& bsName = it.first;
- FontFaceInfo* pFont = it.second.get();
- if (!pFont->IsEligibleForFindFont(charset_flag, charset)) {
+ FontFaceInfo* font = it.second.get();
+ if (!font->IsEligibleForFindFont(charset_flag, charset)) {
continue;
}
- int32_t iSimilarValue = pFont->SimilarityScore(
+ int32_t iSimilarValue = font->SimilarityScore(
weight, bItalic, pitch_family,
bMatchName && bsFamily.GetLength() == bsName.GetLength());
if (iSimilarValue > iBestSimilar) {
@@ -376,7 +376,7 @@
continue;
}
iBestSimilar = iSimilarValue;
- pFind = pFont;
+ pFind = font;
}
}
@@ -414,19 +414,19 @@
return 0;
}
- const FontFaceInfo* pFont = static_cast<FontFaceInfo*>(hFont);
+ const FontFaceInfo* font = static_cast<FontFaceInfo*>(hFont);
uint32_t datasize = 0;
uint32_t offset = 0;
if (table == 0) {
- datasize = pFont->font_offset_ ? 0 : pFont->file_size_;
+ datasize = font->font_offset_ ? 0 : font->file_size_;
} else if (table == kTableTTCF) {
- datasize = pFont->font_offset_ ? pFont->file_size_ : 0;
+ datasize = font->font_offset_ ? font->file_size_ : 0;
} else {
- size_t nTables = pFont->font_tables_.GetLength() / 16;
+ size_t nTables = font->font_tables_.GetLength() / 16;
for (size_t i = 0; i < nTables; i++) {
// TODO(tsepez): iterate over span.
pdfium::span<const uint8_t> p =
- pFont->font_tables_.unsigned_span().subspan(i * 16);
+ font->font_tables_.unsigned_span().subspan(i * 16);
if (fxcrt::GetUInt32MSBFirst(p.first<4u>()) == table) {
offset = fxcrt::GetUInt32MSBFirst(p.subspan<8u, 4u>());
datasize = fxcrt::GetUInt32MSBFirst(p.subspan<12u, 4u>());
@@ -439,7 +439,7 @@
}
std::unique_ptr<FILE, FxFileCloser> pFile(
- fopen(pFont->file_path_.c_str(), "rb"));
+ fopen(font->file_path_.c_str(), "rb"));
if (!pFile) {
return 0;
}
@@ -452,7 +452,7 @@
pdfium::Alias(&datasize);
char buf[256] = {};
pdfium::Alias(&buf);
- ByteStringView font_path = pFont->file_path_.AsStringView();
+ ByteStringView font_path = font->file_path_.AsStringView();
size_t path_char_count = std::min(font_path.GetLength(), std::size(buf));
fxcrt::spancpy(pdfium::span(buf), font_path.Last(path_char_count).span());
diff --git a/core/fxge/cfx_fontcache.cpp b/core/fxge/cfx_fontcache.cpp
index 33348b1..1423936 100644
--- a/core/fxge/cfx_fontcache.cpp
+++ b/core/fxge/cfx_fontcache.cpp
@@ -14,8 +14,8 @@
CFX_FontCache::~CFX_FontCache() = default;
-RetainPtr<CFX_GlyphCache> CFX_FontCache::GetGlyphCache(const CFX_Font* pFont) {
- RetainPtr<CFX_Face> face = pFont->GetFace();
+RetainPtr<CFX_GlyphCache> CFX_FontCache::GetGlyphCache(const CFX_Font* font) {
+ RetainPtr<CFX_Face> face = font->GetFace();
const bool bExternal = !face;
auto& map = bExternal ? ext_glyph_cache_map_ : glyph_cache_map_;
auto it = map.find(face.Get());
@@ -29,7 +29,7 @@
}
#if defined(PDF_USE_SKIA)
-CFX_TypeFace* CFX_FontCache::GetDeviceCache(const CFX_Font* pFont) {
- return GetGlyphCache(pFont)->GetDeviceCache(pFont);
+CFX_TypeFace* CFX_FontCache::GetDeviceCache(const CFX_Font* font) {
+ return GetGlyphCache(font)->GetDeviceCache(font);
}
#endif
diff --git a/core/fxge/cfx_fontcache.h b/core/fxge/cfx_fontcache.h
index eb941ae..d826953 100644
--- a/core/fxge/cfx_fontcache.h
+++ b/core/fxge/cfx_fontcache.h
@@ -20,9 +20,9 @@
CFX_FontCache();
~CFX_FontCache();
- RetainPtr<CFX_GlyphCache> GetGlyphCache(const CFX_Font* pFont);
+ RetainPtr<CFX_GlyphCache> GetGlyphCache(const CFX_Font* font);
#if defined(PDF_USE_SKIA)
- CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont);
+ CFX_TypeFace* GetDeviceCache(const CFX_Font* font);
#endif
private:
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp
index c204cce..5dacd22 100644
--- a/core/fxge/cfx_fontmapper.cpp
+++ b/core/fxge/cfx_fontmapper.cpp
@@ -423,13 +423,13 @@
CFX_FontMapper::~CFX_FontMapper() = default;
void CFX_FontMapper::SetSystemFontInfo(
- std::unique_ptr<SystemFontInfoIface> pFontInfo) {
- if (!pFontInfo) {
+ std::unique_ptr<SystemFontInfoIface> font_info) {
+ if (!font_info) {
return;
}
list_loaded_ = false;
- font_info_ = std::move(pFontInfo);
+ font_info_ = std::move(font_info);
}
std::unique_ptr<SystemFontInfoIface> CFX_FontMapper::TakeSystemFontInfo() {
@@ -873,9 +873,9 @@
size_t data_size) {
CHECK_GE(ttc_size, data_size);
uint32_t checksum = GetChecksumFromTT(font_handle);
- RetainPtr<CFX_FontMgr::FontDesc> pFontDesc =
+ RetainPtr<CFX_FontMgr::FontDesc> font_desc =
font_mgr_->GetCachedTTCFontDesc(ttc_size, checksum);
- if (!pFontDesc) {
+ if (!font_desc) {
auto font_data = FixedSizeDataVector<uint8_t>::Uninit(ttc_size);
size_t size =
font_info_->GetFontData(font_handle, kTableTTCF, font_data.span());
@@ -883,24 +883,24 @@
return nullptr;
}
- pFontDesc = font_mgr_->AddCachedTTCFontDesc(ttc_size, checksum,
+ font_desc = font_mgr_->AddCachedTTCFontDesc(ttc_size, checksum,
std::move(font_data));
}
size_t font_offset = ttc_size - data_size;
size_t face_index =
- GetTTCIndex(pFontDesc->FontData().first(ttc_size), font_offset);
- RetainPtr<CFX_Face> pFace(pFontDesc->GetFace(face_index));
+ GetTTCIndex(font_desc->FontData().first(ttc_size), font_offset);
+ RetainPtr<CFX_Face> pFace(font_desc->GetFace(face_index));
if (pFace) {
return pFace;
}
pFace = font_mgr_->NewFixedFace(
- pFontDesc, pFontDesc->FontData().first(ttc_size), face_index);
+ font_desc, font_desc->FontData().first(ttc_size), face_index);
if (!pFace) {
return nullptr;
}
- pFontDesc->SetFace(face_index, pFace.Get());
+ font_desc->SetFace(face_index, pFace.Get());
return pFace;
}
@@ -909,30 +909,30 @@
int weight,
bool is_italic,
size_t data_size) {
- RetainPtr<CFX_FontMgr::FontDesc> pFontDesc =
+ RetainPtr<CFX_FontMgr::FontDesc> font_desc =
font_mgr_->GetCachedFontDesc(subst_name, weight, is_italic);
- if (!pFontDesc) {
+ if (!font_desc) {
auto font_data = FixedSizeDataVector<uint8_t>::Uninit(data_size);
size_t size = font_info_->GetFontData(font_handle, 0, font_data.span());
if (size != data_size) {
return nullptr;
}
- pFontDesc = font_mgr_->AddCachedFontDesc(subst_name, weight, is_italic,
+ font_desc = font_mgr_->AddCachedFontDesc(subst_name, weight, is_italic,
std::move(font_data));
}
- RetainPtr<CFX_Face> pFace(pFontDesc->GetFace(0));
+ RetainPtr<CFX_Face> pFace(font_desc->GetFace(0));
if (pFace) {
return pFace;
}
- pFace = font_mgr_->NewFixedFace(pFontDesc,
- pFontDesc->FontData().first(data_size), 0);
+ pFace = font_mgr_->NewFixedFace(font_desc,
+ font_desc->FontData().first(data_size), 0);
if (!pFace) {
return nullptr;
}
- pFontDesc->SetFace(0, pFace.Get());
+ font_desc->SetFace(0, pFace.Get());
return pFace;
}
diff --git a/core/fxge/cfx_fontmapper.h b/core/fxge/cfx_fontmapper.h
index 7bf45ed..38ccf1d 100644
--- a/core/fxge/cfx_fontmapper.h
+++ b/core/fxge/cfx_fontmapper.h
@@ -61,7 +61,7 @@
static_cast<uint8_t>(c3) << 8 | static_cast<uint8_t>(c4);
}
- void SetSystemFontInfo(std::unique_ptr<SystemFontInfoIface> pFontInfo);
+ void SetSystemFontInfo(std::unique_ptr<SystemFontInfoIface> font_info);
std::unique_ptr<SystemFontInfoIface> TakeSystemFontInfo();
void AddInstalledFont(const ByteString& name, FX_Charset charset);
void LoadInstalledFonts();
diff --git a/core/fxge/cfx_fontmgr.cpp b/core/fxge/cfx_fontmgr.cpp
index b52e82f..2747e1f 100644
--- a/core/fxge/cfx_fontmgr.cpp
+++ b/core/fxge/cfx_fontmgr.cpp
@@ -87,9 +87,9 @@
int weight,
bool bItalic,
FixedSizeDataVector<uint8_t> data) {
- auto pFontDesc = pdfium::MakeRetain<FontDesc>(std::move(data));
- face_map_[{face_name, weight, bItalic}].Reset(pFontDesc.Get());
- return pFontDesc;
+ auto font_desc = pdfium::MakeRetain<FontDesc>(std::move(data));
+ face_map_[{face_name, weight, bItalic}].Reset(font_desc.Get());
+ return font_desc;
}
RetainPtr<CFX_FontMgr::FontDesc> CFX_FontMgr::GetCachedTTCFontDesc(
diff --git a/core/fxge/cfx_glyphcache.cpp b/core/fxge/cfx_glyphcache.cpp
index 92ba47c..8d4413d 100644
--- a/core/fxge/cfx_glyphcache.cpp
+++ b/core/fxge/cfx_glyphcache.cpp
@@ -44,7 +44,7 @@
class UniqueKeyGen {
public:
- UniqueKeyGen(const CFX_Font* pFont,
+ UniqueKeyGen(const CFX_Font* font,
const CFX_Matrix& matrix,
int dest_width,
int anti_alias,
@@ -72,7 +72,7 @@
return pdfium::as_bytes(pdfium::span(key_).first(key_len_));
}
-UniqueKeyGen::UniqueKeyGen(const CFX_Font* pFont,
+UniqueKeyGen::UniqueKeyGen(const CFX_Font* font,
const CFX_Matrix& matrix,
int dest_width,
int anti_alias,
@@ -84,11 +84,10 @@
#if BUILDFLAG(IS_APPLE)
if (bNative) {
- if (pFont->GetSubstFont()) {
+ if (font->GetSubstFont()) {
Initialize({nMatrixA, nMatrixB, nMatrixC, nMatrixD, dest_width,
- anti_alias, pFont->GetSubstFont()->weight_,
- pFont->GetSubstFont()->italic_angle_, pFont->IsVertical(),
- 3});
+ anti_alias, font->GetSubstFont()->weight_,
+ font->GetSubstFont()->italic_angle_, font->IsVertical(), 3});
} else {
Initialize(
{nMatrixA, nMatrixB, nMatrixC, nMatrixD, dest_width, anti_alias, 3});
@@ -98,10 +97,10 @@
#endif
CHECK(!bNative);
- if (pFont->GetSubstFont()) {
+ if (font->GetSubstFont()) {
Initialize({nMatrixA, nMatrixB, nMatrixC, nMatrixD, dest_width, anti_alias,
- pFont->GetSubstFont()->weight_,
- pFont->GetSubstFont()->italic_angle_, pFont->IsVertical()});
+ font->GetSubstFont()->weight_,
+ font->GetSubstFont()->italic_angle_, font->IsVertical()});
} else {
Initialize(
{nMatrixA, nMatrixB, nMatrixC, nMatrixD, dest_width, anti_alias});
@@ -116,7 +115,7 @@
CFX_GlyphCache::~CFX_GlyphCache() = default;
std::unique_ptr<CFX_GlyphBitmap> CFX_GlyphCache::RenderGlyph(
- const CFX_Font* pFont,
+ const CFX_Font* font,
uint32_t glyph_index,
bool bFontStyle,
const CFX_Matrix& matrix,
@@ -126,21 +125,21 @@
return nullptr;
}
- return face_->RenderGlyph(pFont, glyph_index, bFontStyle, matrix, dest_width,
+ return face_->RenderGlyph(font, glyph_index, bFontStyle, matrix, dest_width,
anti_alias);
}
-const CFX_Path* CFX_GlyphCache::LoadGlyphPath(const CFX_Font* pFont,
+const CFX_Path* CFX_GlyphCache::LoadGlyphPath(const CFX_Font* font,
uint32_t glyph_index,
int dest_width) {
if (!GetFace() || glyph_index == kInvalidGlyphIndex) {
return nullptr;
}
- const auto* pSubstFont = pFont->GetSubstFont();
+ const auto* pSubstFont = font->GetSubstFont();
int weight = pSubstFont ? pSubstFont->weight_ : 0;
int angle = pSubstFont ? pSubstFont->italic_angle_ : 0;
- bool vertical = pSubstFont && pFont->IsVertical();
+ bool vertical = pSubstFont && font->IsVertical();
const PathMapKey key =
std::make_tuple(glyph_index, dest_width, weight, angle, vertical);
auto it = path_map_.find(key);
@@ -148,12 +147,12 @@
return it->second.get();
}
- path_map_[key] = pFont->LoadGlyphPathImpl(glyph_index, dest_width);
+ path_map_[key] = font->LoadGlyphPathImpl(glyph_index, dest_width);
return path_map_[key].get();
}
const CFX_GlyphBitmap* CFX_GlyphCache::LoadGlyphBitmap(
- const CFX_Font* pFont,
+ const CFX_Font* font,
uint32_t glyph_index,
bool bFontStyle,
const CFX_Matrix& matrix,
@@ -169,7 +168,7 @@
#else
const bool bNative = false;
#endif
- UniqueKeyGen keygen(pFont, matrix, dest_width, anti_alias, bNative);
+ UniqueKeyGen keygen(font, matrix, dest_width, anti_alias, bNative);
auto FaceGlyphsKey = ByteString(ByteStringView(keygen.span()));
#if BUILDFLAG(IS_APPLE)
@@ -179,7 +178,7 @@
const bool bDoLookUp = true;
#endif
if (bDoLookUp) {
- return LookUpGlyphBitmap(pFont, matrix, FaceGlyphsKey, glyph_index,
+ return LookUpGlyphBitmap(font, matrix, FaceGlyphsKey, glyph_index,
bFontStyle, dest_width, anti_alias);
}
@@ -195,16 +194,16 @@
return it2->second.get();
}
- pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, matrix,
- dest_width, anti_alias);
+ pGlyphBitmap = RenderGlyph_Nativetext(font, glyph_index, matrix, dest_width,
+ anti_alias);
if (pGlyphBitmap) {
CFX_GlyphBitmap* pResult = pGlyphBitmap.get();
(*pSizeCache)[glyph_index] = std::move(pGlyphBitmap);
return pResult;
}
} else {
- pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, matrix,
- dest_width, anti_alias);
+ pGlyphBitmap = RenderGlyph_Nativetext(font, glyph_index, matrix, dest_width,
+ anti_alias);
if (pGlyphBitmap) {
CFX_GlyphBitmap* pResult = pGlyphBitmap.get();
@@ -215,11 +214,11 @@
return pResult;
}
}
- UniqueKeyGen keygen2(pFont, matrix, dest_width, anti_alias,
+ UniqueKeyGen keygen2(font, matrix, dest_width, anti_alias,
/*bNative=*/false);
auto FaceGlyphsKey2 = ByteString(ByteStringView(keygen2.span()));
text_options->native_text = false;
- return LookUpGlyphBitmap(pFont, matrix, FaceGlyphsKey2, glyph_index,
+ return LookUpGlyphBitmap(font, matrix, FaceGlyphsKey2, glyph_index,
bFontStyle, dest_width, anti_alias);
#endif // BUILDFLAG(IS_APPLE)
}
@@ -266,9 +265,9 @@
g_fontmgr = nullptr;
}
-CFX_TypeFace* CFX_GlyphCache::GetDeviceCache(const CFX_Font* pFont) {
+CFX_TypeFace* CFX_GlyphCache::GetDeviceCache(const CFX_Font* font) {
if (!typeface_ && g_fontmgr) {
- pdfium::span<const uint8_t> span = pFont->GetFontSpan();
+ pdfium::span<const uint8_t> span = font->GetFontSpan();
typeface_ = g_fontmgr->makeFromStream(
std::make_unique<SkMemoryStream>(span.data(), span.size()));
}
@@ -276,7 +275,7 @@
// If DirectWrite or CoreText didn't work, try FreeType.
if (!typeface_) {
sk_sp<SkFontMgr> freetype_mgr = SkFontMgr_New_Custom_Empty();
- pdfium::span<const uint8_t> span = pFont->GetFontSpan();
+ pdfium::span<const uint8_t> span = font->GetFontSpan();
typeface_ = freetype_mgr->makeFromStream(
std::make_unique<SkMemoryStream>(span.data(), span.size()));
}
@@ -286,7 +285,7 @@
#endif // defined(PDF_USE_SKIA)
CFX_GlyphBitmap* CFX_GlyphCache::LookUpGlyphBitmap(
- const CFX_Font* pFont,
+ const CFX_Font* font,
const CFX_Matrix& matrix,
const ByteString& FaceGlyphsKey,
uint32_t glyph_index,
@@ -308,7 +307,7 @@
}
std::unique_ptr<CFX_GlyphBitmap> pGlyphBitmap = RenderGlyph(
- pFont, glyph_index, bFontStyle, matrix, dest_width, anti_alias);
+ font, glyph_index, bFontStyle, matrix, dest_width, anti_alias);
CFX_GlyphBitmap* pResult = pGlyphBitmap.get();
(*pSizeCache)[glyph_index] = std::move(pGlyphBitmap);
return pResult;
diff --git a/core/fxge/cfx_glyphcache.h b/core/fxge/cfx_glyphcache.h
index 36f4bfc..03c971f 100644
--- a/core/fxge/cfx_glyphcache.h
+++ b/core/fxge/cfx_glyphcache.h
@@ -31,14 +31,14 @@
public:
CONSTRUCT_VIA_MAKE_RETAIN;
- const CFX_GlyphBitmap* LoadGlyphBitmap(const CFX_Font* pFont,
+ const CFX_GlyphBitmap* LoadGlyphBitmap(const CFX_Font* font,
uint32_t glyph_index,
bool bFontStyle,
const CFX_Matrix& matrix,
int dest_width,
int anti_alias,
CFX_TextRenderOptions* text_options);
- const CFX_Path* LoadGlyphPath(const CFX_Font* pFont,
+ const CFX_Path* LoadGlyphPath(const CFX_Font* font,
uint32_t glyph_index,
int dest_width);
int GetGlyphWidth(const CFX_Font* font,
@@ -49,7 +49,7 @@
RetainPtr<CFX_Face> GetFace() { return face_; }
#if defined(PDF_USE_SKIA)
- CFX_TypeFace* GetDeviceCache(const CFX_Font* pFont);
+ CFX_TypeFace* GetDeviceCache(const CFX_Font* font);
static void InitializeGlobals();
static void DestroyGlobals();
#endif
@@ -64,19 +64,19 @@
// <glyph_index, dest_width, weight>
using WidthMapKey = std::tuple<uint32_t, int, int>;
- std::unique_ptr<CFX_GlyphBitmap> RenderGlyph(const CFX_Font* pFont,
+ std::unique_ptr<CFX_GlyphBitmap> RenderGlyph(const CFX_Font* font,
uint32_t glyph_index,
bool bFontStyle,
const CFX_Matrix& matrix,
int dest_width,
int anti_alias);
std::unique_ptr<CFX_GlyphBitmap> RenderGlyph_Nativetext(
- const CFX_Font* pFont,
+ const CFX_Font* font,
uint32_t glyph_index,
const CFX_Matrix& matrix,
int dest_width,
int anti_alias);
- CFX_GlyphBitmap* LookUpGlyphBitmap(const CFX_Font* pFont,
+ CFX_GlyphBitmap* LookUpGlyphBitmap(const CFX_Font* font,
const CFX_Matrix& matrix,
const ByteString& FaceGlyphsKey,
uint32_t glyph_index,
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 34e0e16..cf0785f 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -310,14 +310,14 @@
}
}
-bool ShouldDrawDeviceText(const CFX_Font* pFont,
+bool ShouldDrawDeviceText(const CFX_Font* font,
const CFX_TextRenderOptions& options) {
#if BUILDFLAG(IS_APPLE)
if (options.font_is_cid) {
return false;
}
- const ByteString bsPsName = pFont->GetPsName();
+ const ByteString bsPsName = font->GetPsName();
if (bsPsName.Contains("+ZJHL")) {
return false;
}
@@ -1086,7 +1086,7 @@
#endif // defined(PDF_USE_SKIA)
bool CFX_RenderDevice::DrawNormalText(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
float font_size,
const CFX_Matrix& mtText2Device,
uint32_t fill_color,
@@ -1128,7 +1128,7 @@
// rendering options provided by |text_options|. No change needs to be
// done for |text_options| here.
anti_alias = FT_RENDER_MODE_LCD;
- normalize = !pFont->GetFaceRec() ||
+ normalize = !font->GetFaceRec() ||
options.aliasing_type != CFX_TextRenderOptions::kLcd;
}
}
@@ -1144,9 +1144,9 @@
#if BUILDFLAG(IS_WIN)
if (GetDeviceType() == DeviceType::kPrinter) {
- if (ShouldDrawDeviceText(pFont, options) &&
- device_driver_->DrawDeviceText(pCharPos, pFont, mtText2Device,
- font_size, fill_color, text_options)) {
+ if (ShouldDrawDeviceText(font, options) &&
+ device_driver_->DrawDeviceText(pCharPos, font, mtText2Device, font_size,
+ fill_color, text_options)) {
return true;
}
if (FXARGB_A(fill_color) < 255) {
@@ -1158,9 +1158,9 @@
#endif
if (try_native_text && options.native_text) {
- if (ShouldDrawDeviceText(pFont, options) &&
- device_driver_->DrawDeviceText(pCharPos, pFont, mtText2Device,
- font_size, fill_color, text_options)) {
+ if (ShouldDrawDeviceText(font, options) &&
+ device_driver_->DrawDeviceText(pCharPos, font, mtText2Device, font_size,
+ fill_color, text_options)) {
return true;
}
}
@@ -1169,10 +1169,10 @@
CFX_Matrix text2Device = mtText2Device;
char2device.Scale(font_size, -font_size);
if (fabs(char2device.a) + fabs(char2device.b) > 50 * 1.0f || is_printer) {
- if (pFont->GetFaceRec()) {
+ if (font->GetFaceRec()) {
CFX_FillRenderOptions path_options;
path_options.aliased_path = !is_text_smooth;
- return DrawTextPath(pCharPos, pFont, font_size, mtText2Device, nullptr,
+ return DrawTextPath(pCharPos, font, font_size, mtText2Device, nullptr,
nullptr, fill_color, 0, nullptr, path_options);
}
}
@@ -1185,7 +1185,7 @@
glyph.origin_.y = FXSYS_roundf(glyph.device_origin_.y);
CFX_Matrix matrix = charpos.GetEffectiveMatrix(char2device);
- glyph.glyph_ = pFont->LoadGlyphBitmap(
+ glyph.glyph_ = font->LoadGlyphBitmap(
charpos.glyph_index_, charpos.font_style_, matrix,
charpos.font_char_width_, anti_alias, &text_options);
}
@@ -1300,7 +1300,7 @@
}
bool CFX_RenderDevice::DrawTextPath(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
float font_size,
const CFX_Matrix& mtText2User,
const CFX_Matrix* pUser2Device,
@@ -1311,7 +1311,7 @@
const CFX_FillRenderOptions& fill_options) {
for (const auto& charpos : pCharPos) {
const CFX_Path* pPath =
- pFont->LoadGlyphPath(charpos.glyph_index_, charpos.font_char_width_);
+ font->LoadGlyphPath(charpos.glyph_index_, charpos.font_char_width_);
if (!pPath) {
continue;
}
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 2cbe401..311a51c 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -137,13 +137,13 @@
PauseIndicatorIface* pPause);
bool DrawNormalText(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
float font_size,
const CFX_Matrix& mtText2Device,
uint32_t fill_color,
const CFX_TextRenderOptions& options);
bool DrawTextPath(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
float font_size,
const CFX_Matrix& mtText2User,
const CFX_Matrix* pUser2Device,
diff --git a/core/fxge/cfx_unicodeencoding.cpp b/core/fxge/cfx_unicodeencoding.cpp
index 06fcf9a..b0f2b4b 100644
--- a/core/fxge/cfx_unicodeencoding.cpp
+++ b/core/fxge/cfx_unicodeencoding.cpp
@@ -12,8 +12,7 @@
#include "core/fxge/fx_font.h"
#include "core/fxge/fx_fontencoding.h"
-CFX_UnicodeEncoding::CFX_UnicodeEncoding(const CFX_Font* pFont)
- : font_(pFont) {}
+CFX_UnicodeEncoding::CFX_UnicodeEncoding(const CFX_Font* font) : font_(font) {}
CFX_UnicodeEncoding::~CFX_UnicodeEncoding() = default;
diff --git a/core/fxge/cfx_unicodeencoding.h b/core/fxge/cfx_unicodeencoding.h
index 7307023..29c133b 100644
--- a/core/fxge/cfx_unicodeencoding.h
+++ b/core/fxge/cfx_unicodeencoding.h
@@ -15,7 +15,7 @@
class CFX_UnicodeEncoding {
public:
- explicit CFX_UnicodeEncoding(const CFX_Font* pFont);
+ explicit CFX_UnicodeEncoding(const CFX_Font* font);
virtual ~CFX_UnicodeEncoding();
virtual uint32_t GlyphFromCharCode(uint32_t charcode);
diff --git a/core/fxge/cfx_unicodeencodingex.cpp b/core/fxge/cfx_unicodeencodingex.cpp
index bf32537..ba742db 100644
--- a/core/fxge/cfx_unicodeencodingex.cpp
+++ b/core/fxge/cfx_unicodeencodingex.cpp
@@ -26,19 +26,19 @@
};
std::unique_ptr<CFX_UnicodeEncodingEx> FXFM_CreateFontEncoding(
- CFX_Font* pFont,
+ CFX_Font* font,
fxge::FontEncoding encoding_id) {
- if (!pFont->GetFace()->SelectCharMap(encoding_id)) {
+ if (!font->GetFace()->SelectCharMap(encoding_id)) {
return nullptr;
}
- return std::make_unique<CFX_UnicodeEncodingEx>(pFont, encoding_id);
+ return std::make_unique<CFX_UnicodeEncodingEx>(font, encoding_id);
}
} // namespace
-CFX_UnicodeEncodingEx::CFX_UnicodeEncodingEx(CFX_Font* pFont,
+CFX_UnicodeEncodingEx::CFX_UnicodeEncodingEx(CFX_Font* font,
fxge::FontEncoding encoding_id)
- : CFX_UnicodeEncoding(pFont), encoding_id_(encoding_id) {}
+ : CFX_UnicodeEncoding(font), encoding_id_(encoding_id) {}
CFX_UnicodeEncodingEx::~CFX_UnicodeEncodingEx() = default;
@@ -85,16 +85,15 @@
return kInvalidCharCode;
}
-std::unique_ptr<CFX_UnicodeEncodingEx> FX_CreateFontEncodingEx(
- CFX_Font* pFont) {
- if (!pFont || !pFont->GetFace()) {
+std::unique_ptr<CFX_UnicodeEncodingEx> FX_CreateFontEncodingEx(CFX_Font* font) {
+ if (!font || !font->GetFace()) {
return nullptr;
}
for (fxge::FontEncoding id : kEncodingIDs) {
- auto pFontEncoding = FXFM_CreateFontEncoding(pFont, id);
- if (pFontEncoding) {
- return pFontEncoding;
+ auto font_encoding = FXFM_CreateFontEncoding(font, id);
+ if (font_encoding) {
+ return font_encoding;
}
}
return nullptr;
diff --git a/core/fxge/cfx_unicodeencodingex.h b/core/fxge/cfx_unicodeencodingex.h
index 306ca68..5a323a2 100644
--- a/core/fxge/cfx_unicodeencodingex.h
+++ b/core/fxge/cfx_unicodeencodingex.h
@@ -19,7 +19,7 @@
public:
static constexpr uint32_t kInvalidCharCode = static_cast<uint32_t>(-1);
- CFX_UnicodeEncodingEx(CFX_Font* pFont, fxge::FontEncoding encoding_id);
+ CFX_UnicodeEncodingEx(CFX_Font* font, fxge::FontEncoding encoding_id);
~CFX_UnicodeEncodingEx() override;
// CFX_UnicodeEncoding:
@@ -32,6 +32,6 @@
fxge::FontEncoding encoding_id_;
};
-std::unique_ptr<CFX_UnicodeEncodingEx> FX_CreateFontEncodingEx(CFX_Font* pFont);
+std::unique_ptr<CFX_UnicodeEncodingEx> FX_CreateFontEncodingEx(CFX_Font* font);
#endif // CORE_FXGE_CFX_UNICODEENCODINGEX_H_
diff --git a/core/fxge/fx_font.cpp b/core/fxge/fx_font.cpp
index 528366a..e5d15a4 100644
--- a/core/fxge/fx_font.cpp
+++ b/core/fxge/fx_font.cpp
@@ -138,11 +138,11 @@
return ByteString();
}
-size_t GetTTCIndex(pdfium::span<const uint8_t> pFontData, size_t font_offset) {
- pdfium::span<const uint8_t> p = pFontData.subspan<8u>();
+size_t GetTTCIndex(pdfium::span<const uint8_t> font_data, size_t font_offset) {
+ pdfium::span<const uint8_t> p = font_data.subspan<8u>();
size_t nfont = fxcrt::GetUInt32MSBFirst(p.first<4u>());
for (size_t index = 0; index < nfont; index++) {
- p = pFontData.subspan(12 + index * 4);
+ p = font_data.subspan(12 + index * 4);
if (fxcrt::GetUInt32MSBFirst(p.first<4u>()) == font_offset) {
return index;
}
diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h
index bf7a10d..4891c26 100644
--- a/core/fxge/fx_font.h
+++ b/core/fxge/fx_font.h
@@ -68,7 +68,7 @@
FX_RECT GetGlyphsBBox(const std::vector<TextGlyphPos>& glyphs, int anti_alias);
ByteString GetNameFromTT(pdfium::span<const uint8_t> name_table, uint32_t name);
-size_t GetTTCIndex(pdfium::span<const uint8_t> pFontData, size_t font_offset);
+size_t GetTTCIndex(pdfium::span<const uint8_t> font_data, size_t font_offset);
inline bool FontStyleIsForceBold(uint32_t style) {
return !!(style & pdfium::kFontStyleForceBold);
diff --git a/core/fxge/renderdevicedriver_iface.cpp b/core/fxge/renderdevicedriver_iface.cpp
index 766e7fb..2baf44b 100644
--- a/core/fxge/renderdevicedriver_iface.cpp
+++ b/core/fxge/renderdevicedriver_iface.cpp
@@ -52,7 +52,7 @@
bool RenderDeviceDriverIface::DrawDeviceText(
pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
diff --git a/core/fxge/renderdevicedriver_iface.h b/core/fxge/renderdevicedriver_iface.h
index 10b36d3..401dc7f 100644
--- a/core/fxge/renderdevicedriver_iface.h
+++ b/core/fxge/renderdevicedriver_iface.h
@@ -112,7 +112,7 @@
virtual bool ContinueDIBits(CFX_AggImageRenderer* handle,
PauseIndicatorIface* pPause);
virtual bool DrawDeviceText(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index c93f283..69a12c8 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -104,7 +104,7 @@
const CFX_Matrix& matrix,
BlendMode blend_type);
bool DrawDeviceText(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
@@ -164,7 +164,7 @@
explicit CFX_SkiaDeviceDriver(SkCanvas& canvas);
bool TryDrawText(pdfium::span<const TextCharPos> char_pos,
- const CFX_Font* pFont,
+ const CFX_Font* font,
const CFX_Matrix& matrix,
float font_size,
uint32_t color,
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index ced33d2..461d930 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -685,13 +685,13 @@
}
void CFX_PSRenderer::FindPSFontGlyph(CFX_GlyphCache* pGlyphCache,
- CFX_Font* pFont,
+ CFX_Font* font,
const TextCharPos& charpos,
int* ps_fontnum,
int* ps_glyphindex) {
for (size_t i = 0; i < psfont_list_.size(); ++i) {
const Glyph& glyph = *psfont_list_[i];
- if (glyph.font == pFont && glyph.glyph_index == charpos.glyph_index_ &&
+ if (glyph.font == font && glyph.glyph_index == charpos.glyph_index_ &&
glyph.adjust_matrix.has_value() == charpos.glyph_adjust_) {
bool found;
if (glyph.adjust_matrix.has_value()) {
@@ -712,7 +712,7 @@
}
}
- psfont_list_.push_back(std::make_unique<Glyph>(pFont, charpos.glyph_index_));
+ psfont_list_.push_back(std::make_unique<Glyph>(font, charpos.glyph_index_));
*ps_fontnum = pdfium::checked_cast<int>((psfont_list_.size() - 1) / 256);
*ps_glyphindex = (psfont_list_.size() - 1) % 256;
if (*ps_glyphindex == 0) {
@@ -742,8 +742,8 @@
CFX_Matrix(charpos.adjust_matrix_[0], charpos.adjust_matrix_[1],
charpos.adjust_matrix_[2], charpos.adjust_matrix_[3], 0, 0);
}
- const CFX_Path* pPath = pGlyphCache->LoadGlyphPath(
- pFont, charpos.glyph_index_, charpos.font_char_width_);
+ const CFX_Path* pPath = pGlyphCache->LoadGlyphPath(font, charpos.glyph_index_,
+ charpos.font_char_width_);
if (!pPath) {
return;
}
@@ -852,7 +852,7 @@
bool CFX_PSRenderer::DrawText(int nChars,
const TextCharPos* pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color) {
@@ -882,8 +882,8 @@
<< mtObject2Device.c << " " << mtObject2Device.d << " "
<< mtObject2Device.e << " " << mtObject2Device.f << "]cm\n";
- if (!DrawTextAsType42Font(nChars, pCharPos, pFont, font_size, buf)) {
- DrawTextAsType3Font(nChars, pCharPos, pFont, font_size, buf);
+ if (!DrawTextAsType42Font(nChars, pCharPos, font, font_size, buf)) {
+ DrawTextAsType3Font(nChars, pCharPos, font, font_size, buf);
}
buf << "Q\n";
diff --git a/core/fxge/win32/cfx_psrenderer.h b/core/fxge/win32/cfx_psrenderer.h
index e154c56..00ee417 100644
--- a/core/fxge/win32/cfx_psrenderer.h
+++ b/core/fxge/win32/cfx_psrenderer.h
@@ -93,7 +93,7 @@
const FXDIB_ResampleOptions& options);
bool DrawText(int nChars,
const TextCharPos* pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color);
@@ -141,7 +141,7 @@
void SetGraphState(const CFX_GraphStateData* pGraphState);
void SetColor(uint32_t color);
void FindPSFontGlyph(CFX_GlyphCache* pGlyphCache,
- CFX_Font* pFont,
+ CFX_Font* font,
const TextCharPos& charpos,
int* ps_fontnum,
int* ps_glyphindex);
diff --git a/core/fxge/win32/cgdi_printer_driver.cpp b/core/fxge/win32/cgdi_printer_driver.cpp
index 0879db3..5355bad 100644
--- a/core/fxge/win32/cgdi_printer_driver.cpp
+++ b/core/fxge/win32/cgdi_printer_driver.cpp
@@ -174,7 +174,7 @@
bool CGdiPrinterDriver::DrawDeviceText(
pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
diff --git a/core/fxge/win32/cgdi_printer_driver.h b/core/fxge/win32/cgdi_printer_driver.h
index 8959047..dac525b 100644
--- a/core/fxge/win32/cgdi_printer_driver.h
+++ b/core/fxge/win32/cgdi_printer_driver.h
@@ -43,7 +43,7 @@
const FXDIB_ResampleOptions& options,
BlendMode blend_type) override;
bool DrawDeviceText(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
diff --git a/core/fxge/win32/cps_printer_driver.cpp b/core/fxge/win32/cps_printer_driver.cpp
index fb4377f..deef7cd 100644
--- a/core/fxge/win32/cps_printer_driver.cpp
+++ b/core/fxge/win32/cps_printer_driver.cpp
@@ -200,12 +200,12 @@
bool CPSPrinterDriver::DrawDeviceText(
pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
const CFX_TextRenderOptions& /*options*/) {
- return psrenderer_.DrawText(pCharPos.size(), pCharPos.data(), pFont,
+ return psrenderer_.DrawText(pCharPos.size(), pCharPos.data(), font,
mtObject2Device, font_size, color);
}
diff --git a/core/fxge/win32/cps_printer_driver.h b/core/fxge/win32/cps_printer_driver.h
index 814a0d8..e5899b4 100644
--- a/core/fxge/win32/cps_printer_driver.h
+++ b/core/fxge/win32/cps_printer_driver.h
@@ -66,7 +66,7 @@
const FXDIB_ResampleOptions& options,
BlendMode blend_type) override;
bool DrawDeviceText(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
diff --git a/core/fxge/win32/ctext_only_printer_driver.cpp b/core/fxge/win32/ctext_only_printer_driver.cpp
index bec6546..2709160 100644
--- a/core/fxge/win32/ctext_only_printer_driver.cpp
+++ b/core/fxge/win32/ctext_only_printer_driver.cpp
@@ -122,7 +122,7 @@
bool CTextOnlyPrinterDriver::DrawDeviceText(
pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
@@ -130,7 +130,7 @@
if (g_pdfium_print_mode != WindowsPrintMode::kTextOnly) {
return false;
}
- if (pCharPos.empty() || !pFont) {
+ if (pCharPos.empty() || !font) {
return false;
}
diff --git a/core/fxge/win32/ctext_only_printer_driver.h b/core/fxge/win32/ctext_only_printer_driver.h
index 6a48fa3..1b757e8 100644
--- a/core/fxge/win32/ctext_only_printer_driver.h
+++ b/core/fxge/win32/ctext_only_printer_driver.h
@@ -58,7 +58,7 @@
const FXDIB_ResampleOptions& options,
BlendMode blend_type) override;
bool DrawDeviceText(pdfium::span<const TextCharPos> pCharPos,
- CFX_Font* pFont,
+ CFX_Font* font,
const CFX_Matrix& mtObject2Device,
float font_size,
uint32_t color,
diff --git a/core/fxge/win32/cwin32_platform.cpp b/core/fxge/win32/cwin32_platform.cpp
index 7d42dd4..5673bee 100644
--- a/core/fxge/win32/cwin32_platform.cpp
+++ b/core/fxge/win32/cwin32_platform.cpp
@@ -148,8 +148,8 @@
const TEXTMETRICA* lpntme,
uint32_t font_type,
LPARAM lParam) {
- CFX_Win32FontInfo* pFontInfo = reinterpret_cast<CFX_Win32FontInfo*>(lParam);
- pFontInfo->AddInstalledFont(plf, font_type);
+ CFX_Win32FontInfo* font_info = reinterpret_cast<CFX_Win32FontInfo*>(lParam);
+ font_info->AddInstalledFont(plf, font_type);
return 1;
}
diff --git a/fpdfsdk/cpdfsdk_appstream.cpp b/fpdfsdk/cpdfsdk_appstream.cpp
index 93f4cf6..f1d40d3 100644
--- a/fpdfsdk/cpdfsdk_appstream.cpp
+++ b/fpdfsdk/cpdfsdk_appstream.cpp
@@ -589,14 +589,14 @@
}
}
-ByteString GetFontSetString(IPVT_FontMap* pFontMap,
+ByteString GetFontSetString(IPVT_FontMap* font_map,
int32_t nFontIndex,
float fFontSize) {
- if (!pFontMap) {
+ if (!font_map) {
return ByteString();
}
- ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex);
+ ByteString sFontAlias = font_map->GetPDFFontAlias(nFontIndex);
if (sFontAlias.GetLength() <= 0 || fFontSize <= 0) {
return ByteString();
}
@@ -753,7 +753,7 @@
}
ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
- IPVT_FontMap* pFontMap,
+ IPVT_FontMap* font_map,
RetainPtr<CPDF_Stream> pIconStream,
CPDF_IconFit& IconFit,
const WideString& sLabel,
@@ -763,7 +763,7 @@
const float fAutoFontScale = 1.0f / 3.0f;
auto pEdit = std::make_unique<CPWL_EditImpl>();
- pEdit->SetFontMap(pFontMap);
+ pEdit->SetFontMap(font_map);
pEdit->SetAlignmentH(1);
pEdit->SetAlignmentV(1);
pEdit->SetMultiLine(false);
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp
index 6c91d1a..bd60f79 100644
--- a/fpdfsdk/formfiller/cffl_combobox.cpp
+++ b/fpdfsdk/formfiller/cffl_combobox.cpp
@@ -33,7 +33,7 @@
cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT;
}
- cp.pFontMap = GetOrCreateFontMap();
+ cp.font_map = GetOrCreateFontMap();
return cp;
}
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index b76b0f2..084398e 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -36,7 +36,7 @@
cp.fFontSize = kDefaultListBoxFontSize;
}
- cp.pFontMap = GetOrCreateFontMap();
+ cp.font_map = GetOrCreateFontMap();
return cp;
}
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index c3b5fee..b578b4b 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -80,7 +80,7 @@
cp.dwFlags |= PES_RIGHT;
break;
}
- cp.pFontMap = GetOrCreateFontMap();
+ cp.font_map = GetOrCreateFontMap();
return cp;
}
diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp
index 434b7e3..51edf69 100644
--- a/fpdfsdk/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/fpdf_sysfontinfo.cpp
@@ -153,20 +153,20 @@
}
FPDF_EXPORT void FPDF_CALLCONV
-FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfoExt) {
+FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* font_infoExt) {
auto* mapper = CFX_GEModule::Get()->GetFontMgr()->GetBuiltinMapper();
- if (!pFontInfoExt) {
+ if (!font_infoExt) {
std::unique_ptr<SystemFontInfoIface> info = mapper->TakeSystemFontInfo();
// Delete `info` when it goes out of scope here.
return;
}
- if (pFontInfoExt->version != 1) {
+ if (font_infoExt->version != 1) {
return;
}
mapper->SetSystemFontInfo(
- std::make_unique<CFX_ExternalFontInfo>(pFontInfoExt));
+ std::make_unique<CFX_ExternalFontInfo>(font_infoExt));
#ifdef PDF_ENABLE_XFA
CFGAS_GEModule::Get()->GetFontMgr()->EnumFonts();
@@ -270,28 +270,28 @@
}
FPDF_EXPORT FPDF_SYSFONTINFO* FPDF_CALLCONV FPDF_GetDefaultSystemFontInfo() {
- std::unique_ptr<SystemFontInfoIface> pFontInfo =
+ std::unique_ptr<SystemFontInfoIface> font_info =
CFX_GEModule::Get()->GetPlatform()->CreateDefaultSystemFontInfo();
- if (!pFontInfo) {
+ if (!font_info) {
return nullptr;
}
- FPDF_SYSFONTINFO_DEFAULT* pFontInfoExt =
+ FPDF_SYSFONTINFO_DEFAULT* font_infoExt =
FX_Alloc(FPDF_SYSFONTINFO_DEFAULT, 1);
- pFontInfoExt->DeleteFont = DefaultDeleteFont;
- pFontInfoExt->EnumFonts = DefaultEnumFonts;
- pFontInfoExt->GetFaceName = DefaultGetFaceName;
- pFontInfoExt->GetFont = DefaultGetFont;
- pFontInfoExt->GetFontCharset = DefaultGetFontCharset;
- pFontInfoExt->GetFontData = DefaultGetFontData;
- pFontInfoExt->MapFont = DefaultMapFont;
- pFontInfoExt->Release = DefaultRelease;
- pFontInfoExt->version = 1;
- pFontInfoExt->font_info_ = pFontInfo.release();
- return pFontInfoExt;
+ font_infoExt->DeleteFont = DefaultDeleteFont;
+ font_infoExt->EnumFonts = DefaultEnumFonts;
+ font_infoExt->GetFaceName = DefaultGetFaceName;
+ font_infoExt->GetFont = DefaultGetFont;
+ font_infoExt->GetFontCharset = DefaultGetFontCharset;
+ font_infoExt->GetFontData = DefaultGetFontData;
+ font_infoExt->MapFont = DefaultMapFont;
+ font_infoExt->Release = DefaultRelease;
+ font_infoExt->version = 1;
+ font_infoExt->font_info_ = font_info.release();
+ return font_infoExt;
}
FPDF_EXPORT void FPDF_CALLCONV
-FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo) {
- FX_Free(static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pFontInfo));
+FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* font_info) {
+ FX_Free(static_cast<FPDF_SYSFONTINFO_DEFAULT*>(font_info));
}
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp
index bf2b38b..b6c8c91 100644
--- a/fpdfsdk/pwl/cpwl_edit.cpp
+++ b/fpdfsdk/pwl/cpwl_edit.cpp
@@ -275,14 +275,14 @@
return edit_impl_->IsTextFull();
}
-float CPWL_Edit::GetCharArrayAutoFontSize(const CPDF_Font* pFont,
+float CPWL_Edit::GetCharArrayAutoFontSize(const CPDF_Font* font,
const CFX_FloatRect& rcPlate,
int32_t nCharArray) {
- if (!pFont || pFont->IsStandardFont()) {
+ if (!font || font->IsStandardFont()) {
return 0.0f;
}
- const FX_RECT& rcBBox = pFont->GetFontBBox();
+ const FX_RECT& rcBBox = font->GetFontBBox();
CFX_FloatRect rcCell = rcPlate;
float xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width();
@@ -304,12 +304,12 @@
return;
}
- IPVT_FontMap* pFontMap = GetFontMap();
- if (!pFontMap) {
+ IPVT_FontMap* font_map = GetFontMap();
+ if (!font_map) {
return;
}
- float fFontSize = GetCharArrayAutoFontSize(pFontMap->GetPDFFont(0).Get(),
+ float fFontSize = GetCharArrayAutoFontSize(font_map->GetPDFFont(0).Get(),
GetClientRect(), nCharArray);
if (fFontSize <= 0.0f) {
return;
@@ -437,10 +437,10 @@
return false;
}
}
- if (IPVT_FontMap* pFontMap = this_observed->GetFontMap()) {
+ if (IPVT_FontMap* font_map = this_observed->GetFontMap()) {
FX_Charset nOldCharSet = this_observed->GetCharSet();
FX_Charset nNewCharSet =
- pFontMap->CharSetFromUnicode(nChar, FX_Charset::kDefault);
+ font_map->CharSetFromUnicode(nChar, FX_Charset::kDefault);
if (nOldCharSet != nNewCharSet) {
this_observed->SetCharSet(nNewCharSet);
}
diff --git a/fpdfsdk/pwl/cpwl_edit.h b/fpdfsdk/pwl/cpwl_edit.h
index 5fbf4e9..bf04fe4 100644
--- a/fpdfsdk/pwl/cpwl_edit.h
+++ b/fpdfsdk/pwl/cpwl_edit.h
@@ -92,7 +92,7 @@
void SetText(const WideString& csText);
bool IsTextFull() const;
- static float GetCharArrayAutoFontSize(const CPDF_Font* pFont,
+ static float GetCharArrayAutoFontSize(const CPDF_Font* font,
const CFX_FloatRect& rcPlate,
int32_t nCharArray);
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index 24f703b..18aa66d 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -33,12 +33,12 @@
void DrawTextString(CFX_RenderDevice* pDevice,
const CFX_PointF& pt,
- CPDF_Font* pFont,
+ CPDF_Font* font,
float fFontSize,
const CFX_Matrix& mtUser2Device,
const ByteString& str,
FX_ARGB crTextFill) {
- if (!pFont) {
+ if (!font) {
return;
}
@@ -46,7 +46,7 @@
CPDF_RenderOptions ro;
DCHECK(ro.GetOptions().bClearType);
ro.SetColorMode(CPDF_RenderOptions::kNormal);
- CPDF_TextRenderer::DrawTextString(pDevice, pos.x, pos.y, pFont, fFontSize,
+ CPDF_TextRenderer::DrawTextString(pDevice, pos.x, pos.y, font, fFontSize,
mtUser2Device, str, crTextFill, ro);
}
@@ -96,7 +96,7 @@
class CPWL_EditImpl::Provider final : public CPVT_VariableText::Provider {
public:
- explicit Provider(IPVT_FontMap* pFontMap);
+ explicit Provider(IPVT_FontMap* font_map);
~Provider() override;
// CPVT_VariableText::Provider:
@@ -106,8 +106,8 @@
int32_t nFontIndex) override;
};
-CPWL_EditImpl::Provider::Provider(IPVT_FontMap* pFontMap)
- : CPVT_VariableText::Provider(pFontMap) {}
+CPWL_EditImpl::Provider::Provider(IPVT_FontMap* font_map)
+ : CPVT_VariableText::Provider(font_map) {}
CPWL_EditImpl::Provider::~Provider() = default;
@@ -625,8 +625,8 @@
}
Iterator* pIterator = GetIterator();
- IPVT_FontMap* pFontMap = GetFontMap();
- if (!pFontMap) {
+ IPVT_FontMap* font_map = GetFontMap();
+ if (!font_map) {
return;
}
@@ -679,7 +679,7 @@
if (!sTextBuf.IsEmpty()) {
DrawTextString(pDevice,
CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
- pFontMap->GetPDFFont(nFontIndex).Get(), fFontSize,
+ font_map->GetPDFFont(nFontIndex).Get(), fFontSize,
mtUser2Device, sTextBuf, crOldFill);
sTextBuf.clear();
}
@@ -692,7 +692,7 @@
DrawTextString(
pDevice,
CFX_PointF(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y),
- pFontMap->GetPDFFont(word.nFontIndex).Get(), fFontSize,
+ font_map->GetPDFFont(word.nFontIndex).Get(), fFontSize,
mtUser2Device,
GetPDFWordString(word.nFontIndex, word.Word, SubWord), crCurFill);
}
@@ -702,7 +702,7 @@
if (!sTextBuf.IsEmpty()) {
DrawTextString(pDevice,
CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
- pFontMap->GetPDFFont(nFontIndex).Get(), fFontSize,
+ font_map->GetPDFFont(nFontIndex).Get(), fFontSize,
mtUser2Device, sTextBuf, crOldFill);
}
}
@@ -718,8 +718,8 @@
SetCaretOrigin();
}
-void CPWL_EditImpl::SetFontMap(IPVT_FontMap* pFontMap) {
- vt_provider_ = std::make_unique<Provider>(pFontMap);
+void CPWL_EditImpl::SetFontMap(IPVT_FontMap* font_map) {
+ vt_provider_ = std::make_unique<Provider>(font_map);
vt_->SetProvider(vt_provider_.get());
}
@@ -2017,8 +2017,8 @@
FX_Charset CPWL_EditImpl::GetCharSetFromUnicode(uint16_t word,
FX_Charset nOldCharset) {
- if (IPVT_FontMap* pFontMap = GetFontMap()) {
- return pFontMap->CharSetFromUnicode(word, nOldCharset);
+ if (IPVT_FontMap* font_map = GetFontMap()) {
+ return font_map->CharSetFromUnicode(word, nOldCharset);
}
return nOldCharset;
}
@@ -2031,8 +2031,8 @@
ByteString CPWL_EditImpl::GetPDFWordString(int32_t nFontIndex,
uint16_t Word,
uint16_t SubWord) {
- IPVT_FontMap* pFontMap = GetFontMap();
- RetainPtr<CPDF_Font> pPDFFont = pFontMap->GetPDFFont(nFontIndex);
+ IPVT_FontMap* font_map = GetFontMap();
+ RetainPtr<CPDF_Font> pPDFFont = font_map->GetPDFFont(nFontIndex);
if (!pPDFFont) {
return ByteString();
}
@@ -2043,7 +2043,7 @@
} else {
uint32_t dwCharCode = pPDFFont->IsUnicodeCompatible()
? pPDFFont->CharCodeFromUnicode(Word)
- : pFontMap->CharCodeFromUnicode(nFontIndex, Word);
+ : font_map->CharCodeFromUnicode(nFontIndex, Word);
if (dwCharCode > 0) {
pPDFFont->AppendChar(&sWord, dwCharCode);
return sWord;
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.h b/fpdfsdk/pwl/cpwl_edit_impl.h
index 956d5df..99dcf97 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.h
+++ b/fpdfsdk/pwl/cpwl_edit_impl.h
@@ -54,7 +54,7 @@
IPWL_FillerNotify* pFillerNotify,
IPWL_FillerNotify::PerWindowData* pSystemData);
- void SetFontMap(IPVT_FontMap* pFontMap);
+ void SetFontMap(IPVT_FontMap* font_map);
void SetNotify(CPWL_Edit* pNotify);
// Returns an iterator for the contents. Should not be released.
diff --git a/fpdfsdk/pwl/cpwl_list_ctrl.cpp b/fpdfsdk/pwl/cpwl_list_ctrl.cpp
index 0403290..6e9db91 100644
--- a/fpdfsdk/pwl/cpwl_list_ctrl.cpp
+++ b/fpdfsdk/pwl/cpwl_list_ctrl.cpp
@@ -25,8 +25,8 @@
CPWL_ListCtrl::Item::~Item() = default;
-void CPWL_ListCtrl::Item::SetFontMap(IPVT_FontMap* pFontMap) {
- edit_->SetFontMap(pFontMap);
+void CPWL_ListCtrl::Item::SetFontMap(IPVT_FontMap* font_map) {
+ edit_->SetFontMap(font_map);
}
void CPWL_ListCtrl::Item::SetText(const WideString& text) {
diff --git a/fpdfsdk/pwl/cpwl_list_ctrl.h b/fpdfsdk/pwl/cpwl_list_ctrl.h
index 45ad7f2..3d7e582 100644
--- a/fpdfsdk/pwl/cpwl_list_ctrl.h
+++ b/fpdfsdk/pwl/cpwl_list_ctrl.h
@@ -66,7 +66,7 @@
void SetCaret(int32_t nItemIndex);
WideString GetText() const;
- void SetFontMap(IPVT_FontMap* pFontMap) { font_map_ = pFontMap; }
+ void SetFontMap(IPVT_FontMap* font_map) { font_map_ = font_map; }
void SetFontSize(float fFontSize) { font_size_ = fFontSize; }
CFX_FloatRect GetPlateRect() const { return plate_rect_; }
void SetPlateRect(const CFX_FloatRect& rect);
@@ -87,7 +87,7 @@
Item();
~Item();
- void SetFontMap(IPVT_FontMap* pFontMap);
+ void SetFontMap(IPVT_FontMap* font_map);
CPWL_EditImpl* GetEdit() const { return edit_.get(); }
void SetRect(const CFX_FloatRect& rect) { list_item_rect_ = rect; }
diff --git a/fpdfsdk/pwl/cpwl_wnd.h b/fpdfsdk/pwl/cpwl_wnd.h
index 6631fd0..972fd94 100644
--- a/fpdfsdk/pwl/cpwl_wnd.h
+++ b/fpdfsdk/pwl/cpwl_wnd.h
@@ -95,7 +95,7 @@
CFX_FloatRect rcRectWnd;
ObservedPtr<CFX_Timer::HandlerIface> const pTimerHandler;
UnownedPtr<IPWL_FillerNotify> const pFillerNotify;
- UnownedPtr<IPVT_FontMap> pFontMap;
+ UnownedPtr<IPVT_FontMap> font_map;
ObservedPtr<ProviderIface> pProvider;
// Optional:
@@ -261,7 +261,7 @@
CFX_PointF GetCenterPoint() const;
const CFX_FloatRect& GetClipRect() const;
- IPVT_FontMap* GetFontMap() const { return creation_params_.pFontMap; }
+ IPVT_FontMap* GetFontMap() const { return creation_params_.font_map; }
private:
void DrawChildAppearance(CFX_RenderDevice* pDevice,
diff --git a/fxbarcode/cfx_barcode.cpp b/fxbarcode/cfx_barcode.cpp
index 2a1a350..b669487 100644
--- a/fxbarcode/cfx_barcode.cpp
+++ b/fxbarcode/cfx_barcode.cpp
@@ -152,7 +152,7 @@
}
}
-bool CFX_Barcode::SetFont(CFX_Font* pFont) {
+bool CFX_Barcode::SetFont(CFX_Font* font) {
if (!bc_engine_) {
return false;
}
@@ -166,7 +166,7 @@
case BC_TYPE::kEAN8:
case BC_TYPE::kEAN13:
case BC_TYPE::kUPCA:
- return static_cast<CBC_OneCode*>(bc_engine_.get())->SetFont(pFont);
+ return static_cast<CBC_OneCode*>(bc_engine_.get())->SetFont(font);
default:
return false;
}
diff --git a/fxbarcode/cfx_barcode.h b/fxbarcode/cfx_barcode.h
index 3163cc6..d5a8cb6 100644
--- a/fxbarcode/cfx_barcode.h
+++ b/fxbarcode/cfx_barcode.h
@@ -39,7 +39,7 @@
bool SetDataLength(int32_t length);
bool SetCalChecksum(bool state);
- bool SetFont(CFX_Font* pFont);
+ bool SetFont(CFX_Font* font);
bool SetFontSize(float size);
bool SetFontColor(FX_ARGB color);
diff --git a/public/fpdf_sysfontinfo.h b/public/fpdf_sysfontinfo.h
index 2dac855..f3bc544 100644
--- a/public/fpdf_sysfontinfo.h
+++ b/public/fpdf_sysfontinfo.h
@@ -270,7 +270,7 @@
// Function: FPDF_SetSystemFontInfo
// Set the system font info interface into PDFium
// Parameters:
-// pFontInfo - Pointer to a FPDF_SYSFONTINFO structure
+// font_info - Pointer to a FPDF_SYSFONTINFO structure
// Return Value:
// None
// Comments:
@@ -281,7 +281,7 @@
// Call this with NULL to tell PDFium to stop using a previously set
// |FPDF_SYSFONTINFO|.
FPDF_EXPORT void FPDF_CALLCONV
-FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
+FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* font_info);
// Function: FPDF_GetDefaultSystemFontInfo
// Get default system font info interface for current platform
@@ -301,14 +301,14 @@
// Function: FPDF_FreeDefaultSystemFontInfo
// Free a default system font info interface
// Parameters:
-// pFontInfo - Pointer to a FPDF_SYSFONTINFO structure
+// font_info - Pointer to a FPDF_SYSFONTINFO structure
// Return Value:
// None
// Comments:
// This function should be called on the output from
// FPDF_GetDefaultSystemFontInfo() once it is no longer needed.
FPDF_EXPORT void FPDF_CALLCONV
-FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
+FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* font_info);
#ifdef __cplusplus
}
diff --git a/xfa/fde/cfde_texteditengine.cpp b/xfa/fde/cfde_texteditengine.cpp
index 4c8c4d1..f9ba51c 100644
--- a/xfa/fde/cfde_texteditengine.cpp
+++ b/xfa/fde/cfde_texteditengine.cpp
@@ -1087,7 +1087,7 @@
tr.pEdtEngine = this;
tr.iStart = piece.nStart;
tr.iLength = piece.nCount;
- tr.pFont = font_;
+ tr.font = font_;
tr.fFontSize = font_size_;
tr.dwStyles = text_break_.GetLayoutStyles();
tr.dwCharStyles = piece.dwCharStyles;
@@ -1105,7 +1105,7 @@
tr.pEdtEngine = this;
tr.iStart = piece.nStart;
tr.iLength = piece.nCount;
- tr.pFont = font_;
+ tr.font = font_;
tr.fFontSize = font_size_;
tr.dwStyles = text_break_.GetLayoutStyles();
tr.dwCharStyles = piece.dwCharStyles;
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index 0bf638c..2e34293 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -538,7 +538,7 @@
tr.wsStr = text_.Substr(pPiece->start_char);
tr.pWidths = pdfium::span(char_widths_).subspan(pPiece->start_char);
tr.iLength = checked_cast<int32_t>(pPiece->char_count);
- tr.pFont = font_;
+ tr.font = font_;
tr.fFontSize = font_size_;
tr.dwStyles = txt_bk_styles_;
tr.dwCharStyles = pPiece->char_styles;
diff --git a/xfa/fde/cfde_textout.h b/xfa/fde/cfde_textout.h
index c25543f..2adb97d 100644
--- a/xfa/fde/cfde_textout.h
+++ b/xfa/fde/cfde_textout.h
@@ -30,7 +30,7 @@
public:
static bool DrawString(CFX_RenderDevice* device,
FX_ARGB color,
- const RetainPtr<CFGAS_GEFont>& pFont,
+ const RetainPtr<CFGAS_GEFont>& font,
span<TextCharPos> pCharPos,
float fFontSize,
const CFX_Matrix& matrix);
@@ -38,7 +38,7 @@
CFDE_TextOut();
~CFDE_TextOut();
- void SetFont(RetainPtr<CFGAS_GEFont> pFont);
+ void SetFont(RetainPtr<CFGAS_GEFont> font);
void SetFontSize(float fFontSize);
void SetTextColor(FX_ARGB color) { txt_color_ = color; }
void SetStyles(const FDE_TextStyle& dwStyles);
diff --git a/xfa/fgas/font/cfgas_defaultfontmanager.cpp b/xfa/fgas/font/cfgas_defaultfontmanager.cpp
index 6d4ea77..e22e19e 100644
--- a/xfa/fgas/font/cfgas_defaultfontmanager.cpp
+++ b/xfa/fgas/font/cfgas_defaultfontmanager.cpp
@@ -19,11 +19,11 @@
RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetFont(
WideString wsFontName,
uint32_t dwFontStyles) {
- CFGAS_FontMgr* pFontMgr = CFGAS_GEModule::Get()->GetFontMgr();
- RetainPtr<CFGAS_GEFont> pFont = pFontMgr->LoadFont(
+ CFGAS_FontMgr* font_mgr = CFGAS_GEModule::Get()->GetFontMgr();
+ RetainPtr<CFGAS_GEFont> font = font_mgr->LoadFont(
wsFontName.c_str(), dwFontStyles, FX_CodePage::kFailure);
- if (pFont) {
- return pFont;
+ if (font) {
+ return font;
}
const FGAS_FontInfo* pCurFont =
FGAS_FontInfoByFontName(wsFontName.AsStringView());
@@ -49,10 +49,10 @@
segment = replace_view;
replace_view = ByteStringView();
}
- pFont = pFontMgr->LoadFont(WideString::FromASCII(segment).c_str(), dwStyle,
- FX_CodePage::kFailure);
- if (pFont) {
- return pFont;
+ font = font_mgr->LoadFont(WideString::FromASCII(segment).c_str(), dwStyle,
+ FX_CodePage::kFailure);
+ if (font) {
+ return font;
}
}
return nullptr;
@@ -61,12 +61,12 @@
// static
RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetDefaultFont(
uint32_t dwFontStyles) {
- CFGAS_FontMgr* pFontMgr = CFGAS_GEModule::Get()->GetFontMgr();
- RetainPtr<CFGAS_GEFont> pFont =
- pFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, FX_CodePage::kFailure);
- if (pFont) {
- return pFont;
+ CFGAS_FontMgr* font_mgr = CFGAS_GEModule::Get()->GetFontMgr();
+ RetainPtr<CFGAS_GEFont> font =
+ font_mgr->LoadFont(L"Arial Narrow", dwFontStyles, FX_CodePage::kFailure);
+ if (font) {
+ return font;
}
- return pFontMgr->LoadFont(nullptr, dwFontStyles, FX_CodePage::kFailure);
+ return font_mgr->LoadFont(nullptr, dwFontStyles, FX_CodePage::kFailure);
}
diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp
index d6be61c..74fc7c3 100644
--- a/xfa/fgas/font/cfgas_fontmgr.cpp
+++ b/xfa/fgas/font/cfgas_fontmgr.cpp
@@ -45,8 +45,8 @@
namespace {
-bool VerifyUnicode(const RetainPtr<CFGAS_GEFont>& pFont, wchar_t wcUnicode) {
- RetainPtr<CFX_Face> pFace = pFont->GetDevFont()->GetFace();
+bool VerifyUnicode(const RetainPtr<CFGAS_GEFont>& font, wchar_t wcUnicode) {
+ RetainPtr<CFX_Face> pFace = font->GetDevFont()->GetFace();
if (!pFace) {
return false;
}
@@ -96,22 +96,22 @@
FX_CodePage wCodePage;
};
-int32_t GetSimilarityScore(FX_FONTDESCRIPTOR const* pFont,
+int32_t GetSimilarityScore(FX_FONTDESCRIPTOR const* font,
uint32_t dwFontStyles) {
int32_t iValue = 0;
if (FontStyleIsSymbolic(dwFontStyles) ==
- FontStyleIsSymbolic(pFont->dwFontStyles)) {
+ FontStyleIsSymbolic(font->dwFontStyles)) {
iValue += 64;
}
if (FontStyleIsFixedPitch(dwFontStyles) ==
- FontStyleIsFixedPitch(pFont->dwFontStyles)) {
+ FontStyleIsFixedPitch(font->dwFontStyles)) {
iValue += 32;
}
- if (FontStyleIsSerif(dwFontStyles) == FontStyleIsSerif(pFont->dwFontStyles)) {
+ if (FontStyleIsSerif(dwFontStyles) == FontStyleIsSerif(font->dwFontStyles)) {
iValue += 16;
}
if (FontStyleIsScript(dwFontStyles) ==
- FontStyleIsScript(pFont->dwFontStyles)) {
+ FontStyleIsScript(font->dwFontStyles)) {
iValue += 8;
}
return iValue;
@@ -268,20 +268,20 @@
}
FX_CodePage newCodePage = FX_GetCodePageFromCharset(pFD->uCharSet);
- RetainPtr<CFGAS_GEFont> pFont =
+ RetainPtr<CFGAS_GEFont> font =
CFGAS_GEFont::LoadFont(pFD->wsFontFace, dwFontStyles, newCodePage);
- if (!pFont) {
+ if (!font) {
return nullptr;
}
- pFont->SetLogicalFontStyle(dwFontStyles);
- if (!VerifyUnicode(pFont, wUnicode)) {
+ font->SetLogicalFontStyle(dwFontStyles);
+ if (!VerifyUnicode(font, wUnicode)) {
failed_unicodes_set_.insert(wUnicode);
return nullptr;
}
- hash_2fonts_[dwHash].push_back(pFont);
- return pFont;
+ hash_2fonts_[dwHash].push_back(font);
+ return font;
}
const FX_FONTDESCRIPTOR* CFGAS_FontMgr::FindFont(const wchar_t* pszFontFamily,
@@ -514,9 +514,9 @@
return flags;
}
-RetainPtr<IFX_SeekableReadStream> CreateFontStream(CFX_FontMapper* pFontMapper,
+RetainPtr<IFX_SeekableReadStream> CreateFontStream(CFX_FontMapper* font_mapper,
size_t index) {
- FixedSizeDataVector<uint8_t> buffer = pFontMapper->RawBytesForIndex(index);
+ FixedSizeDataVector<uint8_t> buffer = font_mapper->RawBytesForIndex(index);
if (buffer.empty()) {
return nullptr;
}
@@ -525,27 +525,27 @@
RetainPtr<IFX_SeekableReadStream> CreateFontStream(
const ByteString& bsFaceName) {
- CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
- CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper();
- pFontMapper->LoadInstalledFonts();
+ CFX_FontMgr* font_mgr = CFX_GEModule::Get()->GetFontMgr();
+ CFX_FontMapper* font_mapper = font_mgr->GetBuiltinMapper();
+ font_mapper->LoadInstalledFonts();
- for (size_t i = 0; i < pFontMapper->GetFaceSize(); ++i) {
- if (pFontMapper->GetFaceName(i) == bsFaceName) {
- return CreateFontStream(pFontMapper, i);
+ for (size_t i = 0; i < font_mapper->GetFaceSize(); ++i) {
+ if (font_mapper->GetFaceName(i) == bsFaceName) {
+ return CreateFontStream(font_mapper, i);
}
}
return nullptr;
}
RetainPtr<CFX_Face> LoadFace(
- const RetainPtr<IFX_SeekableReadStream>& pFontStream,
+ const RetainPtr<IFX_SeekableReadStream>& font_stream,
int32_t iFaceIndex) {
- if (!pFontStream) {
+ if (!font_stream) {
return nullptr;
}
- CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
- FXFT_LibraryRec* library = pFontMgr->GetFTLibrary();
+ CFX_FontMgr* font_mgr = CFX_GEModule::Get()->GetFontMgr();
+ FXFT_LibraryRec* library = font_mgr->GetFTLibrary();
if (!library) {
return nullptr;
}
@@ -559,9 +559,9 @@
*ftStream = {}; // Aggregate initialization.
static_assert(std::is_aggregate_v<std::remove_pointer_t<decltype(ftStream)>>);
ftStream->base = nullptr;
- ftStream->descriptor.pointer = static_cast<void*>(pFontStream.Get());
+ ftStream->descriptor.pointer = static_cast<void*>(font_stream.Get());
ftStream->pos = 0;
- ftStream->size = static_cast<unsigned long>(pFontStream->GetSize());
+ ftStream->size = static_cast<unsigned long>(font_stream->GetSize());
ftStream->read = ftStreamRead;
ftStream->close = ftStreamClose;
@@ -695,20 +695,20 @@
CFGAS_FontMgr::~CFGAS_FontMgr() = default;
bool CFGAS_FontMgr::EnumFontsFromFontMapper() {
- CFX_FontMapper* pFontMapper =
+ CFX_FontMapper* font_mapper =
CFX_GEModule::Get()->GetFontMgr()->GetBuiltinMapper();
- pFontMapper->LoadInstalledFonts();
+ font_mapper->LoadInstalledFonts();
- for (size_t i = 0; i < pFontMapper->GetFaceSize(); ++i) {
- RetainPtr<IFX_SeekableReadStream> pFontStream =
- CreateFontStream(pFontMapper, i);
- if (!pFontStream) {
+ for (size_t i = 0; i < font_mapper->GetFaceSize(); ++i) {
+ RetainPtr<IFX_SeekableReadStream> font_stream =
+ CreateFontStream(font_mapper, i);
+ if (!font_stream) {
continue;
}
WideString wsFaceName =
- WideString::FromDefANSI(pFontMapper->GetFaceName(i).AsStringView());
- RegisterFaces(pFontStream, wsFaceName);
+ WideString::FromDefANSI(font_mapper->GetFaceName(i).AsStringView());
+ RegisterFaces(font_stream, wsFaceName);
}
return !installed_fonts_.empty();
@@ -730,18 +730,18 @@
MatchFonts(wCodePage, dwFontStyles, pszFontFamily, wUnicode);
}
for (const auto& info : hash_2candidate_list_[dwHash]) {
- CFGAS_FontDescriptor* pDesc = info.pFont;
+ CFGAS_FontDescriptor* pDesc = info.font;
if (!VerifyUnicodeForFontDescriptor(pDesc, wUnicode)) {
continue;
}
- RetainPtr<CFGAS_GEFont> pFont =
+ RetainPtr<CFGAS_GEFont> font =
LoadFontInternal(pDesc->face_name_, pDesc->face_index_);
- if (!pFont) {
+ if (!font) {
continue;
}
- pFont->SetLogicalFontStyle(dwFontStyles);
- hash_2fonts_[dwHash].push_back(pFont);
- return pFont;
+ font->SetLogicalFontStyle(dwFontStyles);
+ hash_2fonts_[dwHash].push_back(font);
+ return font;
}
if (!pszFontFamily) {
failed_unicodes_set_.insert(wUnicode);
@@ -752,14 +752,14 @@
RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::LoadFontInternal(
const WideString& wsFaceName,
int32_t iFaceIndex) {
- RetainPtr<IFX_SeekableReadStream> pFontStream =
+ RetainPtr<IFX_SeekableReadStream> font_stream =
CreateFontStream(wsFaceName.ToUTF8());
- if (!pFontStream) {
+ if (!font_stream) {
return nullptr;
}
auto pInternalFont = std::make_unique<CFX_Font>();
- if (!pInternalFont->LoadFile(std::move(pFontStream), iFaceIndex)) {
+ if (!pInternalFont->LoadFile(std::move(font_stream), iFaceIndex)) {
return nullptr;
}
@@ -772,13 +772,13 @@
const WideString& FontName,
wchar_t wcUnicode) {
std::vector<CFGAS_FontDescriptorInfo> matched_fonts;
- for (const auto& pFont : installed_fonts_) {
+ for (const auto& font : installed_fonts_) {
int32_t nPenalty =
- CalcPenalty(pFont.get(), wCodePage, dwFontStyles, FontName, wcUnicode);
+ CalcPenalty(font.get(), wCodePage, dwFontStyles, FontName, wcUnicode);
if (nPenalty >= 0xffff) {
continue;
}
- matched_fonts.push_back({pFont.get(), nPenalty});
+ matched_fonts.push_back({font.get(), nPenalty});
if (matched_fonts.size() == 0xffff) {
break;
}
@@ -793,23 +793,23 @@
return;
}
- auto pFont = std::make_unique<CFGAS_FontDescriptor>();
- pFont->font_styles_ |= GetFlags(pFace);
+ auto font = std::make_unique<CFGAS_FontDescriptor>();
+ font->font_styles_ |= GetFlags(pFace);
std::optional<std::array<uint32_t, 4>> unicode_range =
pFace->GetOs2UnicodeRange();
if (unicode_range.has_value()) {
- fxcrt::Copy(unicode_range.value(), pFont->usb_);
+ fxcrt::Copy(unicode_range.value(), font->usb_);
} else {
- std::ranges::fill(pFont->usb_, 0);
+ std::ranges::fill(font->usb_, 0);
}
std::optional<std::array<uint32_t, 2>> code_page_range =
pFace->GetOs2CodePageRange();
if (code_page_range.has_value()) {
- fxcrt::Copy(code_page_range.value(), pFont->csb_);
+ fxcrt::Copy(code_page_range.value(), font->csb_);
} else {
- std::ranges::fill(pFont->csb_, 0);
+ std::ranges::fill(font->csb_, 0);
}
static constexpr uint32_t kNameTag =
@@ -823,22 +823,22 @@
table.clear();
}
}
- pFont->family_names_ = GetNames(table);
- pFont->family_names_.push_back(
+ font->family_names_ = GetNames(table);
+ font->family_names_.push_back(
WideString::FromUTF8(pFace->GetRec()->family_name));
- pFont->face_name_ = wsFaceName;
- pFont->face_index_ =
+ font->face_name_ = wsFaceName;
+ font->face_index_ =
pdfium::checked_cast<int32_t>(pFace->GetRec()->face_index);
- installed_fonts_.push_back(std::move(pFont));
+ installed_fonts_.push_back(std::move(font));
}
void CFGAS_FontMgr::RegisterFaces(
- const RetainPtr<IFX_SeekableReadStream>& pFontStream,
+ const RetainPtr<IFX_SeekableReadStream>& font_stream,
const WideString& wsFaceName) {
int32_t index = 0;
int32_t num_faces = 0;
do {
- RetainPtr<CFX_Face> pFace = LoadFace(pFontStream, index++);
+ RetainPtr<CFX_Face> pFace = LoadFace(font_stream, index++);
if (!pFace) {
continue;
}
@@ -858,9 +858,9 @@
uint32_t dwFontStyles,
const wchar_t* pszFontFamily) {
uint32_t dwHash = ShortFormHash(wCodePage, dwFontStyles, pszFontFamily);
- auto* pFontVector = &hash_2fonts_[dwHash];
- if (!pFontVector->empty()) {
- for (auto iter = pFontVector->begin(); iter != pFontVector->end(); ++iter) {
+ auto* font_vector = &hash_2fonts_[dwHash];
+ if (!font_vector->empty()) {
+ for (auto iter = font_vector->begin(); iter != font_vector->end(); ++iter) {
if (*iter != nullptr) {
return *iter;
}
@@ -884,7 +884,7 @@
return nullptr;
}
- RetainPtr<CFGAS_GEFont> pFont =
+ RetainPtr<CFGAS_GEFont> font =
CFGAS_GEFont::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage);
#else // BUILDFLAG(IS_WIN)
if (!pdfium::Contains(hash_2candidate_list_, dwHash)) {
@@ -895,18 +895,18 @@
return nullptr;
}
- CFGAS_FontDescriptor* pDesc = hash_2candidate_list_[dwHash].front().pFont;
- RetainPtr<CFGAS_GEFont> pFont =
+ CFGAS_FontDescriptor* pDesc = hash_2candidate_list_[dwHash].front().font;
+ RetainPtr<CFGAS_GEFont> font =
LoadFontInternal(pDesc->face_name_, pDesc->face_index_);
#endif // BUILDFLAG(IS_WIN)
- if (!pFont) {
+ if (!font) {
return nullptr;
}
- pFont->SetLogicalFontStyle(dwFontStyles);
- pFontVector->push_back(pFont);
- return pFont;
+ font->SetLogicalFontStyle(dwFontStyles);
+ font_vector->push_back(font);
+ return font;
}
RetainPtr<CFGAS_GEFont> CFGAS_FontMgr::GetFontByUnicode(
@@ -924,9 +924,9 @@
wCodePage == FX_CodePage::kFailure
? LongFormHash(wCodePage, wBitField, dwFontStyles, pszFontFamily)
: ShortFormHash(wCodePage, dwFontStyles, pszFontFamily);
- for (auto& pFont : hash_2fonts_[dwHash]) {
- if (VerifyUnicode(pFont, wUnicode)) {
- return pFont;
+ for (auto& font : hash_2fonts_[dwHash]) {
+ if (VerifyUnicode(font, wUnicode)) {
+ return font;
}
}
return GetFontByUnicodeImpl(wUnicode, dwFontStyles, pszFontFamily, dwHash,
@@ -938,9 +938,9 @@
FX_CodePage wCodePage) {
#if BUILDFLAG(IS_WIN)
uint32_t dwHash = ShortFormHash(wCodePage, dwFontStyles, pszFontFamily);
- std::vector<RetainPtr<CFGAS_GEFont>>* pFontArray = &hash_2fonts_[dwHash];
- if (!pFontArray->empty()) {
- return pFontArray->front();
+ std::vector<RetainPtr<CFGAS_GEFont>>* font_array = &hash_2fonts_[dwHash];
+ if (!font_array->empty()) {
+ return font_array->front();
}
const FX_FONTDESCRIPTOR* pFD =
@@ -954,15 +954,15 @@
return nullptr;
}
- RetainPtr<CFGAS_GEFont> pFont =
+ RetainPtr<CFGAS_GEFont> font =
CFGAS_GEFont::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage);
- if (!pFont) {
+ if (!font) {
return nullptr;
}
- pFont->SetLogicalFontStyle(dwFontStyles);
- pFontArray->push_back(pFont);
- return pFont;
+ font->SetLogicalFontStyle(dwFontStyles);
+ font_array->push_back(font);
+ return font;
#else // BUILDFLAG(IS_WIN)
return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily);
#endif // BUILDFLAG(IS_WIN)
diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h
index a905bb2..fd39700 100644
--- a/xfa/fgas/font/cfgas_fontmgr.h
+++ b/xfa/fgas/font/cfgas_fontmgr.h
@@ -70,7 +70,7 @@
struct CFGAS_FontDescriptorInfo {
public:
- UNOWNED_PTR_EXCLUSION CFGAS_FontDescriptor* pFont; // POD struct.
+ UNOWNED_PTR_EXCLUSION CFGAS_FontDescriptor* font; // POD struct.
int32_t nPenalty;
bool operator>(const CFGAS_FontDescriptorInfo& other) const {
@@ -122,7 +122,7 @@
#else // BUILDFLAG(IS_WIN)
bool EnumFontsFromFontMapper();
void RegisterFace(RetainPtr<CFX_Face> pFace, const WideString& wsFaceName);
- void RegisterFaces(const RetainPtr<IFX_SeekableReadStream>& pFontStream,
+ void RegisterFaces(const RetainPtr<IFX_SeekableReadStream>& font_stream,
const WideString& wsFaceName);
std::vector<CFGAS_FontDescriptorInfo> MatchFonts(FX_CodePage wCodePage,
uint32_t dwFontStyles,
diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h
index 83f8fc0..a275156 100644
--- a/xfa/fgas/font/cfgas_gefont.h
+++ b/xfa/fgas/font/cfgas_gefont.h
@@ -34,8 +34,8 @@
static RetainPtr<CFGAS_GEFont> LoadFont(const wchar_t* pszFontFamily,
uint32_t dwFontStyles,
FX_CodePage wCodePage);
- static RetainPtr<CFGAS_GEFont> LoadFont(RetainPtr<CPDF_Font> pFont);
- static RetainPtr<CFGAS_GEFont> LoadFont(std::unique_ptr<CFX_Font> pFont);
+ static RetainPtr<CFGAS_GEFont> LoadFont(RetainPtr<CPDF_Font> font);
+ static RetainPtr<CFGAS_GEFont> LoadFont(std::unique_ptr<CFX_Font> font);
static RetainPtr<CFGAS_GEFont> LoadStockFont(CPDF_Document* pDoc,
const ByteString& font_family);
diff --git a/xfa/fgas/font/cfgas_pdffontmgr.cpp b/xfa/fgas/font/cfgas_pdffontmgr.cpp
index 73815f9..14c3595 100644
--- a/xfa/fgas/font/cfgas_pdffontmgr.cpp
+++ b/xfa/fgas/font/cfgas_pdffontmgr.cpp
@@ -142,14 +142,14 @@
bool bBold,
bool bItalic,
bool bStrictMatch) {
- RetainPtr<const CPDF_Dictionary> pFontSetDict =
+ RetainPtr<const CPDF_Dictionary> font_set_dict =
doc_->GetRoot()->GetDictFor("AcroForm")->GetDictFor("DR");
- if (!pFontSetDict) {
+ if (!font_set_dict) {
return nullptr;
}
- pFontSetDict = pFontSetDict->GetDictFor("Font");
- if (!pFontSetDict) {
+ font_set_dict = font_set_dict->GetDictFor("Font");
+ if (!font_set_dict) {
return nullptr;
}
@@ -157,7 +157,7 @@
name.Remove(' ');
auto* pData = CPDF_DocPageData::FromDocument(doc_);
- CPDF_DictionaryLocker locker(pFontSetDict);
+ CPDF_DictionaryLocker locker(font_set_dict);
for (const auto& it : locker) {
const ByteString& key = it.first;
const RetainPtr<CPDF_Object>& pObj = it.second;
@@ -165,13 +165,13 @@
bStrictMatch)) {
continue;
}
- RetainPtr<CPDF_Dictionary> pFontDict =
+ RetainPtr<CPDF_Dictionary> font_dict =
ToDictionary(pObj->GetMutableDirect());
- if (!ValidateDictType(pFontDict.Get(), "Font")) {
+ if (!ValidateDictType(font_dict.Get(), "Font")) {
return nullptr;
}
- RetainPtr<CPDF_Font> pPDFFont = pData->GetFont(pFontDict);
+ RetainPtr<CPDF_Font> pPDFFont = pData->GetFont(font_dict);
if (!pPDFFont || !pPDFFont->IsEmbedded()) {
return nullptr;
}
@@ -195,12 +195,12 @@
bool bBold = FontStyleIsForceBold(dwFontStyles);
bool bItalic = FontStyleIsItalic(dwFontStyles);
ByteString strFontName = PsNameToFontName(bsPsName, bBold, bItalic);
- RetainPtr<CFGAS_GEFont> pFont =
+ RetainPtr<CFGAS_GEFont> font =
FindFont(strFontName, bBold, bItalic, bStrictMatch);
- if (!pFont) {
+ if (!font) {
return nullptr;
}
- font_map_[key] = pFont;
- return pFont;
+ font_map_[key] = font;
+ return font;
}
diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp
index d65b522..3bde817 100644
--- a/xfa/fgas/font/fgas_fontutils.cpp
+++ b/xfa/fgas/font/fgas_fontutils.cpp
@@ -2453,14 +2453,14 @@
FX_HashCode_GetLoweredW(wsLocalName.AsStringView());
const FGAS_FontInfo* pBegin = std::begin(kXFAFontsMap);
const FGAS_FontInfo* pEnd = std::end(kXFAFontsMap);
- const FGAS_FontInfo* pFontInfo =
+ const FGAS_FontInfo* font_info =
std::lower_bound(pBegin, pEnd, dwLocalNameHash,
[](const FGAS_FontInfo& entry, uint32_t hash) {
return entry.dwFontNameHash < hash;
});
- if (pFontInfo < pEnd && pFontInfo->dwFontNameHash == dwLocalNameHash) {
- return WideString::FromASCII(ByteStringView(pFontInfo->pPsName));
+ if (font_info < pEnd && font_info->dwFontNameHash == dwLocalNameHash) {
+ return WideString::FromASCII(ByteStringView(font_info->pPsName));
}
return wsLocalName;
}
@@ -2472,14 +2472,14 @@
FX_HashCode_GetLoweredW(wsFontNameTemp.AsStringView());
const FGAS_FontInfo* pBegin = std::begin(kXFAFontsMap);
const FGAS_FontInfo* pEnd = std::end(kXFAFontsMap);
- const FGAS_FontInfo* pFontInfo =
+ const FGAS_FontInfo* font_info =
std::lower_bound(pBegin, pEnd, dwCurFontNameHash,
[](const FGAS_FontInfo& entry, uint32_t hash) {
return entry.dwFontNameHash < hash;
});
- if (pFontInfo < pEnd && pFontInfo->dwFontNameHash == dwCurFontNameHash) {
- return pFontInfo;
+ if (font_info < pEnd && font_info->dwFontNameHash == dwCurFontNameHash) {
+ return font_info;
}
return nullptr;
}
diff --git a/xfa/fgas/layout/cfgas_break.cpp b/xfa/fgas/layout/cfgas_break.cpp
index 09294d5..b68d83a 100644
--- a/xfa/fgas/layout/cfgas_break.cpp
+++ b/xfa/fgas/layout/cfgas_break.cpp
@@ -57,13 +57,13 @@
vertical_scale_ = iScale;
}
-void CFGAS_Break::SetFont(RetainPtr<CFGAS_GEFont> pFont) {
- if (!pFont || pFont == font_) {
+void CFGAS_Break::SetFont(RetainPtr<CFGAS_GEFont> font) {
+ if (!font || font == font_) {
return;
}
SetBreakStatus();
- font_ = std::move(pFont);
+ font_ = std::move(font);
}
void CFGAS_Break::SetFontSize(float fFontSize) {
diff --git a/xfa/fgas/layout/cfgas_break.h b/xfa/fgas/layout/cfgas_break.h
index b82b74f..2c3a4d8 100644
--- a/xfa/fgas/layout/cfgas_break.h
+++ b/xfa/fgas/layout/cfgas_break.h
@@ -35,7 +35,7 @@
void SetLayoutStyles(Mask<LayoutStyle> dwLayoutStyles);
Mask<LayoutStyle> GetLayoutStyles() const { return layout_styles_; }
- void SetFont(RetainPtr<CFGAS_GEFont> pFont);
+ void SetFont(RetainPtr<CFGAS_GEFont> font);
void SetFontSize(float fFontSize);
void SetTabWidth(float fTabWidth);
int32_t GetTabWidth() const { return tab_width_; }
diff --git a/xfa/fgas/layout/cfgas_rtfbreak.cpp b/xfa/fgas/layout/cfgas_rtfbreak.cpp
index 4dbca48..4a7f19f 100644
--- a/xfa/fgas/layout/cfgas_rtfbreak.cpp
+++ b/xfa/fgas/layout/cfgas_rtfbreak.cpp
@@ -746,11 +746,11 @@
size_t CFGAS_RTFBreak::GetDisplayPos(const CFGAS_TextPiece* pPiece,
pdfium::span<TextCharPos> pCharPos) const {
- if (pPiece->iChars == 0 || !pPiece->pFont) {
+ if (pPiece->iChars == 0 || !pPiece->font) {
return 0;
}
- RetainPtr<CFGAS_GEFont> pFont = pPiece->pFont;
+ RetainPtr<CFGAS_GEFont> font = pPiece->font;
CFX_RectF rtText(pPiece->rtPiece);
const bool bRTLPiece = FX_IsOdd(pPiece->iBidiLevel);
const float fFontSize = pPiece->fFontSize;
@@ -759,8 +759,8 @@
return 0;
}
- const int32_t iAscent = pFont->GetAscent();
- const int32_t iDescent = pFont->GetDescent();
+ const int32_t iAscent = font->GetAscent();
+ const int32_t iDescent = font->GetDescent();
const int32_t iMaxHeight = iAscent - iDescent;
const float fAscent = iMaxHeight ? fFontSize * iAscent / iMaxHeight : 0;
wchar_t wPrev = pdfium::unicode::kZeroWidthNoBreakSpace;
@@ -810,9 +810,9 @@
}
if (!bEmptyChar) {
- current_char_pos.glyph_index_ = pFont->GetGlyphIndex(wForm);
+ current_char_pos.glyph_index_ = font->GetGlyphIndex(wForm);
if (current_char_pos.glyph_index_ == 0xFFFF) {
- current_char_pos.glyph_index_ = pFont->GetGlyphIndex(wch);
+ current_char_pos.glyph_index_ = font->GetGlyphIndex(wch);
}
#if BUILDFLAG(IS_APPLE)
current_char_pos.ext_gid_ = current_char_pos.glyph_index_;
diff --git a/xfa/fgas/layout/cfgas_textpiece.h b/xfa/fgas/layout/cfgas_textpiece.h
index 5afc30a..d2f4b04 100644
--- a/xfa/fgas/layout/cfgas_textpiece.h
+++ b/xfa/fgas/layout/cfgas_textpiece.h
@@ -28,7 +28,7 @@
int32_t iBidiLevel = 0;
float fFontSize = 0.0f;
CFX_RectF rtPiece;
- RetainPtr<CFGAS_GEFont> pFont;
+ RetainPtr<CFGAS_GEFont> font;
};
#endif // XFA_FGAS_LAYOUT_CFGAS_TEXTPIECE_H_
diff --git a/xfa/fgas/layout/cfgas_txtbreak.cpp b/xfa/fgas/layout/cfgas_txtbreak.cpp
index 670973d..856fb59 100644
--- a/xfa/fgas/layout/cfgas_txtbreak.cpp
+++ b/xfa/fgas/layout/cfgas_txtbreak.cpp
@@ -672,14 +672,14 @@
WideStringView pStr = run.wsStr.AsStringView();
pdfium::span<int32_t> pWidths = run.pWidths;
int32_t iLength = run.iLength - 1;
- RetainPtr<CFGAS_GEFont> pFont = run.pFont;
+ RetainPtr<CFGAS_GEFont> font = run.font;
Mask<LayoutStyle> dwStyles = run.dwStyles;
CFX_RectF rtText(*run.pRect);
const bool bRTLPiece = (run.dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0;
const float fFontSize = run.fFontSize;
const int32_t iFontSize = FXSYS_roundf(fFontSize * 20.0f);
- const int32_t iAscent = pFont->GetAscent();
- const int32_t iDescent = pFont->GetDescent();
+ const int32_t iAscent = font->GetAscent();
+ const int32_t iDescent = font->GetDescent();
const int32_t iMaxHeight = iAscent - iDescent;
const float fAscent = iMaxHeight ? fFontSize * iAscent / iMaxHeight : 0;
int32_t iHorScale = run.iHorizontalScale;
@@ -835,10 +835,10 @@
if (bLam) {
form_chars[1].wForm = pdfium::kArabicShadda;
form_chars[1].iWidth =
- pFont->GetCharWidth(pdfium::kArabicShadda).value_or(0);
+ font->GetCharWidth(pdfium::kArabicShadda).value_or(0);
form_chars[2].wForm = pdfium::kArabicLetterSuperscriptAlef;
form_chars[2].iWidth =
- pFont->GetCharWidth(pdfium::kArabicLetterSuperscriptAlef).value_or(0);
+ font->GetCharWidth(pdfium::kArabicLetterSuperscriptAlef).value_or(0);
}
for (int32_t j = 0; j < iForms; j++) {
@@ -851,7 +851,7 @@
wLast = (wchar_t)form_chars[j - 1].wForm;
}
if (!bEmptyChar || (bEmptyChar && !bSkipSpace)) {
- front_ref.glyph_index_ = pFont->GetGlyphIndex(wForm);
+ front_ref.glyph_index_ = font->GetGlyphIndex(wForm);
#if BUILDFLAG(IS_APPLE)
front_ref.ext_gid_ = front_ref.glyph_index_;
#endif
@@ -867,12 +867,12 @@
front_ref.origin_ = CFX_PointF(fX, fY);
if (!!(dwStyles & LayoutStyle::kCombText)) {
- int32_t iFormWidth = pFont->GetCharWidth(wForm).value_or(iCharWidth);
+ int32_t iFormWidth = font->GetCharWidth(wForm).value_or(iCharWidth);
float fOffset = fFontSize * (iCharWidth - iFormWidth) / 2000.0f;
front_ref.origin_.x += fOffset;
}
if (chartype == FX_CHARTYPE::kCombination) {
- std::optional<FX_RECT> rtBBox = pFont->GetCharBBox(wForm);
+ std::optional<FX_RECT> rtBBox = font->GetCharBBox(wForm);
if (rtBBox.has_value()) {
front_ref.origin_.y =
fYBase + fFontSize -
@@ -882,7 +882,7 @@
wLast != pdfium::unicode::kZeroWidthNoBreakSpace) {
if (pdfium::unicode::GetCharType(wLast) ==
FX_CHARTYPE::kCombination) {
- std::optional<FX_RECT> rtOtherBox = pFont->GetCharBBox(wLast);
+ std::optional<FX_RECT> rtOtherBox = font->GetCharBBox(wLast);
if (rtOtherBox.has_value()) {
front_ref.origin_.y -=
fFontSize * rtOtherBox.value().Height() / iMaxHeight;
diff --git a/xfa/fgas/layout/cfgas_txtbreak.h b/xfa/fgas/layout/cfgas_txtbreak.h
index 52bd69f..6ac0071 100644
--- a/xfa/fgas/layout/cfgas_txtbreak.h
+++ b/xfa/fgas/layout/cfgas_txtbreak.h
@@ -57,7 +57,7 @@
// TODO(thestig): These 2 members probably should be size_t.
int32_t iStart = 0;
int32_t iLength = 0;
- RetainPtr<CFGAS_GEFont> pFont;
+ RetainPtr<CFGAS_GEFont> font;
float fFontSize = 12.0f;
Mask<LayoutStyle> dwStyles = LayoutStyle::kNone;
int32_t iHorizontalScale = 100;
diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp
index 86219e7..eaf2ba6 100644
--- a/xfa/fwl/cfwl_barcode.cpp
+++ b/xfa/fwl/cfwl_barcode.cpp
@@ -151,8 +151,8 @@
IFWL_ThemeProvider* pTheme = GetThemeProvider();
CFWL_ThemePart part(CFWL_ThemePart::Part::kNone, this);
- if (RetainPtr<CFGAS_GEFont> pFont = pTheme->GetFont(part)) {
- if (CFX_Font* pCXFont = pFont->GetDevFont()) {
+ if (RetainPtr<CFGAS_GEFont> font = pTheme->GetFont(part)) {
+ if (CFX_Font* pCXFont = font->GetDevFont()) {
barcode_engine_->SetFont(pCXFont);
}
}
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index 50427fa..dc29424 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -480,12 +480,12 @@
CFWL_ThemePart part(CFWL_ThemePart::Part::kNone, this);
font_size_ = theme->GetFontSize(part);
- RetainPtr<CFGAS_GEFont> pFont = theme->GetFont(part);
- if (!pFont) {
+ RetainPtr<CFGAS_GEFont> font = theme->GetFont(part);
+ if (!font) {
return;
}
- edit_engine_->SetFont(pFont);
+ edit_engine_->SetFont(font);
edit_engine_->SetFontColor(theme->GetTextColor(part));
edit_engine_->SetFontSize(font_size_);
edit_engine_->SetLineSpace(theme->GetLineHeight(part));
diff --git a/xfa/fxfa/cxfa_fontmgr.cpp b/xfa/fxfa/cxfa_fontmgr.cpp
index 005ddb8..28b38f8 100644
--- a/xfa/fxfa/cxfa_fontmgr.cpp
+++ b/xfa/fxfa/cxfa_fontmgr.cpp
@@ -31,30 +31,30 @@
}
WideString wsEnglishName = FGAS_FontNameToEnglishName(wsFontFamily);
- RetainPtr<CFGAS_GEFont> pFont =
+ RetainPtr<CFGAS_GEFont> font =
pDoc->GetPDFFont(wsEnglishName, dwFontStyles, true);
- if (pFont) {
- return pFont;
+ if (font) {
+ return font;
}
- pFont = CFGAS_DefaultFontManager::GetFont(wsFontFamily, dwFontStyles);
- if (!pFont) {
- pFont = pDoc->GetPDFFont(wsEnglishName, dwFontStyles, false);
- if (pFont) {
- return pFont;
+ font = CFGAS_DefaultFontManager::GetFont(wsFontFamily, dwFontStyles);
+ if (!font) {
+ font = pDoc->GetPDFFont(wsEnglishName, dwFontStyles, false);
+ if (font) {
+ return font;
}
}
- if (!pFont) {
- pFont = CFGAS_DefaultFontManager::GetDefaultFont(dwFontStyles);
+ if (!font) {
+ font = CFGAS_DefaultFontManager::GetDefaultFont(dwFontStyles);
}
- if (!pFont) {
- pFont = CFGAS_GEFont::LoadStockFont(
+ if (!font) {
+ font = CFGAS_GEFont::LoadStockFont(
pDoc->GetPDFDoc(), ByteString::Format("%ls", wsFontFamily.c_str()));
}
- if (!pFont) {
+ if (!font) {
return nullptr;
}
- font_map_[key] = pFont;
- return pFont;
+ font_map_[key] = font;
+ return font;
}
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp
index d59ad70..3f094c8 100644
--- a/xfa/fxfa/cxfa_textlayout.cpp
+++ b/xfa/fxfa/cxfa_textlayout.cpp
@@ -1131,7 +1131,7 @@
pTP->iLineThrough =
text_parser_->GetLinethrough(text_provider_, pStyle.Get());
pTP->dwColor = text_parser_->GetColor(text_provider_, pStyle.Get());
- pTP->pFont =
+ pTP->font =
text_parser_->GetFont(doc_.Get(), text_provider_, pStyle.Get());
pTP->fFontSize = text_parser_->GetFontSize(text_provider_, pStyle.Get());
pTP->rtPiece.left = pPiece->GetStartPos() / 20000.0f;
@@ -1243,7 +1243,7 @@
const TextPiece* pPiece = pPieceLine->text_pieces_[szPiece].get();
size_t szCount = GetDisplayPos(pPiece, pCharPos);
if (szCount > 0) {
- CFDE_TextOut::DrawString(pDevice, pPiece->dwColor, pPiece->pFont,
+ CFDE_TextOut::DrawString(pDevice, pPiece->dwColor, pPiece->font,
pCharPos.first(szCount), pPiece->fFontSize,
mtDoc2Device);
}
diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp
index dd22642..9ff3de3 100644
--- a/xfa/fxfa/cxfa_textparser.cpp
+++ b/xfa/fxfa/cxfa_textparser.cpp
@@ -385,8 +385,8 @@
}
}
- CXFA_FontMgr* pFontMgr = doc->GetApp()->GetXFAFontMgr();
- return pFontMgr->GetFont(doc, wsFamily, dwStyle);
+ CXFA_FontMgr* font_mgr = doc->GetApp()->GetXFAFontMgr();
+ return font_mgr->GetFont(doc, wsFamily, dwStyle);
}
float CXFA_TextParser::GetFontSize(CXFA_TextProvider* pTextProvider,