FontFeature.h (1000B)
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_gfx_FontFeature 8 #define mozilla_gfx_FontFeature 9 10 #include <cstdint> 11 12 namespace mozilla::gfx { 13 // An OpenType feature tag and value pair 14 struct FontFeature { 15 // see http://www.microsoft.com/typography/otspec/featuretags.htm 16 uint32_t mTag; 17 // 0 = off, 1 = on, larger values may be used as parameters 18 // to features that select among multiple alternatives 19 uint32_t mValue; 20 }; 21 22 inline bool operator<(const FontFeature& a, const FontFeature& b) { 23 return (a.mTag < b.mTag) || ((a.mTag == b.mTag) && (a.mValue < b.mValue)); 24 } 25 26 inline bool operator==(const FontFeature& a, const FontFeature& b) { 27 return (a.mTag == b.mTag) && (a.mValue == b.mValue); 28 } 29 30 } // namespace mozilla::gfx 31 32 #endif