2 * Copyright 2011 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkTypeface_win_DEFINED
9 #define SkTypeface_win_DEFINED
11 #include "SkTypeface.h"
14 * Like the other Typeface create methods, this returns a new reference to the
15 * corresponding typeface for the specified logfont. The caller is responsible
16 * for calling unref() when it is finished.
18 SK_API SkTypeface* SkCreateTypefaceFromLOGFONT(const LOGFONT&);
21 * Copy the LOGFONT associated with this typeface into the lf parameter. Note
22 * that the lfHeight will need to be set afterwards, since the typeface does
23 * not track this (the paint does).
24 * typeface may be NULL, in which case we return the logfont for the default font.
26 SK_API void SkLOGFONTFromTypeface(const SkTypeface* typeface, LOGFONT* lf);
29 * Set an optional callback to ensure that the data behind a LOGFONT is loaded.
30 * This will get called if Skia tries to access the data but hits a failure.
31 * Normally this is null, and is only required if the font data needs to be
32 * remotely (re)loaded.
34 SK_API void SkTypeface_SetEnsureLOGFONTAccessibleProc(void (*)(const LOGFONT&));
39 class SkRemotableFontMgr;
40 struct IDWriteFactory;
42 SK_API SkFontMgr* SkFontMgr_New_GDI();
43 SK_API SkFontMgr* SkFontMgr_New_DirectWrite(IDWriteFactory* factory = NULL);
46 * Creates an SkFontMgr which renders using DirectWrite and obtains its data
47 * from the SkRemotableFontMgr.
49 * If DirectWrite could not be initialized, will return NULL.
51 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr*);
54 * Creates an SkRemotableFontMgr backed by DirectWrite using the default
55 * system font collection in the current locale.
57 * If DirectWrite could not be initialized, will return NULL.
59 SK_API SkRemotableFontMgr* SkRemotableFontMgr_New_DirectWrite();