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" |
11 #include "fpdfsdk/include/fxedit/fx_edit.h" | 11 #include "fpdfsdk/fxedit/include/fx_edit.h" |
12 #include "fpdfsdk/include/fxedit/fxet_edit.h" | 12 #include "fpdfsdk/fxedit/include/fxet_edit.h" |
13 | 13 |
14 CFX_ByteString GetPDFWordString(IPVT_FontMap* pFontMap, | 14 CFX_ByteString GetPDFWordString(IPVT_FontMap* pFontMap, |
15 int32_t nFontIndex, | 15 int32_t nFontIndex, |
16 uint16_t Word, | 16 uint16_t Word, |
17 uint16_t SubWord) { | 17 uint16_t SubWord) { |
18 CFX_ByteString sWord; | 18 CFX_ByteString sWord; |
19 if (CPDF_Font* pPDFFont = pFontMap->GetPDFFont(nFontIndex)) { | 19 if (CPDF_Font* pPDFFont = pFontMap->GetPDFFont(nFontIndex)) { |
20 if (SubWord > 0) { | 20 if (SubWord > 0) { |
21 Word = SubWord; | 21 Word = SubWord; |
22 } else { | 22 } else { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 sRet << word.ptWord.x + ptOffset.x << " " | 197 sRet << word.ptWord.x + ptOffset.x << " " |
198 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " " | 198 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " " |
199 << line.fLineAscent - line.fLineDescent << " re\nf\n"; | 199 << line.fLineAscent - line.fLineDescent << " re\nf\n"; |
200 } | 200 } |
201 } | 201 } |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 return sRet.GetByteString(); | 205 return sRet.GetByteString(); |
206 } | 206 } |
OLD | NEW |