michael@0: // Copyright (c) 2011 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef OTS_NAME_H_ michael@0: #define OTS_NAME_H_ michael@0: michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: michael@0: #include "ots.h" michael@0: michael@0: namespace ots { michael@0: michael@0: struct NameRecord { michael@0: NameRecord() { michael@0: } michael@0: michael@0: NameRecord(uint16_t platformID, uint16_t encodingID, michael@0: uint16_t languageID, uint16_t nameID) michael@0: : platform_id(platformID), michael@0: encoding_id(encodingID), michael@0: language_id(languageID), michael@0: name_id(nameID) { michael@0: } michael@0: michael@0: uint16_t platform_id; michael@0: uint16_t encoding_id; michael@0: uint16_t language_id; michael@0: uint16_t name_id; michael@0: std::string text; michael@0: michael@0: bool operator<(const NameRecord& rhs) const { michael@0: if (platform_id < rhs.platform_id) return true; michael@0: if (platform_id > rhs.platform_id) return false; michael@0: if (encoding_id < rhs.encoding_id) return true; michael@0: if (encoding_id > rhs.encoding_id) return false; michael@0: if (language_id < rhs.language_id) return true; michael@0: if (language_id > rhs.language_id) return false; michael@0: return name_id < rhs.name_id; michael@0: } michael@0: }; michael@0: michael@0: struct OpenTypeNAME { michael@0: std::vector names; michael@0: std::vector lang_tags; michael@0: }; michael@0: michael@0: } // namespace ots michael@0: michael@0: #endif // OTS_NAME_H_