OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 nChars > 1 ? &spacing[1] : nullptr)) { | 313 nChars > 1 ? &spacing[1] : nullptr)) { |
314 return TRUE; | 314 return TRUE; |
315 } | 315 } |
316 | 316 |
317 // Give up and fail if there is no way to get the font to try again. | 317 // Give up and fail if there is no way to get the font to try again. |
318 if (!g_pdfium_typeface_accessible_func) | 318 if (!g_pdfium_typeface_accessible_func) |
319 return FALSE; | 319 return FALSE; |
320 | 320 |
321 // Try to get the font and draw again. | 321 // Try to get the font and draw again. |
322 g_pdfium_typeface_accessible_func(&lf, wsText.c_str(), nChars); | 322 g_pdfium_typeface_accessible_func(&lf, wsText.c_str(), nChars); |
323 return ExtTextOutW(m_hDC, 0, 0, ETO_GLYPH_INDEX, nullptr, wsText.c_str(), | 323 return !!ExtTextOutW(m_hDC, 0, 0, ETO_GLYPH_INDEX, nullptr, wsText.c_str(), |
324 nChars, nChars > 1 ? &spacing[1] : nullptr); | 324 nChars, nChars > 1 ? &spacing[1] : nullptr); |
325 #else | 325 #else |
326 return FALSE; | 326 return FALSE; |
327 #endif | 327 #endif |
328 } | 328 } |
OLD | NEW |