blob: 9fb243f44c68dc4ff44a34805d01376a2b96da7a [file] [log] [blame]
kumarashishg826308d2023-06-23 13:21:22 +00001// Copyright 2016 The PDFium Authors
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -07002// 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 Huang49cc9302020-04-27 16:14:24 -07009CFX_SubstFont::CFX_SubstFont() = default;
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070010
Haibo Huang49cc9302020-04-27 16:14:24 -070011CFX_SubstFont::~CFX_SubstFont() = default;
kumarashishg826308d2023-06-23 13:21:22 +000012
13#if defined(_SKIA_SUPPORT_)
14int 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
25void CFX_SubstFont::UseChromeSerif() {
26 m_Weight = m_Weight * 4 / 5;
27 m_Family = "Chrome Serif";
28}