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 "../../../include/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
8 #include "../../../include/fxcodec/fx_codec.h" | 8 #include "../../../include/fxcodec/fx_codec.h" |
9 #include "text_int.h" | 9 #include "text_int.h" |
10 struct PSGlyph { | 10 struct PSGlyph { |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[1] - ch
arpos.m_AdjustMatrix[1]) < 0.01 && | 519 FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[1] - ch
arpos.m_AdjustMatrix[1]) < 0.01 && |
520 FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[2] - ch
arpos.m_AdjustMatrix[2]) < 0.01 && | 520 FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[2] - ch
arpos.m_AdjustMatrix[2]) < 0.01 && |
521 FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[3] - ch
arpos.m_AdjustMatrix[3]) < 0.01))) { | 521 FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[3] - ch
arpos.m_AdjustMatrix[3]) < 0.01))) { |
522 ps_fontnum = i; | 522 ps_fontnum = i; |
523 ps_glyphindex = j; | 523 ps_glyphindex = j; |
524 return; | 524 return; |
525 } | 525 } |
526 } | 526 } |
527 } | 527 } |
528 if (m_PSFontList.GetSize() == 0 || m_PSFontList[m_PSFontList.GetSize() - 1]-
>m_nGlyphs == 256) { | 528 if (m_PSFontList.GetSize() == 0 || m_PSFontList[m_PSFontList.GetSize() - 1]-
>m_nGlyphs == 256) { |
529 CPSFont* pPSFont = FX_NEW CPSFont; | 529 CPSFont* pPSFont = new CPSFont; |
530 if (!pPSFont) { | |
531 return; | |
532 } | |
533 pPSFont->m_nGlyphs = 0; | 530 pPSFont->m_nGlyphs = 0; |
534 m_PSFontList.Add(pPSFont); | 531 m_PSFontList.Add(pPSFont); |
535 CFX_ByteTextBuf buf; | 532 CFX_ByteTextBuf buf; |
536 buf << FX_BSTRC("8 dict begin/FontType 3 def/FontMatrix[1 0 0 1 0 0]def\
n" | 533 buf << FX_BSTRC("8 dict begin/FontType 3 def/FontMatrix[1 0 0 1 0 0]def\
n" |
537 "/FontBBox[0 0 0 0]def/Encoding 256 array def 0 1 255{En
coding exch/.notdef put}for\n" | 534 "/FontBBox[0 0 0 0]def/Encoding 256 array def 0 1 255{En
coding exch/.notdef put}for\n" |
538 "/CharProcs 1 dict def CharProcs begin/.notdef {} def en
d\n" | 535 "/CharProcs 1 dict def CharProcs begin/.notdef {} def en
d\n" |
539 "/BuildGlyph{1 0 -10 -10 10 10 setcachedevice exch/CharP
rocs get exch 2 copy known not{pop/.notdef}if get exec}bind def\n" | 536 "/BuildGlyph{1 0 -10 -10 10 10 setcachedevice exch/CharP
rocs get exch 2 copy known not{pop/.notdef}if get exec}bind def\n" |
540 "/BuildChar{1 index/Encoding get exch get 1 index/BuildG
lyph get exec}bind def\n" | 537 "/BuildChar{1 index/Encoding get exch get 1 index/BuildG
lyph get exec}bind def\n" |
541 "currentdict end\n"); | 538 "currentdict end\n"); |
542 buf << FX_BSTRC("/X") << m_PSFontList.GetSize() - 1 << FX_BSTRC(" exch d
efinefont pop\n"); | 539 buf << FX_BSTRC("/X") << m_PSFontList.GetSize() - 1 << FX_BSTRC(" exch d
efinefont pop\n"); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 FX_LPBYTE dest_buf; | 645 FX_LPBYTE dest_buf; |
649 FX_DWORD dest_size; | 646 FX_DWORD dest_size; |
650 CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); | 647 CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); |
651 if (pEncoders && pEncoders->GetBasicModule()->A85Encode(data, len, dest_buf,
dest_size)) { | 648 if (pEncoders && pEncoders->GetBasicModule()->A85Encode(data, len, dest_buf,
dest_size)) { |
652 m_pOutput->OutputPS((FX_LPCSTR)dest_buf, dest_size); | 649 m_pOutput->OutputPS((FX_LPCSTR)dest_buf, dest_size); |
653 FX_Free(dest_buf); | 650 FX_Free(dest_buf); |
654 } else { | 651 } else { |
655 m_pOutput->OutputPS((FX_LPCSTR)data, len); | 652 m_pOutput->OutputPS((FX_LPCSTR)data, len); |
656 } | 653 } |
657 } | 654 } |
OLD | NEW |