blob: c2767f94cb27f59b648e777f653c7ed8e13dfac9 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
vandebo@chromium.org28be72b2010-11-11 21:37:00 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2010 The Android Open Source Project
vandebo@chromium.org28be72b2010-11-11 21:37:00 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
vandebo@chromium.org28be72b2010-11-11 21:37:00 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
vandebo@chromium.org28be72b2010-11-11 21:37:00 +000010#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.
27static const SkScalar kStdFakeBoldInterpKeys[] = {
28 SkIntToScalar(9),
29 SkIntToScalar(36)
30};
31static const SkScalar kStdFakeBoldInterpValues[] = {
32 SK_Scalar1/24,
33 SK_Scalar1/32
34};
35SK_COMPILE_ASSERT(SK_ARRAY_COUNT(kStdFakeBoldInterpKeys) ==
36 SK_ARRAY_COUNT(kStdFakeBoldInterpValues),
37 mismatched_array_size);
38static const int kStdFakeBoldInterpLength =
39 SK_ARRAY_COUNT(kStdFakeBoldInterpKeys);
40
41#endif //SkTextFormatParams_DEFINES