1 // Copyright 2016 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "core/fxge/cfx_substfont.h" 8 9 CFX_SubstFont::CFX_SubstFont() = default; 10 11 CFX_SubstFont::~CFX_SubstFont() = default; 12 13 #if defined(_SKIA_SUPPORT_) GetOriginalWeight() const14int CFX_SubstFont::GetOriginalWeight() const { 15 int weight = m_Weight; 16 17 // Perform the inverse weight adjustment of UseChromeSerif() to get the 18 // original font weight. 19 if (m_Family == "Chrome Serif") 20 weight = weight * 5 / 4; 21 return weight; 22 } 23 #endif 24 UseChromeSerif()25void CFX_SubstFont::UseChromeSerif() { 26 m_Weight = m_Weight * 4 / 5; 27 m_Family = "Chrome Serif"; 28 } 29