blob: ef22c848bf480d488e51d9154ae7b8729c83a439 [file] [log] [blame]
vandebo@chromium.org28be72b2010-11-11 21:37:00 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2010 The Android Open Source Project
vandebo@chromium.org28be72b2010-11-11 21:37:00 +00003 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00004 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
vandebo@chromium.org28be72b2010-11-11 21:37:00 +00006 */
7
epoger@google.comec3ed6a2011-07-28 14:26:00 +00008
vandebo@chromium.org28be72b2010-11-11 21:37:00 +00009#ifndef SkTextFormatParams_DEFINES
10#define SkTextFormatParams_DEFINES
11
12#include "SkScalar.h"
13#include "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.
26static const SkScalar kStdFakeBoldInterpKeys[] = {
digit@google.comc2c80c42012-02-16 22:06:51 +000027 SK_Scalar1*9,
28 SK_Scalar1*36,
vandebo@chromium.org28be72b2010-11-11 21:37:00 +000029};
30static const SkScalar kStdFakeBoldInterpValues[] = {
31 SK_Scalar1/24,
bungeman99fe8222015-08-20 07:57:51 -070032 SK_Scalar1/32,
vandebo@chromium.org28be72b2010-11-11 21:37:00 +000033};
bungeman99fe8222015-08-20 07:57:51 -070034static_assert(SK_ARRAY_COUNT(kStdFakeBoldInterpKeys) == SK_ARRAY_COUNT(kStdFakeBoldInterpValues),
35 "mismatched_array_size");
36static const int kStdFakeBoldInterpLength = SK_ARRAY_COUNT(kStdFakeBoldInterpKeys);
vandebo@chromium.org28be72b2010-11-11 21:37:00 +000037
38#endif //SkTextFormatParams_DEFINES