| 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/fxedit/fxet_stub.h" | 7 #include "../../include/fxedit/fxet_stub.h" |
| 8 #include "../../include/fxedit/fx_edit.h" | 8 #include "../../include/fxedit/fx_edit.h" |
| 9 #include "../../include/fxedit/fxet_edit.h" | 9 #include "../../include/fxedit/fxet_edit.h" |
| 10 | 10 |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 pTxtObj->m_ColorState.SetStrokeColor(CPDF_ColorSpace::GetStockCS(PDFCS_D
EVICERGB),rgb, 3); | 462 pTxtObj->m_ColorState.SetStrokeColor(CPDF_ColorSpace::GetStockCS(PDFCS_D
EVICERGB),rgb, 3); |
| 463 | 463 |
| 464 pTxtObj->SetPosition(point.x,point.y); | 464 pTxtObj->SetPosition(point.x,point.y); |
| 465 pTxtObj->SetText(text); | 465 pTxtObj->SetText(text); |
| 466 | 466 |
| 467 pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pTxtObj); | 467 pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pTxtObj); |
| 468 | 468 |
| 469 return pTxtObj; | 469 return pTxtObj; |
| 470 } | 470 } |
| 471 | 471 |
| 472 /* | |
| 473 List of currently supported standard fonts: | |
| 474 Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique | |
| 475 Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique | |
| 476 Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic | |
| 477 Symbol, ZapfDingbats | |
| 478 */ | |
| 479 | |
| 480 const char* g_sFXEDITStandardFontName[] = {"Courier", "Courier-Bold", "Courier-B
oldOblique", "Courier-Oblique", | |
| 481 "Helvetica", "Helvetica-Bold", "Helvetica-BoldOblique", "Helvetica-Obliq
ue", | |
| 482 "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", | |
| 483 "Symbol", "ZapfDingbats"}; | |
| 484 | |
| 485 static FX_BOOL FX_EDIT_IsStandardFont(const CFX_ByteString& sFontName) | |
| 486 { | |
| 487 for (FX_INT32 i=0; i<14; i++) | |
| 488 { | |
| 489 if (sFontName == g_sFXEDITStandardFontName[i]) | |
| 490 return TRUE; | |
| 491 } | |
| 492 | |
| 493 return FALSE; | |
| 494 } | |
| 495 | |
| 496 void IFX_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEd
it, | 472 void IFX_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEd
it, |
| 497 const CPDF_Po
int& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTempla
te<CPDF_TextObject*>& ObjArray) | 473 const CPDF_Po
int& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTempla
te<CPDF_TextObject*>& ObjArray) |
| 498 { | 474 { |
| 499 FX_FLOAT fFontSize = pEdit->GetFontSize(); | 475 FX_FLOAT fFontSize = pEdit->GetFontSize(); |
| 500 | 476 |
| 501 FX_INT32 nOldFontIndex = -1; | 477 FX_INT32 nOldFontIndex = -1; |
| 502 | 478 |
| 503 CFX_ByteTextBuf sTextBuf; | 479 CFX_ByteTextBuf sTextBuf; |
| 504 CPDF_Point ptBT(0.0f,0.0f); | 480 CPDF_Point ptBT(0.0f,0.0f); |
| 505 | 481 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 rcUnderline.right += ptOffset.x; | 654 rcUnderline.right += ptOffset.x; |
| 679 rcUnderline.top += ptOffset.y; | 655 rcUnderline.top += ptOffset.y; |
| 680 rcUnderline.bottom += ptOffset.y; | 656 rcUnderline.bottom += ptOffset.y; |
| 681 AddRectToPageObjects(pPageObjects, color
, rcUnderline); | 657 AddRectToPageObjects(pPageObjects, color
, rcUnderline); |
| 682 } | 658 } |
| 683 } | 659 } |
| 684 } | 660 } |
| 685 } | 661 } |
| 686 } | 662 } |
| 687 | 663 |
| OLD | NEW |