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

Side by Side Diff: third_party/sfntly/src/subsetter/font_subsetter.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 // Font subsetting API
18 //
19 // Input TTF/TTC/OTF fonts, specify the glyph IDs to subset, and the subset font
brettw 2011/07/19 21:00:33 This comment should go above the static function.
arthurhsu 2011/07/20 01:14:19 Done.
20 // is returned in |output_buffer| (caller to delete[]). Return value is the
21 // length of output_buffer allocated.
22 //
23 // If subsetting failes, a negative value is returned. If none of the glyph IDs
24 // specified is found, the function will return 0.
25 //
26 // |font_name| Font name of the font, required for TTC files. If specified
27 // NULL, the first available font is selected.
28 // |original_font| Original font file contents.
29 // |font_size| Size of |original_font| in bytes.
30 // |glyph_ids| Glyph IDs to subset. If the specified glyph ID is not found
31 // in the font file, it will be ignored silently.
32 // |glyph_count| Number of glyph IDs in |glyph_ids|
33 // |output_buffer| Generated subset font.
brettw 2011/07/19 21:00:33 Can you mention which method the caller should del
arthurhsu 2011/07/20 01:14:19 Done.
34
35 #ifndef THIRD_PARTY_SFNTLY_SRC_SUBSETTER_FONT_SUBSETTER_H_
36 #define THIRD_PARTY_SFNTLY_SRC_SUBSETTER_FONT_SUBSETTER_H_
37
38 #include <cstddef>
39
40 class SfntlyWrapper {
41 public:
42 static int SubsetFont(const char* font_name,
43 const unsigned char* original_font,
44 size_t font_size,
45 const unsigned int* glyph_ids,
46 size_t glyph_count,
47 unsigned char** output_buffer);
48 };
49
50 #endif // THIRD_PARTY_SFNTLY_SRC_SUBSETTER_FONT_SUBSETTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698