| 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 "xfa/fxfa/app/xfa_textlayout.h" | 7 #include "xfa/fxfa/app/xfa_textlayout.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 | 369 |
| 370 bool CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const { | 370 bool CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const { |
| 371 CFX_WideString wsValue; | 371 CFX_WideString wsValue; |
| 372 if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-spacerun"), wsValue)) { | 372 if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-spacerun"), wsValue)) { |
| 373 wsValue.MakeLower(); | 373 wsValue.MakeLower(); |
| 374 return wsValue == FX_WSTRC(L"yes"); | 374 return wsValue == FX_WSTRC(L"yes"); |
| 375 } | 375 } |
| 376 return false; | 376 return false; |
| 377 } | 377 } |
| 378 CFGAS_GEFont* CXFA_TextParser::GetFont(CXFA_TextProvider* pTextProvider, | 378 |
| 379 IFDE_CSSComputedStyle* pStyle) const { | 379 CFX_RetainPtr<CFGAS_GEFont> CXFA_TextParser::GetFont( |
| 380 CXFA_TextProvider* pTextProvider, |
| 381 IFDE_CSSComputedStyle* pStyle) const { |
| 380 CFX_WideStringC wsFamily = FX_WSTRC(L"Courier"); | 382 CFX_WideStringC wsFamily = FX_WSTRC(L"Courier"); |
| 381 uint32_t dwStyle = 0; | 383 uint32_t dwStyle = 0; |
| 382 CXFA_Font font = pTextProvider->GetFontNode(); | 384 CXFA_Font font = pTextProvider->GetFontNode(); |
| 383 if (font) { | 385 if (font) { |
| 384 font.GetTypeface(wsFamily); | 386 font.GetTypeface(wsFamily); |
| 385 if (font.IsBold()) { | 387 if (font.IsBold()) { |
| 386 dwStyle |= FX_FONTSTYLE_Bold; | 388 dwStyle |= FX_FONTSTYLE_Bold; |
| 387 } | 389 } |
| 388 if (font.IsItalic()) { | 390 if (font.IsItalic()) { |
| 389 dwStyle |= FX_FONTSTYLE_Italic; | 391 dwStyle |= FX_FONTSTYLE_Italic; |
| (...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 m_tabstops.RemoveAll(); | 2098 m_tabstops.RemoveAll(); |
| 2097 m_iTabCount = 0; | 2099 m_iTabCount = 0; |
| 2098 } | 2100 } |
| 2099 | 2101 |
| 2100 void CXFA_TextTabstopsContext::Reset() { | 2102 void CXFA_TextTabstopsContext::Reset() { |
| 2101 m_iTabIndex = -1; | 2103 m_iTabIndex = -1; |
| 2102 m_bTabstops = false; | 2104 m_bTabstops = false; |
| 2103 m_fTabWidth = 0; | 2105 m_fTabWidth = 0; |
| 2104 m_fLeft = 0; | 2106 m_fLeft = 0; |
| 2105 } | 2107 } |
| OLD | NEW |