summaryrefslogtreecommitdiff
path: root/xfa/fgas/font
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/font')
-rw-r--r--xfa/fgas/font/cfgas_gefont.cpp17
-rw-r--r--xfa/fgas/font/cfgas_gefont.h6
2 files changed, 10 insertions, 13 deletions
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index 83b7ad68d7..6b2cb0f03b 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -185,7 +185,7 @@ bool CFGAS_GEFont::GetCharWidth(wchar_t wUnicode, int32_t& iWidth) {
return iWidth > 0;
}
-bool CFGAS_GEFont::GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox) {
+bool CFGAS_GEFont::GetCharBBox(wchar_t wUnicode, FX_RECT* bbox) {
auto it = m_BBoxMap.find(wUnicode);
if (it != m_BBoxMap.end()) {
*bbox = it->second;
@@ -205,21 +205,18 @@ bool CFGAS_GEFont::GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox) {
if (!m_pFont->GetGlyphBBox(iGlyph, rtBBox))
return false;
- CFX_Rect rt(rtBBox.left, rtBBox.top, rtBBox.Width(), rtBBox.Height());
- m_BBoxMap[wUnicode] = rt;
- *bbox = rt;
+ m_BBoxMap[wUnicode] = rtBBox;
+ *bbox = rtBBox;
return true;
}
-bool CFGAS_GEFont::GetBBox(CFX_Rect* bbox) {
- FX_RECT rt(0, 0, 0, 0);
+bool CFGAS_GEFont::GetBBox(FX_RECT* bbox) {
+ // TODO(thestig): Pass directly into GetBBox().
+ FX_RECT rt;
if (!m_pFont->GetBBox(rt))
return false;
- bbox->left = rt.left;
- bbox->width = rt.Width();
- bbox->top = rt.bottom;
- bbox->height = -rt.Height();
+ *bbox = rt;
return true;
}
diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h
index 646562d9ee..22169d6d3d 100644
--- a/xfa/fgas/font/cfgas_gefont.h
+++ b/xfa/fgas/font/cfgas_gefont.h
@@ -43,8 +43,8 @@ class CFGAS_GEFont : public Retainable {
int32_t GetAscent() const;
int32_t GetDescent() const;
- bool GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox);
- bool GetBBox(CFX_Rect* bbox);
+ bool GetCharBBox(wchar_t wUnicode, FX_RECT* bbox);
+ bool GetBBox(FX_RECT* bbox);
RetainPtr<CFGAS_GEFont> GetSubstFont(int32_t iGlyphIndex);
CFX_Font* GetDevFont() const { return m_pFont; }
@@ -89,7 +89,7 @@ class CFGAS_GEFont : public Retainable {
RetainPtr<IFX_SeekableReadStream> m_pFileRead;
std::unique_ptr<CFX_UnicodeEncoding> m_pFontEncoding;
std::map<wchar_t, int32_t> m_CharWidthMap;
- std::map<wchar_t, CFX_Rect> m_BBoxMap;
+ std::map<wchar_t, FX_RECT> m_BBoxMap;
std::vector<RetainPtr<CFGAS_GEFont>> m_SubstFonts;
std::map<wchar_t, RetainPtr<CFGAS_GEFont>> m_FontMapper;
};