Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 return SkUniqueCFRef<CTFontRef>(
94 CTFontCreateCopyWithAttributes(ctfont, font.getSize(), nullptr, nullptr));
95}
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
const char * name
Definition fuchsia.cc:50

◆ run_to_font()

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

Definition at line 97 of file SkShaper_coretext.cpp.

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

Variable Documentation

◆ kCTTracking_AttributeName

const CFStringRef kCTTracking_AttributeName = CFSTR("CTTracking")

Definition at line 159 of file SkShaper_coretext.cpp.