1cb93a386Sopenharmony_ci/*
2cb93a386Sopenharmony_ci * Copyright 2010 The Android Open Source Project
3cb93a386Sopenharmony_ci *
4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be
5cb93a386Sopenharmony_ci * found in the LICENSE file.
6cb93a386Sopenharmony_ci */
7cb93a386Sopenharmony_ci
8cb93a386Sopenharmony_ci
9cb93a386Sopenharmony_ci#ifndef SkTextFormatParams_DEFINES
10cb93a386Sopenharmony_ci#define SkTextFormatParams_DEFINES
11cb93a386Sopenharmony_ci
12cb93a386Sopenharmony_ci#include "include/core/SkScalar.h"
13cb93a386Sopenharmony_ci#include "include/core/SkTypes.h"
14cb93a386Sopenharmony_ci
15cb93a386Sopenharmony_ci// Fraction of the text size to lower a strike through line below the baseline.
16cb93a386Sopenharmony_ci#define kStdStrikeThru_Offset       (-SK_Scalar1 * 6 / 21)
17cb93a386Sopenharmony_ci// Fraction of the text size to lower a underline below the baseline.
18cb93a386Sopenharmony_ci#define kStdUnderline_Offset        (SK_Scalar1 / 9)
19cb93a386Sopenharmony_ci// Fraction of the text size to use for a strike through or under-line.
20cb93a386Sopenharmony_ci#define kStdUnderline_Thickness     (SK_Scalar1 / 18)
21cb93a386Sopenharmony_ci
22cb93a386Sopenharmony_ci// The fraction of text size to embolden fake bold text scales with text size.
23cb93a386Sopenharmony_ci// At 9 points or below, the stroke width is increased by text size / 24.
24cb93a386Sopenharmony_ci// At 36 points and above, it is increased by text size / 32.  In between,
25cb93a386Sopenharmony_ci// it is interpolated between those values.
26cb93a386Sopenharmony_cistatic const SkScalar kStdFakeBoldInterpKeys[] = {
27cb93a386Sopenharmony_ci    SK_Scalar1*9,
28cb93a386Sopenharmony_ci    SK_Scalar1*36,
29cb93a386Sopenharmony_ci};
30cb93a386Sopenharmony_cistatic const SkScalar kStdFakeBoldInterpValues[] = {
31cb93a386Sopenharmony_ci    SK_Scalar1/24,
32cb93a386Sopenharmony_ci    SK_Scalar1/32,
33cb93a386Sopenharmony_ci};
34cb93a386Sopenharmony_cistatic_assert(SK_ARRAY_COUNT(kStdFakeBoldInterpKeys) == SK_ARRAY_COUNT(kStdFakeBoldInterpValues),
35cb93a386Sopenharmony_ci              "mismatched_array_size");
36cb93a386Sopenharmony_cistatic const int kStdFakeBoldInterpLength = SK_ARRAY_COUNT(kStdFakeBoldInterpKeys);
37cb93a386Sopenharmony_ci
38cb93a386Sopenharmony_ci#endif  //SkTextFormatParams_DEFINES
39