summaryrefslogtreecommitdiff
path: root/chromium/ui/views/style/typography.cc
blob: e269daff59af9f46a273d46315ce198fa7ad01cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views/style/typography.h"

#include "base/check_op.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/style/typography_provider.h"

namespace views {
namespace style {
namespace {

void ValidateContextAndStyle(int context, int style) {
  DCHECK_GE(context, VIEWS_TEXT_CONTEXT_START);
  DCHECK_LT(context, TEXT_CONTEXT_MAX);
  DCHECK_GE(style, VIEWS_TEXT_STYLE_START);
}

}  // namespace

const gfx::FontList& GetFont(int context, int style) {
  ValidateContextAndStyle(context, style);
  return LayoutProvider::Get()->GetTypographyProvider().GetFont(context, style);
}

SkColor GetColor(const views::View& view, int context, int style) {
  ValidateContextAndStyle(context, style);
  return LayoutProvider::Get()->GetTypographyProvider().GetColor(view, context,
                                                                 style);
}

int GetLineHeight(int context, int style) {
  ValidateContextAndStyle(context, style);
  return LayoutProvider::Get()->GetTypographyProvider().GetLineHeight(context,
                                                                      style);
}

}  // namespace style
}  // namespace views