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

Unified Diff: content/renderer/pepper/pepper_truetype_font.h

Issue 12600019: Add Pepper TrueType font API plumbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux_aura. Pango headers missing. Created 7 years, 9 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: content/renderer/pepper/pepper_truetype_font.h
diff --git a/content/renderer/pepper/pepper_truetype_font.h b/content/renderer/pepper/pepper_truetype_font.h
new file mode 100644
index 0000000000000000000000000000000000000000..8eb6bd7adbc4b3ff6e40f73d7a3c97951acb9563
--- /dev/null
+++ b/content/renderer/pepper/pepper_truetype_font.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_PEPPER_PEPPER_TRUETYPE_FONT_H_
+#define CONTENT_RENDERER_PEPPER_PEPPER_TRUETYPE_FONT_H_
+
+#include <string>
+#include <vector>
+
+#include "ppapi/proxy/serialized_structs.h"
+
+namespace content {
+
+class PepperTrueTypeFont {
+ public:
+ // Creates a font matching the given descriptor. The exact font that is
+ // returned will depend on the host platform's font matching and fallback
+ // algorithm.
+ static PepperTrueTypeFont* Create(
+ const ppapi::proxy::SerializedTrueTypeFontDesc& desc);
+ virtual ~PepperTrueTypeFont() {}
+
+ // Returns true if the font was successfully created, false otherwise.
+ virtual bool IsValid() = 0;
+
+ // Returns a description of the actual font. Use this to see the actual
+ // characteristics of the font after running the host platform's font matching
+ // and fallback algorithm. Returns PP_OK on success, a Pepper error code on
+ // failure. 'desc' is written only on success.
+ virtual int32_t Describe(ppapi::proxy::SerializedTrueTypeFontDesc* desc) = 0;
+
+ // Retrieves an array of TrueType table tags contained in this font. Returns
+ // the number of tags on success, a Pepper error code on failure. 'tags' are
+ // written only on success.
+ virtual int32_t GetTableTags(std::vector<uint32_t>* tags) = 0;
+
+ // Gets a TrueType font table corresponding to the given tag. The 'offset' and
+ // 'max_data_length' parameters determine what part of the table is returned.
+ // Returns the data size in bytes on success, a Pepper error code on failure.
+ // 'data' is written only on success.
+ virtual int32_t GetTable(uint32_t table_tag,
+ int32_t offset,
+ int32_t max_data_length,
+ std::string* data) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_TRUETYPE_FONT_H_

Powered by Google App Engine
This is Rietveld 408576698