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/fpdfapi/fpdf_font/include/cpdf_font.h" | 7 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
8 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" | 8 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" |
9 #include "core/fpdfdoc/include/cpvt_word.h" | 9 #include "core/fpdfdoc/include/cpvt_word.h" |
10 #include "core/fpdfdoc/include/ipvt_fontmap.h" | 10 #include "core/fpdfdoc/include/ipvt_fontmap.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 FX_FLOAT fFontSize) { | 49 FX_FLOAT fFontSize) { |
50 CFX_ByteTextBuf sRet; | 50 CFX_ByteTextBuf sRet; |
51 if (pFontMap) { | 51 if (pFontMap) { |
52 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); | 52 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); |
53 if (sFontAlias.GetLength() > 0 && fFontSize > 0) | 53 if (sFontAlias.GetLength() > 0 && fFontSize > 0) |
54 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; | 54 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; |
55 } | 55 } |
56 return sRet.MakeString(); | 56 return sRet.MakeString(); |
57 } | 57 } |
58 | 58 |
59 CFX_ByteString IFX_Edit::GetEditAppearanceStream( | 59 CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, |
60 IFX_Edit* pEdit, | 60 const CFX_FloatPoint& ptOffset, |
61 const CFX_FloatPoint& ptOffset, | 61 const CPVT_WordRange* pRange, |
62 const CPVT_WordRange* pRange /* = NULL*/, | 62 FX_BOOL bContinuous, |
63 FX_BOOL bContinuous /* = TRUE*/, | 63 uint16_t SubWord) { |
64 uint16_t SubWord /* = 0*/) { | |
65 CFX_ByteTextBuf sEditStream, sWords; | 64 CFX_ByteTextBuf sEditStream, sWords; |
66 | 65 |
67 CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); | 66 CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); |
68 int32_t nCurFontIndex = -1; | 67 int32_t nCurFontIndex = -1; |
69 | 68 |
70 IFX_Edit_Iterator* pIterator = pEdit->GetIterator(); | 69 IFX_Edit_Iterator* pIterator = pEdit->GetIterator(); |
71 if (pRange) | 70 if (pRange) |
72 pIterator->SetAt(pRange->BeginPos); | 71 pIterator->SetAt(pRange->BeginPos); |
73 else | 72 else |
74 pIterator->SetAt(0); | 73 pIterator->SetAt(0); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 if (pIterator->GetWord(word) && pIterator->GetLine(line)) { | 191 if (pIterator->GetWord(word) && pIterator->GetLine(line)) { |
193 sRet << word.ptWord.x + ptOffset.x << " " | 192 sRet << word.ptWord.x + ptOffset.x << " " |
194 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " " | 193 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " " |
195 << line.fLineAscent - line.fLineDescent << " re\nf\n"; | 194 << line.fLineAscent - line.fLineDescent << " re\nf\n"; |
196 } | 195 } |
197 } | 196 } |
198 } | 197 } |
199 | 198 |
200 return sRet.MakeString(); | 199 return sRet.MakeString(); |
201 } | 200 } |
OLD | NEW |