Chromium Code Reviews| Index: core/fpdfapi/fpdf_font/cpdf_font.cpp |
| diff --git a/core/fpdfapi/fpdf_font/cpdf_font.cpp b/core/fpdfapi/fpdf_font/cpdf_font.cpp |
| index 8101bd49a65eab2364ec6cd611466b9eac8e87bc..fe44e539a1bbf5d0534a886276e6b7f9f091469f 100644 |
| --- a/core/fpdfapi/fpdf_font/cpdf_font.cpp |
| +++ b/core/fpdfapi/fpdf_font/cpdf_font.cpp |
| @@ -451,3 +451,24 @@ const FX_CHAR* CPDF_Font::GetAdobeCharName( |
| name = PDF_CharNameFromPredefinedCharSet(iBaseEncoding, charcode); |
| return name && name[0] ? name : nullptr; |
| } |
| + |
| +uint32_t CPDF_Font::FallbackFontFromCharcode(uint32_t charcode, |
|
dsinclair
2016/08/23 19:41:18
This only ever returns 1, can the return value jus
npm
2016/08/23 20:36:57
The intention is that the return value may be diff
|
| + bool* pVertGlyph) { |
| + if (m_FontPlusFallbacks.size() < 2) { |
| + m_FontPlusFallbacks.push_back(new CFX_Font()); |
|
dsinclair
2016/08/23 19:41:18
This font is going to end up leaking. The other fo
npm
2016/08/23 20:36:57
Ok, a vector of unique pointers using only the fal
|
| + m_FontPlusFallbacks[1]->LoadSubst("Arial", IsTrueTypeFont(), m_Flags, |
| + m_StemV * 5, m_ItalicAngle, 0, |
| + IsVertWriting()); |
| + } |
| + return 1; |
| +} |
| + |
| +int CPDF_Font::FallbackGlyphFromCharcode(int fallbackFont, |
| + uint32_t charcode, |
| + bool* pVertGlyph) { |
| + int glyph = FXFT_Get_Char_Index(m_FontPlusFallbacks[fallbackFont]->GetFace(), |
| + charcode); |
| + if (glyph == 0 || glyph == 0xffff) |
| + return -1; |
| + return glyph; |
| +} |