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

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: 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..b77ea568e5c23cfc8ab249c466baf06d272a16ae
--- /dev/null
+++ b/third_party/sfntly/src/subsetter/subsetter_impl.h
@@ -0,0 +1,49 @@
+/*
+ * 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,
+ 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);
+ CALLER_ATTACH Font* subset(const unsigned int* glyph_ids,
Sheridan Rawlins 2011/07/14 22:35:51 Can this be forward declared instead of included?
arthurhsu 2011/07/14 23:52:35 It accesses data member and has to be a member fun
+ const size_t glyph_count);
+
+ FontFactoryPtr factory_;
+ FontPtr font_;
+};
+
+}
+
+#endif // SUBSETTER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698