| 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/table/truetype/glyph_table.h" |
| 23 #include "third_party/sfntly/src/sfntly/table/truetype/loca_table.h" |
| 24 #include "third_party/sfntly/src/sfntly/tag.h" |
| 22 | 25 |
| 23 namespace sfntly { | 26 namespace sfntly { |
| 24 | 27 |
| 25 // Smart pointer usage in sfntly: | 28 // Smart pointer usage in sfntly: |
| 26 // | 29 // |
| 27 // sfntly carries a smart pointer implementation like COM. Ref-countable object | 30 // sfntly carries a smart pointer implementation like COM. Ref-countable object |
| 28 // type inherits from RefCounted<>, which have AddRef and Release just like | 31 // type inherits from RefCounted<>, which have AddRef and Release just like |
| 29 // IUnknown (but no QueryInterface). Use a Ptr<> based smart pointer to hold | 32 // IUnknown (but no QueryInterface). Use a Ptr<> based smart pointer to hold |
| 30 // the object so that the object ref count is handled correctly. | 33 // the object so that the object ref count is handled correctly. |
| 31 // | 34 // |
| (...skipping 18 matching lines...) Expand all Loading... |
| 50 ~SubsetterImpl(); | 53 ~SubsetterImpl(); |
| 51 | 54 |
| 52 bool LoadFont(const char* font_name, | 55 bool LoadFont(const char* font_name, |
| 53 const unsigned char* original_font, | 56 const unsigned char* original_font, |
| 54 size_t font_size); | 57 size_t font_size); |
| 55 int SubsetFont(const unsigned int* glyph_ids, | 58 int SubsetFont(const unsigned int* glyph_ids, |
| 56 size_t glyph_count, | 59 size_t glyph_count, |
| 57 unsigned char** output_buffer); | 60 unsigned char** output_buffer); |
| 58 | 61 |
| 59 private: | 62 private: |
| 60 Font* FindFont(const char* font_name, const FontArray& font_array); | 63 CALLER_ATTACH Font* Subset(const IntegerSet& glyph_ids, |
| 61 bool HasName(const char* font_name, Font* font); | 64 GlyphTable* glyf, LocaTable* loca); |
| 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); | |
| 66 | 65 |
| 67 FontFactoryPtr factory_; | 66 FontFactoryPtr factory_; |
| 68 FontPtr font_; | 67 FontPtr font_; |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 } // namespace sfntly | 70 } // namespace sfntly |
| 72 | 71 |
| 73 #endif // THIRD_PARTY_SFNTLY_SRC_SUBSETTER_SUBSETTER_IMPL_H_ | 72 #endif // THIRD_PARTY_SFNTLY_SRC_SUBSETTER_SUBSETTER_IMPL_H_ |
| OLD | NEW |