diff options
author | Lei Zhang <thestig@chromium.org> | 2015-08-13 18:12:46 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-08-13 18:12:46 -0700 |
commit | 7e4600f3382d1c0916d0114761e67d153da97416 (patch) | |
tree | dcd4e96063f10e4a8607ff63fb1b86393ce4e389 /core | |
parent | 38a5a399a4dc00b8db5db665de68a97d3f86335c (diff) | |
download | pdfium-7e4600f3382d1c0916d0114761e67d153da97416.tar.xz |
XFA: Rewrite CFX_RenderDevice::DrawNormalText() to match the master branch.
Similar CL to https://codereview.chromium.org/1294693002/
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1288673004 .
Diffstat (limited to 'core')
-rw-r--r-- | core/src/fxge/ge/fx_ge_text.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp index b3273f78eb..0bb8eab812 100644 --- a/core/src/fxge/ge/fx_ge_text.cpp +++ b/core/src/fxge/ge/fx_ge_text.cpp @@ -155,16 +155,20 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, int nativetext_flags = text_flags; if (m_DeviceClass != FXDC_DISPLAY) { if (!(text_flags & FXTEXT_PRINTGRAPHICTEXT)) { + bool should_call_draw_device_text = true; #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - if (!(text_flags & FXFONT_CIDFONT) && - pFont->GetPsName().Find(CFX_WideString::FromLocal("+ZJHL")) == -1) - if (pFont->GetPsName() != CFX_WideString::FromLocal("CNAAJI+cmex10")) + if ((text_flags & FXFONT_CIDFONT) || + (pFont->GetPsName().Find(CFX_WideString::FromLocal("+ZJHL")) != -1) || + (pFont->GetPsName() == CFX_WideString::FromLocal("CNAAJI+cmex10"))) { + should_call_draw_device_text = false; + } #endif - if (m_pDeviceDriver->DrawDeviceText( - nChars, pCharPos, pFont, pCache, pText2Device, font_size, - fill_color, alpha_flag, pIccTransform)) { - return TRUE; - } + if (should_call_draw_device_text && + m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, + pText2Device, font_size, fill_color, + alpha_flag, pIccTransform)) { + return TRUE; + } } int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) @@ -173,15 +177,19 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, return FALSE; } } else if (!(text_flags & FXTEXT_NO_NATIVETEXT)) { + bool should_call_draw_device_text = true; #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - if (!(text_flags & FXFONT_CIDFONT)) - if (pFont->GetPsName() != CFX_WideString::FromLocal("CNAAJI+cmex10")) + if ((text_flags & FXFONT_CIDFONT) || + (pFont->GetPsName() == CFX_WideString::FromLocal("CNAAJI+cmex10"))) { + should_call_draw_device_text = false; + } #endif - if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, - pText2Device, font_size, fill_color, - alpha_flag, pIccTransform)) { - return TRUE; - } + if (should_call_draw_device_text && + m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, + pText2Device, font_size, fill_color, + alpha_flag, pIccTransform)) { + return TRUE; + } } CFX_AffineMatrix char2device, deviceCtm, text2Device; if (pText2Device) { |