diff options
Diffstat (limited to 'core/fxge')
-rw-r--r-- | core/fxge/win32/cfx_psrenderer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index d97391822a..ecfab49c38 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -644,16 +644,20 @@ bool CFX_PSRenderer::DrawText(int nChars, const CFX_Matrix* pObject2Device, float font_size, uint32_t color) { - StartRendering(); - int alpha = FXARGB_A(color); - if (alpha < 255) - return false; + // Do not send zero or negative font sizes to printers. See crbug.com/767343. + if (font_size <= 0.0) + return true; if ((pObject2Device->a == 0 && pObject2Device->b == 0) || (pObject2Device->c == 0 && pObject2Device->d == 0)) { return true; } + StartRendering(); + int alpha = FXARGB_A(color); + if (alpha < 255) + return false; + SetColor(color); std::ostringstream buf; buf << "q[" << pObject2Device->a << " " << pObject2Device->b << " " |