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

Unified Diff: third_party/ots/src/metrics.h

Issue 775893002: Updating OTS repo from https://github.com/khaledhosny/ots.git (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updating with 4800 warning fix Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/ots/src/maxp.cc ('k') | third_party/ots/src/metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/metrics.h
diff --git a/third_party/ots/src/metrics.h b/third_party/ots/src/metrics.h
new file mode 100644
index 0000000000000000000000000000000000000000..f0b4ee8c68ade0f79c53aa9ddc5ffb275937f87a
--- /dev/null
+++ b/third_party/ots/src/metrics.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef OTS_METRICS_H_
+#define OTS_METRICS_H_
+
+#include <new>
+#include <utility>
+#include <vector>
+
+#include "ots.h"
+
+namespace ots {
+
+struct OpenTypeMetricsHeader {
+ uint32_t version;
+ int16_t ascent;
+ int16_t descent;
+ int16_t linegap;
+ uint16_t adv_width_max;
+ int16_t min_sb1;
+ int16_t min_sb2;
+ int16_t max_extent;
+ int16_t caret_slope_rise;
+ int16_t caret_slope_run;
+ int16_t caret_offset;
+ uint16_t num_metrics;
+};
+
+struct OpenTypeMetricsTable {
+ std::vector<std::pair<uint16_t, int16_t> > entries;
+ std::vector<int16_t> sbs;
+};
+
+bool ParseMetricsHeader(OpenTypeFile *file, Buffer *table,
+ OpenTypeMetricsHeader *header);
+bool SerialiseMetricsHeader(const ots::OpenTypeFile *file,
+ OTSStream *out,
+ const OpenTypeMetricsHeader *header);
+
+bool ParseMetricsTable(const ots::OpenTypeFile *file,
+ Buffer *table,
+ const uint16_t num_glyphs,
+ const OpenTypeMetricsHeader *header,
+ OpenTypeMetricsTable *metrics);
+bool SerialiseMetricsTable(const ots::OpenTypeFile *file,
+ OTSStream *out,
+ const OpenTypeMetricsTable *metrics);
+
+} // namespace ots
+
+#endif // OTS_METRICS_H_
+
« no previous file with comments | « third_party/ots/src/maxp.cc ('k') | third_party/ots/src/metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698