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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright 2011 Google Inc. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef SUBSETTER_IMPL_H_
18 #define SUBSETTER_IMPL_H_
19
20 #include "sfntly/font.h"
21 #include "sfntly/font_factory.h"
22
23 namespace sfntly {
24
25 class SubsetterImpl : public RefCounted<SubsetterImpl> {
26 public:
27 SubsetterImpl();
28 ~SubsetterImpl();
29
30 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.
31 const unsigned char* original_font,
32 const size_t font_size);
33 int subsetFont(const unsigned int* glyph_ids,
34 const size_t glyph_count,
35 unsigned char** output_buffer);
36
37 private:
38 Font* findFont(const char* font_name, FontArray& font_array);
39 bool hasName(const char* font_name, Font* font);
40 // This function follows the memory contract model in sfntly.
41 // Please refer to sfntly/port/refcount.h for more details.
42 CALLER_ATTACH Font* subset(const unsigned int* glyph_ids,
43 const size_t glyph_count);
44
45 FontFactoryPtr factory_;
46 FontPtr font_;
47 };
48
49 }
brettw 2011/07/19 05:09:42 This should have a comment " // namespace sfntly"
arthurhsu 2011/07/19 18:34:32 Done.
50
51 #endif // SUBSETTER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698