1 //+-------------------------------------------------------------------------- 2 // 3 // Copyright (c) Microsoft Corporation. All rights reserved. 4 // 5 // Abstract: 6 // Public API definitions for DWrite and D2D 7 // 8 //---------------------------------------------------------------------------- 9 10 #ifndef DCOMMON_H_INCLUDED 11 #define DCOMMON_H_INCLUDED 12 13 // 14 //These macros are defined in the Windows 7 SDK, however to enable development using the technical preview, 15 //they are included here temporarily. 16 // 17 #ifndef DEFINE_ENUM_FLAG_OPERATORS 18 #define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \ 19 extern "C++" { \ 20 inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \ 21 inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \ 22 inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \ 23 inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \ 24 inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \ 25 inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \ 26 inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \ 27 } 28 #endif 29 30 #ifndef __field_ecount_opt 31 #define __field_ecount_opt(x) 32 #endif 33 34 #ifndef __range 35 #define __range(x,y) 36 #endif 37 38 #ifndef __field_ecount 39 #define __field_ecount(x) 40 #endif 41 42 /// <summary> 43 /// The measuring method used for text layout. 44 /// </summary> 45 typedef enum DWRITE_MEASURING_MODE 46 { 47 /// <summary> 48 /// Text is measured using glyph ideal metrics whose values are independent to the current display resolution. 49 /// </summary> 50 DWRITE_MEASURING_MODE_NATURAL, 51 52 /// <summary> 53 /// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution. 54 /// </summary> 55 DWRITE_MEASURING_MODE_GDI_CLASSIC, 56 57 /// <summary> 58 /// Text is measured using the same glyph display metrics as text measured by GDI using a font 59 /// created with CLEARTYPE_NATURAL_QUALITY. 60 /// </summary> 61 DWRITE_MEASURING_MODE_GDI_NATURAL 62 63 } DWRITE_MEASURING_MODE; 64 65 #endif /* DCOMMON_H_INCLUDED */ 66