Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | #ifndef OTS_METRICS_H_ |
michael@0 | 6 | #define OTS_METRICS_H_ |
michael@0 | 7 | |
michael@0 | 8 | #include <new> |
michael@0 | 9 | #include <utility> |
michael@0 | 10 | #include <vector> |
michael@0 | 11 | |
michael@0 | 12 | #include "ots.h" |
michael@0 | 13 | |
michael@0 | 14 | namespace ots { |
michael@0 | 15 | |
michael@0 | 16 | struct OpenTypeMetricsHeader { |
michael@0 | 17 | uint32_t version; |
michael@0 | 18 | int16_t ascent; |
michael@0 | 19 | int16_t descent; |
michael@0 | 20 | int16_t linegap; |
michael@0 | 21 | uint16_t adv_width_max; |
michael@0 | 22 | int16_t min_sb1; |
michael@0 | 23 | int16_t min_sb2; |
michael@0 | 24 | int16_t max_extent; |
michael@0 | 25 | int16_t caret_slope_rise; |
michael@0 | 26 | int16_t caret_slope_run; |
michael@0 | 27 | int16_t caret_offset; |
michael@0 | 28 | uint16_t num_metrics; |
michael@0 | 29 | }; |
michael@0 | 30 | |
michael@0 | 31 | struct OpenTypeMetricsTable { |
michael@0 | 32 | std::vector<std::pair<uint16_t, int16_t> > entries; |
michael@0 | 33 | std::vector<int16_t> sbs; |
michael@0 | 34 | }; |
michael@0 | 35 | |
michael@0 | 36 | bool ParseMetricsHeader(OpenTypeFile *file, Buffer *table, |
michael@0 | 37 | OpenTypeMetricsHeader *header); |
michael@0 | 38 | bool SerialiseMetricsHeader(const ots::OpenTypeFile *file, |
michael@0 | 39 | OTSStream *out, |
michael@0 | 40 | const OpenTypeMetricsHeader *header); |
michael@0 | 41 | |
michael@0 | 42 | bool ParseMetricsTable(const ots::OpenTypeFile *file, |
michael@0 | 43 | Buffer *table, |
michael@0 | 44 | const uint16_t num_glyphs, |
michael@0 | 45 | const OpenTypeMetricsHeader *header, |
michael@0 | 46 | OpenTypeMetricsTable *metrics); |
michael@0 | 47 | bool SerialiseMetricsTable(const ots::OpenTypeFile *file, |
michael@0 | 48 | OTSStream *out, |
michael@0 | 49 | const OpenTypeMetricsTable *metrics); |
michael@0 | 50 | |
michael@0 | 51 | } // namespace ots |
michael@0 | 52 | |
michael@0 | 53 | #endif // OTS_METRICS_H_ |
michael@0 | 54 |