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 "core/include/fxge/fx_ge.h" | 7 #include "core/include/fxge/fx_ge.h" |
8 | 8 |
9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
10 | 10 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 void CPSOutput::Init() { | 287 void CPSOutput::Init() { |
288 m_pBuf = FX_Alloc(FX_CHAR, 1026); | 288 m_pBuf = FX_Alloc(FX_CHAR, 1026); |
289 } | 289 } |
290 void CPSOutput::OutputPS(const FX_CHAR* str, int len) { | 290 void CPSOutput::OutputPS(const FX_CHAR* str, int len) { |
291 if (len < 0) { | 291 if (len < 0) { |
292 len = (int)FXSYS_strlen(str); | 292 len = (int)FXSYS_strlen(str); |
293 } | 293 } |
294 int sent_len = 0; | 294 int sent_len = 0; |
295 while (len > 0) { | 295 while (len > 0) { |
296 int send_len = len > 1024 ? 1024 : len; | 296 int send_len = len > 1024 ? 1024 : len; |
297 *(FX_WORD*)m_pBuf = send_len; | 297 *(uint16_t*)m_pBuf = send_len; |
298 FXSYS_memcpy(m_pBuf + 2, str + sent_len, send_len); | 298 FXSYS_memcpy(m_pBuf + 2, str + sent_len, send_len); |
299 ExtEscape(m_hDC, PASSTHROUGH, send_len + 2, m_pBuf, 0, NULL); | 299 ExtEscape(m_hDC, PASSTHROUGH, send_len + 2, m_pBuf, 0, NULL); |
300 sent_len += send_len; | 300 sent_len += send_len; |
301 len -= send_len; | 301 len -= send_len; |
302 } | 302 } |
303 } | 303 } |
304 CPSPrinterDriver::CPSPrinterDriver() { | 304 CPSPrinterDriver::CPSPrinterDriver() { |
305 m_pPSOutput = NULL; | 305 m_pPSOutput = NULL; |
306 m_bCmykOutput = FALSE; | 306 m_bCmykOutput = FALSE; |
307 } | 307 } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 CFX_FontCache* pCache, | 464 CFX_FontCache* pCache, |
465 const CFX_Matrix* pObject2Device, | 465 const CFX_Matrix* pObject2Device, |
466 FX_FLOAT font_size, | 466 FX_FLOAT font_size, |
467 FX_DWORD color, | 467 FX_DWORD color, |
468 int alpha_flag, | 468 int alpha_flag, |
469 void* pIccTransform) { | 469 void* pIccTransform) { |
470 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device, | 470 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device, |
471 font_size, color, alpha_flag, pIccTransform); | 471 font_size, color, alpha_flag, pIccTransform); |
472 } | 472 } |
473 #endif | 473 #endif |
OLD | NEW |