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