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

Unified Diff: third_party/sfntly/src/subsetter/subsetter_impl.h

Issue 7381004: Add sfntly library for font subsetting used in print preview. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update per code review Created 9 years, 5 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: third_party/sfntly/src/subsetter/subsetter_impl.h
diff --git a/third_party/sfntly/src/subsetter/subsetter_impl.h b/third_party/sfntly/src/subsetter/subsetter_impl.h
new file mode 100755
index 0000000000000000000000000000000000000000..9f195ecc08f7f84fa29fd7bc93dbb7b281b3ed7b
--- /dev/null
+++ b/third_party/sfntly/src/subsetter/subsetter_impl.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2011 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SUBSETTER_IMPL_H_
+#define SUBSETTER_IMPL_H_
+
+#include "sfntly/font.h"
+#include "sfntly/font_factory.h"
+
+namespace sfntly {
+
+class SubsetterImpl : public RefCounted<SubsetterImpl> {
+ public:
+ SubsetterImpl();
+ ~SubsetterImpl();
+
+ bool loadFont(const char* font_name,
brettw 2011/07/19 05:09:42 Upper-case function names
arthurhsu 2011/07/19 18:34:32 Done.
+ const unsigned char* original_font,
+ const size_t font_size);
+ int subsetFont(const unsigned int* glyph_ids,
+ const size_t glyph_count,
+ unsigned char** output_buffer);
+
+ private:
+ Font* findFont(const char* font_name, FontArray& font_array);
+ bool hasName(const char* font_name, Font* font);
+ // This function follows the memory contract model in sfntly.
+ // Please refer to sfntly/port/refcount.h for more details.
+ CALLER_ATTACH Font* subset(const unsigned int* glyph_ids,
+ const size_t glyph_count);
+
+ FontFactoryPtr factory_;
+ FontPtr font_;
+};
+
+}
brettw 2011/07/19 05:09:42 This should have a comment " // namespace sfntly"
arthurhsu 2011/07/19 18:34:32 Done.
+
+#endif // SUBSETTER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698