| 1 |
/* Copyright 2013 Google Inc. All Rights Reserved. |
| 2 |
|
| 3 |
Distributed under MIT license. |
| 4 |
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
| 5 |
*/ |
| 6 |
|
| 7 |
/* Functions for normalizing fonts. Since the WOFF 2.0 decoder creates font |
| 8 |
files in normalized form, the WOFF 2.0 conversion is guaranteed to be |
| 9 |
lossless (in a bitwise sense) only for normalized font files. */ |
| 10 |
|
| 11 |
#ifndef WOFF2_NORMALIZE_H_ |
| 12 |
#define WOFF2_NORMALIZE_H_ |
| 13 |
|
| 14 |
namespace woff2 { |
| 15 |
|
| 16 |
struct Font; |
| 17 |
struct FontCollection; |
| 18 |
|
| 19 |
// Changes the offset fields of the table headers so that the data for the |
| 20 |
// tables will be written in order of increasing tag values, without any gaps |
| 21 |
// other than the 4-byte padding. |
| 22 |
bool NormalizeOffsets(Font* font); |
| 23 |
|
| 24 |
// Changes the checksum fields of the table headers and the checksum field of |
| 25 |
// the head table so that it matches the current data. |
| 26 |
bool FixChecksums(Font* font); |
| 27 |
|
| 28 |
// Parses each of the glyphs in the font and writes them again to the glyf |
| 29 |
// table in normalized form, as defined by the StoreGlyph() function. Changes |
| 30 |
// the loca table accordigly. |
| 31 |
bool NormalizeGlyphs(Font* font); |
| 32 |
|
| 33 |
// Performs all of the normalization steps above. |
| 34 |
bool NormalizeFont(Font* font); |
| 35 |
bool NormalizeFontCollection(FontCollection* font_collection); |
| 36 |
|
| 37 |
} // namespace woff2 |
| 38 |
|
| 39 |
#endif // WOFF2_NORMALIZE_H_ |