1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/core/SkTextFormatParams.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,41 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2010 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 +#ifndef SkTextFormatParams_DEFINES 1.14 +#define SkTextFormatParams_DEFINES 1.15 + 1.16 +#include "SkScalar.h" 1.17 +#include "SkTypes.h" 1.18 + 1.19 +// Fraction of the text size to lower a strike through line below the baseline. 1.20 +#define kStdStrikeThru_Offset (-SK_Scalar1 * 6 / 21) 1.21 +// Fraction of the text size to lower a underline below the baseline. 1.22 +#define kStdUnderline_Offset (SK_Scalar1 / 9) 1.23 +// Fraction of the text size to use for a strike through or under-line. 1.24 +#define kStdUnderline_Thickness (SK_Scalar1 / 18) 1.25 + 1.26 +// The fraction of text size to embolden fake bold text scales with text size. 1.27 +// At 9 points or below, the stroke width is increased by text size / 24. 1.28 +// At 36 points and above, it is increased by text size / 32. In between, 1.29 +// it is interpolated between those values. 1.30 +static const SkScalar kStdFakeBoldInterpKeys[] = { 1.31 + SK_Scalar1*9, 1.32 + SK_Scalar1*36, 1.33 +}; 1.34 +static const SkScalar kStdFakeBoldInterpValues[] = { 1.35 + SK_Scalar1/24, 1.36 + SK_Scalar1/32 1.37 +}; 1.38 +SK_COMPILE_ASSERT(SK_ARRAY_COUNT(kStdFakeBoldInterpKeys) == 1.39 + SK_ARRAY_COUNT(kStdFakeBoldInterpValues), 1.40 + mismatched_array_size); 1.41 +static const int kStdFakeBoldInterpLength = 1.42 + SK_ARRAY_COUNT(kStdFakeBoldInterpKeys); 1.43 + 1.44 +#endif //SkTextFormatParams_DEFINES