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

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 #ifndef FONT_SUBSETTER_H_
brettw 2011/07/19 05:09:42 If this is going to be our code, I'd like to have
arthurhsu 2011/07/19 18:34:32 Done.
18 #define FONT_SUBSETTER_H_
19
20 #include <cstddef>
21
22 // Font subsetting API
23 //
24 // Input TTF/TTC/OTF fonts, specify the glyph IDs to subset, and the subset font
25 // is returned in |output_buffer| (caller to delete[]). Return value is the
26 // length of output_buffer allocated.
27 //
28 // If subsetting failes, a negative value is returned. If none of the glyph IDs
29 // specified is found, the function will return 0.
30 //
31 // |font_name| Font name of the font, required for TTC files. If specified
32 // NULL, the first available font is selected.
33 // |original_font| Original font file contents.
34 // |font_size| Size of |original_font| in bytes.
35 // |glyph_ids| Glyph IDs to subset. If the specified glyph ID is not found
36 // in the font file, it will be ignored silently.
37 // |glyph_count| Number of glyph IDs in |glyph_ids|
38 // |output_buffer| Generated subset font.
39 extern int subsetFont(const char* font_name,
brettw 2011/07/18 22:57:52 It's not clear to me what's going on here. This su
brettw 2011/07/19 05:09:42 Function names should be capital. I'm also wonderi
arthurhsu 2011/07/19 18:34:32 Done. Wrapped as a static method in SfntlyWrapper
arthurhsu 2011/07/19 18:34:32 sfntly disagreed the subsetter code to be upstream
40 const unsigned char* original_font,
41 const size_t font_size,
brettw 2011/07/19 05:09:42 Generally I don't see people writing const on copi
arthurhsu 2011/07/19 18:34:32 Done.
42 const unsigned int* glyph_ids,
43 const size_t glyph_count,
44 unsigned char** output_buffer);
45
46 #endif // FONT_SUBSETTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698