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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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( |
60 IFX_Edit* pEdit, | 60 IFX_Edit* pEdit, |
61 const CFX_FloatPoint& ptOffset, | 61 const CFX_FloatPoint& ptOffset, |
62 const CPVT_WordRange* pRange /* = NULL*/, | 62 const CPVT_WordRange* pRange /* = nullptr*/, |
Tom Sepez
2016/06/02 20:26:26
kill comments.
Lei Zhang
2016/06/07 08:03:13
Done.
| |
63 FX_BOOL bContinuous /* = TRUE*/, | 63 FX_BOOL bContinuous /* = TRUE*/, |
64 uint16_t SubWord /* = 0*/) { | 64 uint16_t SubWord /* = 0*/) { |
65 CFX_ByteTextBuf sEditStream, sWords; | 65 CFX_ByteTextBuf sEditStream, sWords; |
66 | 66 |
67 CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); | 67 CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); |
68 int32_t nCurFontIndex = -1; | 68 int32_t nCurFontIndex = -1; |
69 | 69 |
70 IFX_Edit_Iterator* pIterator = pEdit->GetIterator(); | 70 IFX_Edit_Iterator* pIterator = pEdit->GetIterator(); |
71 if (pRange) | 71 if (pRange) |
72 pIterator->SetAt(pRange->BeginPos); | 72 pIterator->SetAt(pRange->BeginPos); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
192 if (pIterator->GetWord(word) && pIterator->GetLine(line)) { | 192 if (pIterator->GetWord(word) && pIterator->GetLine(line)) { |
193 sRet << word.ptWord.x + ptOffset.x << " " | 193 sRet << word.ptWord.x + ptOffset.x << " " |
194 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " " | 194 << line.ptLine.y + line.fLineDescent << " " << word.fWidth << " " |
195 << line.fLineAscent - line.fLineDescent << " re\nf\n"; | 195 << line.fLineAscent - line.fLineDescent << " re\nf\n"; |
196 } | 196 } |
197 } | 197 } |
198 } | 198 } |
199 | 199 |
200 return sRet.MakeString(); | 200 return sRet.MakeString(); |
201 } | 201 } |
OLD | NEW |