Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkCTFont.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google Inc.
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#ifndef SkCTFont_DEFINED
9#define SkCTFont_DEFINED
10
12#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
13
14#ifdef SK_BUILD_FOR_MAC
15#import <ApplicationServices/ApplicationServices.h>
16#endif
17
18#ifdef SK_BUILD_FOR_IOS
19#include <CoreGraphics/CoreGraphics.h>
20#endif
21
22enum class SkCTFontSmoothBehavior {
23 none, // SmoothFonts produces no effect.
24 some, // SmoothFonts produces some effect, but not subpixel coverage.
25 subpixel, // SmoothFonts produces some effect and provides subpixel coverage.
26};
27
28SkCTFontSmoothBehavior SkCTFontGetSmoothBehavior();
29
30using SkCTFontWeightMapping = const CGFloat[11];
31
32/** Returns the [-1, 1] CTFontDescriptor weights for the
33 * <0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000> CSS weights.
34 *
35 * It is assumed that the values will be interpolated linearly between these points.
36 * NSFontWeightXXX were added in 10.11, appear in 10.10, but do not appear in 10.9.
37 * The actual values appear to be stable, but they may change without notice.
38 * These values are valid for system fonts only.
39 */
40SkCTFontWeightMapping& SkCTFontGetNSFontWeightMapping();
41
42/** Returns the [-1, 1] CTFontDescriptor weights for the
43 * <0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000> CSS weights.
44 *
45 * It is assumed that the values will be interpolated linearly between these points.
46 * The actual values appear to be stable, but they may change without notice.
47 * These values are valid for fonts created from data only.
48 */
49SkCTFontWeightMapping& SkCTFontGetDataFontWeightMapping();
50
51#endif // defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
52#endif // SkCTFont_DEFINED