| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 } | 325 } |
| 326 | 326 |
| 327 FX_BOOL CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const { | 327 FX_BOOL CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const { |
| 328 CFX_WideString wsValue; | 328 CFX_WideString wsValue; |
| 329 if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-spacerun"), wsValue)) { | 329 if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-spacerun"), wsValue)) { |
| 330 wsValue.MakeLower(); | 330 wsValue.MakeLower(); |
| 331 return wsValue == FX_WSTRC(L"yes"); | 331 return wsValue == FX_WSTRC(L"yes"); |
| 332 } | 332 } |
| 333 return FALSE; | 333 return FALSE; |
| 334 } | 334 } |
| 335 IFGAS_Font* CXFA_TextParser::GetFont(CXFA_TextProvider* pTextProvider, | 335 CFGAS_GEFont* CXFA_TextParser::GetFont(CXFA_TextProvider* pTextProvider, |
| 336 IFDE_CSSComputedStyle* pStyle) const { | 336 IFDE_CSSComputedStyle* pStyle) const { |
| 337 CFX_WideStringC wsFamily = FX_WSTRC(L"Courier"); | 337 CFX_WideStringC wsFamily = FX_WSTRC(L"Courier"); |
| 338 uint32_t dwStyle = 0; | 338 uint32_t dwStyle = 0; |
| 339 CXFA_Font font = pTextProvider->GetFontNode(); | 339 CXFA_Font font = pTextProvider->GetFontNode(); |
| 340 if (font) { | 340 if (font) { |
| 341 font.GetTypeface(wsFamily); | 341 font.GetTypeface(wsFamily); |
| 342 if (font.IsBold()) { | 342 if (font.IsBold()) { |
| 343 dwStyle |= FX_FONTSTYLE_Bold; | 343 dwStyle |= FX_FONTSTYLE_Bold; |
| 344 } | 344 } |
| 345 if (font.IsItalic()) { | 345 if (font.IsItalic()) { |
| 346 dwStyle |= FX_FONTSTYLE_Italic; | 346 dwStyle |= FX_FONTSTYLE_Italic; |
| (...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1938 tr.iLength = iLength; | 1938 tr.iLength = iLength; |
| 1939 tr.fFontSize = pPiece->fFontSize; | 1939 tr.fFontSize = pPiece->fFontSize; |
| 1940 tr.iBidiLevel = pPiece->iBidiLevel; | 1940 tr.iBidiLevel = pPiece->iBidiLevel; |
| 1941 tr.iCharRotation = 0; | 1941 tr.iCharRotation = 0; |
| 1942 tr.wLineBreakChar = L'\n'; | 1942 tr.wLineBreakChar = L'\n'; |
| 1943 tr.iVerticalScale = pPiece->iVerScale; | 1943 tr.iVerticalScale = pPiece->iVerScale; |
| 1944 tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab; | 1944 tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab; |
| 1945 tr.iHorizontalScale = pPiece->iHorScale; | 1945 tr.iHorizontalScale = pPiece->iHorScale; |
| 1946 return TRUE; | 1946 return TRUE; |
| 1947 } | 1947 } |
| OLD | NEW |