Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Unified Diff: ppapi/thunk/ppb_truetype_font_thunk.cc

Issue 13913006: Add Pepper TrueType font API call to enumerate fonts in a given family. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename IsFont to IsTrueTypeFont. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/thunk/ppb_truetype_font_thunk.cc
diff --git a/ppapi/thunk/ppb_truetype_font_thunk.cc b/ppapi/thunk/ppb_truetype_font_thunk.cc
index 4b47afbe5a3f3e496706c944a1923b2fe77cdb67..ef3cdbd6bc2ed5b24328807b99a93052287899e9 100644
--- a/ppapi/thunk/ppb_truetype_font_thunk.cc
+++ b/ppapi/thunk/ppb_truetype_font_thunk.cc
@@ -28,6 +28,18 @@ int32_t GetFontFamilies(PP_Instance instance,
enter.functions()->GetFontFamilies(instance, output, enter.callback()));
}
+int32_t GetFontsInFamily(PP_Instance instance,
+ PP_Var family,
+ PP_ArrayOutput output,
+ PP_CompletionCallback callback) {
+ EnterInstanceAPI<PPB_TrueTypeFont_Singleton_API> enter(instance, callback);
+ if (enter.failed())
+ return PP_ERROR_FAILED;
+ return enter.SetResult(
+ enter.functions()->GetFontsInFamily(instance, family, output,
+ enter.callback()));
+}
+
PP_Resource Create(PP_Instance instance,
const PP_TrueTypeFontDesc_Dev* desc) {
EnterResourceCreation enter(instance);
@@ -36,7 +48,7 @@ PP_Resource Create(PP_Instance instance,
return enter.functions()->CreateTrueTypeFont(instance, *desc);
}
-PP_Bool IsFont(PP_Resource resource) {
+PP_Bool IsTrueTypeFont(PP_Resource resource) {
EnterResource<PPB_TrueTypeFont_API> enter(resource, false);
return PP_FromBool(enter.succeeded());
}
@@ -78,8 +90,9 @@ int32_t GetTable(PP_Resource font,
const PPB_TrueTypeFont_Dev_0_1 g_ppb_truetypefont_thunk_0_1 = {
&GetFontFamilies,
+ &GetFontsInFamily,
&Create,
- &IsFont,
+ &IsTrueTypeFont,
&Describe,
&GetTableTags,
&GetTable
« ppapi/tests/test_truetype_font.cc ('K') | « ppapi/thunk/ppb_truetype_font_singleton_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698