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

Unified Diff: third_party/npapi/bindings/npapi_extensions.h

Issue 2794004: Add a font API to Pepper and implement on Linux based on agl's ... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 6 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
« no previous file with comments | « chrome/renderer/webplugin_delegate_pepper.cc ('k') | webkit/glue/plugins/npapi_extension_thunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/npapi/bindings/npapi_extensions.h
===================================================================
--- third_party/npapi/bindings/npapi_extensions.h (revision 49461)
+++ third_party/npapi/bindings/npapi_extensions.h (working copy)
@@ -630,6 +630,83 @@
NPP instance,
NPCursorType type);
+/* unique id for each font */
+typedef int NPFontID;
+
+typedef enum {
+ NPCharsetAnsi = 0,
+ NPCharsetDefault = 1,
+ NPCharsetSymbol = 2,
+ NPCharsetMac = 77,
+ NPCharsetShiftJIS = 128,
+ NPCharsetHangul = 129,
+ NPCharsetJohab = 130,
+ NPCharsetGB2312 =134,
+ NPCharsetChineseBIG5 = 136,
+ NPCharsetGreek = 161,
+ NPCharsetTurkish = 162,
+ NPCharsetVietnamese = 163,
+ NPCharsetHebrew = 177,
+ NPCharsetArabic = 178,
+ NPCharsetBaltic = 186,
+ NPCharsetRussian = 204,
+ NPCharsetThai = 222,
+ NPCharsetEastEurope = 238,
+ NPCharsetOEM = 255
+} NPCharset;
+
+typedef enum {
+ NPPitchDefault,
+ NPPitchFixed
+} NPPitch;
+
+typedef enum {
+ NPFamilyDefault,
+ NPFamilyRoman,
+ NPFamilyScript
+} NPFamily;
+
+typedef struct _NPFontDescription {
+ const char* face;
+ int weight;
+ bool italic;
+ NPPitch pitch;
+ NPFamily family;
+ NPCharset charset;
+} NPFontDescription;
+
+// Return a font which best matches the given properties.
+typedef NPError (*NPMatchFontWithFallbackPtr) (
+ NPP instance,
+ const NPFontDescription* description,
+ NPFontID* id);
+
+// Loads a specified font table for the given font.
+// table: the table in *big-endian* format, or 0 for the whole font file.
+// output: a buffer of size output_length that gets the data. can be 0, in
+// which case output_length will be set to the required size in bytes.
+// output_length: size of output, if it's not 0.
+typedef NPError (*GetFontTablePtr) (
+ NPP instance,
+ NPFontID id,
+ uint32_t table,
+ void* output,
+ size_t* output_length);
+
+// Destroys a font.
+typedef NPError (*NPDestroyFontPtr) (
+ NPP instance,
+ NPFontID id);
+
+typedef struct _NPFontExtensions {
+ NPMatchFontWithFallbackPtr matchFontWithFallback;
+ GetFontTablePtr getFontTable;
+ NPDestroyFontPtr destroyFont;
+} NPFontExtensions;
+
+typedef NPFontExtensions* (*NPGetFontExtensionsPtr)(
+ NPP instance);
+
/* Pepper extensions */
struct NPNExtensions {
/* Device interface acquisition */
@@ -645,6 +722,8 @@
NPGetWidgetExtensionsPtr getWidgetExtensions;
/* Cursor */
NPSetCursorPtr setCursor;
+ /* Font */
+ NPGetFontExtensionsPtr getFontExtensions;
};
/* 3D -----------------------------------------------------------------------*/
« no previous file with comments | « chrome/renderer/webplugin_delegate_pepper.cc ('k') | webkit/glue/plugins/npapi_extension_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698