webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
normalize.h
Go to the documentation of this file.
1 // Copyright 2013 Google Inc. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // Functions for normalizing fonts. Since the WOFF 2.0 decoder creates font
16 // files in normalized form, the WOFF 2.0 conversion is guaranteed to be
17 // lossless (in a bitwise sense) only for normalized font files.
18 
19 #ifndef WOFF2_NORMALIZE_H_
20 #define WOFF2_NORMALIZE_H_
21 
22 namespace woff2 {
23 
24 struct Font;
25 struct FontCollection;
26 
27 // Changes the offset fields of the table headers so that the data for the
28 // tables will be written in order of increasing tag values, without any gaps
29 // other than the 4-byte padding.
30 bool NormalizeOffsets(Font* font);
31 
32 // Changes the checksum fields of the table headers and the checksum field of
33 // the head table so that it matches the current data.
34 bool FixChecksums(Font* font);
35 
36 // Parses each of the glyphs in the font and writes them again to the glyf
37 // table in normalized form, as defined by the StoreGlyph() function. Changes
38 // the loca table accordigly.
39 bool NormalizeGlyphs(Font* font);
40 
41 // Performs all of the normalization steps above.
42 bool NormalizeFont(Font* font);
43 bool NormalizeFontCollection(FontCollection* font_collection);
44 
45 } // namespace woff2
46 
47 #endif // WOFF2_NORMALIZE_H_
Definition: FetchRequest.idl:29
bool NormalizeOffsets(Font *font)
Definition: normalize.cc:174
bool FixChecksums(Font *font)
Definition: normalize.cc:208
bool NormalizeFontCollection(FontCollection *font_collection)
Definition: normalize.cc:279
bool NormalizeFont(Font *font)
Definition: normalize.cc:274
bool NormalizeGlyphs(Font *font)
Definition: normalize.cc:117
Definition: buffer.h:45