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