Flutter Engine
The Flutter Engine
Classes | Namespaces | Functions | Variables
SkShaper_coretext.cpp File Reference
#include "modules/skshaper/include/SkShaper.h"
#include "include/ports/SkTypeface_mac.h"
#include "include/private/base/SkTemplates.h"
#include "src/base/SkUTF.h"
#include "src/core/SkFontPriv.h"
#include "src/utils/mac/SkCGBase.h"
#include "src/utils/mac/SkUniqueCFRef.h"
#include <vector>
#include <utility>

Go to the source code of this file.

Classes

class  SkShaper_CoreText
 
class  LineBreakIter
 

Namespaces

namespace  SkShapers
 
namespace  SkShapers::CT
 

Functions

static void dict_add_double (CFMutableDictionaryRef d, const void *name, double value)
 
static SkUniqueCFRef< CTFontRef > create_ctfont_from_font (const SkFont &font)
 
static SkFont run_to_font (CTRunRef run, const SkFont &orig)
 
SKSHAPER_API std::unique_ptr< SkShaperSkShapers::CT::CoreText ()
 

Variables

const CFStringRef kCTTracking_AttributeName = CFSTR("CTTracking")
 

Function Documentation

◆ create_ctfont_from_font()

static SkUniqueCFRef< CTFontRef > create_ctfont_from_font ( const SkFont font)
static

Definition at line 90 of file SkShaper_coretext.cpp.

90 {
91 auto typeface = font.getTypeface();
92 auto ctfont = SkTypeface_GetCTFontRef(typeface);
93 if (!ctfont) {
94 return nullptr;
95 }
96 return SkUniqueCFRef<CTFontRef>(
97 CTFontCreateCopyWithAttributes(ctfont, font.getSize(), nullptr, nullptr));
98}
font
Font Metadata and Metrics.

◆ dict_add_double()

static void dict_add_double ( CFMutableDictionaryRef  d,
const void *  name,
double  value 
)
static

Definition at line 84 of file SkShaper_coretext.cpp.

84 {
85 SkUniqueCFRef<CFNumberRef> number(
86 CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &value));
87 CFDictionaryAddValue(d, name, number.get());
88}
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
uint8_t value
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ run_to_font()

static SkFont run_to_font ( CTRunRef  run,
const SkFont orig 
)
static

Definition at line 100 of file SkShaper_coretext.cpp.

100 {
101 CFDictionaryRef attr = CTRunGetAttributes(run);
102 CTFontRef ct = (CTFontRef)CFDictionaryGetValue(attr, kCTFontAttributeName);
103 if (!ct) {
104 SkDebugf("no ctfont in Run Attributes\n");
105 CFShow(attr);
106 return orig;
107 }
108 // Do I need to add a local cache, or allow the caller to manage this lookup?
109 SkFont font(orig);
110 font.setTypeface(SkMakeTypefaceFromCTFont(ct));
111 return font;
112}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
Definition: SkFont.h:35
Definition: run.py:1

Variable Documentation

◆ kCTTracking_AttributeName

const CFStringRef kCTTracking_AttributeName = CFSTR("CTTracking")

Definition at line 162 of file SkShaper_coretext.cpp.