OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. All Rights Reserved. | 2 * Copyright 2011 Google Inc. All Rights Reserved. |
3 * | 3 * |
4 * Licensed under the Apache License, Version 2.0 (the "License"); | 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
5 * you may not use this file except in compliance with the License. | 5 * you may not use this file except in compliance with the License. |
6 * You may obtain a copy of the License at | 6 * You may obtain a copy of the License at |
7 * | 7 * |
8 * http://www.apache.org/licenses/LICENSE-2.0 | 8 * http://www.apache.org/licenses/LICENSE-2.0 |
9 * | 9 * |
10 * Unless required by applicable law or agreed to in writing, software | 10 * Unless required by applicable law or agreed to in writing, software |
11 * distributed under the License is distributed on an "AS IS" BASIS, | 11 * distributed under the License is distributed on an "AS IS" BASIS, |
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 * See the License for the specific language governing permissions and | 13 * See the License for the specific language governing permissions and |
14 * limitations under the License. | 14 * limitations under the License. |
15 */ | 15 */ |
16 | 16 |
17 #ifndef THIRD_PARTY_SFNTLY_SRC_SUBSETTER_SUBSETTER_IMPL_H_ | 17 #ifndef THIRD_PARTY_SFNTLY_SRC_SUBSETTER_SUBSETTER_IMPL_H_ |
18 #define THIRD_PARTY_SFNTLY_SRC_SUBSETTER_SUBSETTER_IMPL_H_ | 18 #define THIRD_PARTY_SFNTLY_SRC_SUBSETTER_SUBSETTER_IMPL_H_ |
19 | 19 |
20 #include "third_party/sfntly/src/sfntly/font.h" | 20 #include "third_party/sfntly/src/sfntly/font.h" |
21 #include "third_party/sfntly/src/sfntly/font_factory.h" | 21 #include "third_party/sfntly/src/sfntly/font_factory.h" |
| 22 #include "third_party/sfntly/src/sfntly/tag.h" |
22 | 23 |
23 namespace sfntly { | 24 namespace sfntly { |
24 | 25 |
25 // Smart pointer usage in sfntly: | 26 // Smart pointer usage in sfntly: |
26 // | 27 // |
27 // sfntly carries a smart pointer implementation like COM. Ref-countable object | 28 // sfntly carries a smart pointer implementation like COM. Ref-countable object |
28 // type inherits from RefCounted<>, which have AddRef and Release just like | 29 // type inherits from RefCounted<>, which have AddRef and Release just like |
29 // IUnknown (but no QueryInterface). Use a Ptr<> based smart pointer to hold | 30 // IUnknown (but no QueryInterface). Use a Ptr<> based smart pointer to hold |
30 // the object so that the object ref count is handled correctly. | 31 // the object so that the object ref count is handled correctly. |
31 // | 32 // |
(...skipping 18 matching lines...) Expand all Loading... |
50 ~SubsetterImpl(); | 51 ~SubsetterImpl(); |
51 | 52 |
52 bool LoadFont(const char* font_name, | 53 bool LoadFont(const char* font_name, |
53 const unsigned char* original_font, | 54 const unsigned char* original_font, |
54 size_t font_size); | 55 size_t font_size); |
55 int SubsetFont(const unsigned int* glyph_ids, | 56 int SubsetFont(const unsigned int* glyph_ids, |
56 size_t glyph_count, | 57 size_t glyph_count, |
57 unsigned char** output_buffer); | 58 unsigned char** output_buffer); |
58 | 59 |
59 private: | 60 private: |
60 Font* FindFont(const char* font_name, const FontArray& font_array); | |
61 bool HasName(const char* font_name, Font* font); | |
62 bool ResolveCompositeGlyphs(const unsigned int* glyph_ids, | |
63 size_t glyph_count, | |
64 IntegerSet* glyph_id_processed); | |
65 CALLER_ATTACH Font* Subset(const IntegerSet& glyph_ids); | 61 CALLER_ATTACH Font* Subset(const IntegerSet& glyph_ids); |
66 | 62 |
67 FontFactoryPtr factory_; | 63 FontFactoryPtr factory_; |
68 FontPtr font_; | 64 FontPtr font_; |
69 }; | 65 }; |
70 | 66 |
71 } // namespace sfntly | 67 } // namespace sfntly |
72 | 68 |
73 #endif // THIRD_PARTY_SFNTLY_SRC_SUBSETTER_SUBSETTER_IMPL_H_ | 69 #endif // THIRD_PARTY_SFNTLY_SRC_SUBSETTER_SUBSETTER_IMPL_H_ |
OLD | NEW |