From f210f505ffffccc15ae5e91f8ccb9763ba7fc152 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Wed, 20 Mar 2013 14:15:52 +0000 Subject: [PATCH] add new API for gdi fonts (not hooked up yet) git-svn-id: http://skia.googlecode.com/svn/trunk@8253 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/ports/SkTypeface_win.h | 8 ++++++++ src/ports/SkFontHost_win.cpp | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/include/ports/SkTypeface_win.h b/include/ports/SkTypeface_win.h index fdf38e26c..fea5f474a 100644 --- a/include/ports/SkTypeface_win.h +++ b/include/ports/SkTypeface_win.h @@ -28,4 +28,12 @@ SK_API SkTypeface* SkCreateTypefaceFromLOGFONT(const LOGFONT&); */ SK_API void SkLOGFONTFromTypeface(const SkTypeface* typeface, LOGFONT* lf); +/** + * Set an optional callback to ensure that the data behind a LOGFONT is loaded. + * This will get called if Skia tries to access the data but hits a failure. + * Normally this is null, and is only required if the font data needs to be + * remotely (re)loaded. + */ +SK_API void SkTypeface_SetEnsureLOGFONTAccessibleProc(void (*)(const LOGFONT&)); + #endif diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp index 6c937192c..b430a04d9 100755 --- a/src/ports/SkFontHost_win.cpp +++ b/src/ports/SkFontHost_win.cpp @@ -29,6 +29,12 @@ #include #include +static void (*gEnsureLOGFONTAccessibleProc)(const LOGFONT&); + +void SkTypeface_SetEnsureLOGFONTAccessibleProc(void (*proc)(const LOGFONT&)) { + gEnsureLOGFONTAccessibleProc = proc; +} + // always packed xxRRGGBB typedef uint32_t SkGdiRGB;