kumarashishg | 826308d | 2023-06-23 13:21:22 +0000 | [diff] [blame] | 1 | // Copyright 2016 The PDFium Authors |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 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 | |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 9 | CFX_SubstFont::CFX_SubstFont() = default; |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 10 | |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 11 | CFX_SubstFont::~CFX_SubstFont() = default; |
kumarashishg | 826308d | 2023-06-23 13:21:22 +0000 | [diff] [blame] | 12 | |
| 13 | #if defined(_SKIA_SUPPORT_) |
| 14 | int 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 | |
| 25 | void CFX_SubstFont::UseChromeSerif() { |
| 26 | m_Weight = m_Weight * 4 / 5; |
| 27 | m_Family = "Chrome Serif"; |
| 28 | } |