Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkTypeface_win.h
Go to the documentation of this file.
1/*
2 * Copyright 2011 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 SkTypeface_win_DEFINED
9#define SkTypeface_win_DEFINED
10
14
15#ifdef SK_BUILD_FOR_WIN
16
17#ifdef UNICODE
18typedef struct tagLOGFONTW LOGFONTW;
19typedef LOGFONTW LOGFONT;
20#else
21typedef struct tagLOGFONTA LOGFONTA;
22typedef LOGFONTA LOGFONT;
23#endif // UNICODE
24
25/**
26 * Like the other Typeface create methods, this returns a new reference to the
27 * corresponding typeface for the specified logfont. The caller is responsible
28 * for calling unref() when it is finished.
29 */
30SK_API sk_sp<SkTypeface> SkCreateTypefaceFromLOGFONT(const LOGFONT&);
31
32/**
33 * Copy the LOGFONT associated with this typeface into the lf parameter. Note
34 * that the lfHeight will need to be set afterwards, since the typeface does
35 * not track this (the paint does).
36 * typeface may be NULL, in which case we return the logfont for the default font.
37 */
38SK_API void SkLOGFONTFromTypeface(const SkTypeface* typeface, LOGFONT* lf);
39
40/**
41 * Set an optional callback to ensure that the data behind a LOGFONT is loaded.
42 * This will get called if Skia tries to access the data but hits a failure.
43 * Normally this is null, and is only required if the font data needs to be
44 * remotely (re)loaded.
45 */
46SK_API void SkTypeface_SetEnsureLOGFONTAccessibleProc(void (*)(const LOGFONT&));
47
48// Experimental!
49//
50class SkFontMgr;
51struct IDWriteFactory;
52struct IDWriteFontCollection;
53struct IDWriteFontFallback;
54
55SK_API sk_sp<SkFontMgr> SkFontMgr_New_GDI();
56SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory = nullptr,
57 IDWriteFontCollection* collection = nullptr);
58SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
59 IDWriteFontCollection* collection,
60 IDWriteFontFallback* fallback);
61
62#endif // SK_BUILD_FOR_WIN
63#endif // SkTypeface_win_DEFINED
#define SK_API
Definition SkAPI.h:35
LOGFONTW LOGFONT
struct tagLOGFONTW LOGFONTW