1 module directx.dwrite_1; 2 //+-------------------------------------------------------------------------- 3 // 4 // Copyright (c) Microsoft Corporation. All rights reserved. 5 // 6 // Abstract: 7 // DirectX Typography Services public API definitions. 8 // 9 //---------------------------------------------------------------------------- 10 11 version(Windows): 12 13 public import directx.dwrite; 14 15 /// <summary> 16 /// The overall kind of family. 17 /// </summary> 18 alias DWRITE_PANOSE_FAMILY = int; 19 enum : DWRITE_PANOSE_FAMILY 20 { 21 DWRITE_PANOSE_FAMILY_ANY = 0, 22 DWRITE_PANOSE_FAMILY_NO_FIT = 1, 23 DWRITE_PANOSE_FAMILY_TEXT_DISPLAY = 2, 24 DWRITE_PANOSE_FAMILY_SCRIPT = 3, // or hand written 25 DWRITE_PANOSE_FAMILY_DECORATIVE = 4, 26 DWRITE_PANOSE_FAMILY_SYMBOL = 5, // or symbol 27 DWRITE_PANOSE_FAMILY_PICTORIAL = DWRITE_PANOSE_FAMILY_SYMBOL 28 } 29 30 /// <summary> 31 /// Appearance of the serifs. 32 /// Present for families: 2-text 33 /// </summary> 34 alias DWRITE_PANOSE_SERIF_STYLE = int; 35 enum : DWRITE_PANOSE_SERIF_STYLE 36 { 37 DWRITE_PANOSE_SERIF_STYLE_ANY = 0, 38 DWRITE_PANOSE_SERIF_STYLE_NO_FIT = 1, 39 DWRITE_PANOSE_SERIF_STYLE_COVE = 2, 40 DWRITE_PANOSE_SERIF_STYLE_OBTUSE_COVE = 3, 41 DWRITE_PANOSE_SERIF_STYLE_SQUARE_COVE = 4, 42 DWRITE_PANOSE_SERIF_STYLE_OBTUSE_SQUARE_COVE = 5, 43 DWRITE_PANOSE_SERIF_STYLE_SQUARE = 6, 44 DWRITE_PANOSE_SERIF_STYLE_THIN = 7, 45 DWRITE_PANOSE_SERIF_STYLE_OVAL = 8, 46 DWRITE_PANOSE_SERIF_STYLE_EXAGGERATED = 9, 47 DWRITE_PANOSE_SERIF_STYLE_TRIANGLE = 10, 48 DWRITE_PANOSE_SERIF_STYLE_NORMAL_SANS = 11, 49 DWRITE_PANOSE_SERIF_STYLE_OBTUSE_SANS = 12, 50 DWRITE_PANOSE_SERIF_STYLE_PERPENDICULAR_SANS = 13, 51 DWRITE_PANOSE_SERIF_STYLE_FLARED = 14, 52 DWRITE_PANOSE_SERIF_STYLE_ROUNDED = 15, 53 DWRITE_PANOSE_SERIF_STYLE_SCRIPT = 16, 54 DWRITE_PANOSE_SERIF_STYLE_PERP_SANS = DWRITE_PANOSE_SERIF_STYLE_PERPENDICULAR_SANS, 55 DWRITE_PANOSE_SERIF_STYLE_BONE = DWRITE_PANOSE_SERIF_STYLE_OVAL 56 } 57 58 /// <summary> 59 /// PANOSE font weights. These roughly correspond to the DWRITE_FONT_WEIGHT's 60 /// using (panose_weight - 2) * 100. 61 /// Present for families: 2-text, 3-script, 4-decorative, 5-symbol 62 /// </summary> 63 alias DWRITE_PANOSE_WEIGHT = int; 64 enum : DWRITE_PANOSE_WEIGHT 65 { 66 DWRITE_PANOSE_WEIGHT_ANY = 0, 67 DWRITE_PANOSE_WEIGHT_NO_FIT = 1, 68 DWRITE_PANOSE_WEIGHT_VERY_LIGHT = 2, 69 DWRITE_PANOSE_WEIGHT_LIGHT = 3, 70 DWRITE_PANOSE_WEIGHT_THIN = 4, 71 DWRITE_PANOSE_WEIGHT_BOOK = 5, 72 DWRITE_PANOSE_WEIGHT_MEDIUM = 6, 73 DWRITE_PANOSE_WEIGHT_DEMI = 7, 74 DWRITE_PANOSE_WEIGHT_BOLD = 8, 75 DWRITE_PANOSE_WEIGHT_HEAVY = 9, 76 DWRITE_PANOSE_WEIGHT_BLACK = 10, 77 DWRITE_PANOSE_WEIGHT_EXTRA_BLACK = 11, 78 DWRITE_PANOSE_WEIGHT_NORD = DWRITE_PANOSE_WEIGHT_EXTRA_BLACK 79 } 80 81 /// <summary> 82 /// Proportion of the glyph shape considering additional detail to standard 83 /// characters. 84 /// Present for families: 2-text 85 /// </summary> 86 alias DWORD DWRITE_PANOSE_PROPORTION; 87 enum : DWRITE_PANOSE_PROPORTION 88 { 89 DWRITE_PANOSE_PROPORTION_ANY = 0, 90 DWRITE_PANOSE_PROPORTION_NO_FIT = 1, 91 DWRITE_PANOSE_PROPORTION_OLD_STYLE = 2, 92 DWRITE_PANOSE_PROPORTION_MODERN = 3, 93 DWRITE_PANOSE_PROPORTION_EVEN_WIDTH = 4, 94 DWRITE_PANOSE_PROPORTION_EXPANDED = 5, 95 DWRITE_PANOSE_PROPORTION_CONDENSED = 6, 96 DWRITE_PANOSE_PROPORTION_VERY_EXPANDED = 7, 97 DWRITE_PANOSE_PROPORTION_VERY_CONDENSED = 8, 98 DWRITE_PANOSE_PROPORTION_MONOSPACED = 9 99 } 100 101 /// <summary> 102 /// Ratio between thickest and thinnest point of the stroke for a letter such 103 /// as uppercase 'O'. 104 /// Present for families: 2-text, 3-script, 4-decorative 105 /// </summary> 106 alias DWRITE_PANOSE_CONTRAST = int; 107 enum : DWRITE_PANOSE_CONTRAST 108 { 109 DWRITE_PANOSE_CONTRAST_ANY = 0, 110 DWRITE_PANOSE_CONTRAST_NO_FIT = 1, 111 DWRITE_PANOSE_CONTRAST_NONE = 2, 112 DWRITE_PANOSE_CONTRAST_VERY_LOW = 3, 113 DWRITE_PANOSE_CONTRAST_LOW = 4, 114 DWRITE_PANOSE_CONTRAST_MEDIUM_LOW = 5, 115 DWRITE_PANOSE_CONTRAST_MEDIUM = 6, 116 DWRITE_PANOSE_CONTRAST_MEDIUM_HIGH = 7, 117 DWRITE_PANOSE_CONTRAST_HIGH = 8, 118 DWRITE_PANOSE_CONTRAST_VERY_HIGH = 9, 119 DWRITE_PANOSE_CONTRAST_HORIZONTAL_LOW = 10, 120 DWRITE_PANOSE_CONTRAST_HORIZONTAL_MEDIUM = 11, 121 DWRITE_PANOSE_CONTRAST_HORIZONTAL_HIGH = 12, 122 DWRITE_PANOSE_CONTRAST_BROKEN = 13 123 } 124 125 /// <summary> 126 /// Relationship between thin and thick stems. 127 /// Present for families: 2-text 128 /// </summary> 129 alias DWRITE_PANOSE_STROKE_VARIATION = int; 130 enum : DWRITE_PANOSE_STROKE_VARIATION 131 { 132 DWRITE_PANOSE_STROKE_VARIATION_ANY = 0, 133 DWRITE_PANOSE_STROKE_VARIATION_NO_FIT = 1, 134 DWRITE_PANOSE_STROKE_VARIATION_NO_VARIATION = 2, 135 DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_DIAGONAL = 3, 136 DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_TRANSITIONAL = 4, 137 DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_VERTICAL = 5, 138 DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_HORIZONTAL = 6, 139 DWRITE_PANOSE_STROKE_VARIATION_RAPID_VERTICAL = 7, 140 DWRITE_PANOSE_STROKE_VARIATION_RAPID_HORIZONTAL = 8, 141 DWRITE_PANOSE_STROKE_VARIATION_INSTANT_VERTICAL = 9, 142 DWRITE_PANOSE_STROKE_VARIATION_INSTANT_HORIZONTAL = 10 143 } 144 145 /// <summary> 146 /// Style of termination of stems and rounded letterforms. 147 /// Present for families: 2-text 148 /// </summary> 149 alias DWRITE_PANOSE_ARM_STYLE = int; 150 enum : DWRITE_PANOSE_ARM_STYLE 151 { 152 DWRITE_PANOSE_ARM_STYLE_ANY = 0, 153 DWRITE_PANOSE_ARM_STYLE_NO_FIT = 1, 154 DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_HORIZONTAL = 2, 155 DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_WEDGE = 3, 156 DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_VERTICAL = 4, 157 DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_SINGLE_SERIF = 5, 158 DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_DOUBLE_SERIF = 6, 159 DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_HORIZONTAL = 7, 160 DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_WEDGE = 8, 161 DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_VERTICAL = 9, 162 DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_SINGLE_SERIF = 10, 163 DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_DOUBLE_SERIF = 11, 164 DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_HORZ = DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_HORIZONTAL, 165 DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_VERT = DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_VERTICAL, 166 DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_HORZ = DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_HORIZONTAL, 167 DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_WEDGE = DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_WEDGE, 168 DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_VERT = DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_VERTICAL, 169 DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_SINGLE_SERIF = DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_SINGLE_SERIF, 170 DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_DOUBLE_SERIF = DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_DOUBLE_SERIF 171 } 172 173 /// <summary> 174 /// Roundness of letterform. 175 /// Present for families: 2-text 176 /// </summary> 177 alias DWRITE_PANOSE_LETTERFORM = int; 178 enum : DWRITE_PANOSE_LETTERFORM 179 { 180 DWRITE_PANOSE_LETTERFORM_ANY = 0, 181 DWRITE_PANOSE_LETTERFORM_NO_FIT = 1, 182 DWRITE_PANOSE_LETTERFORM_NORMAL_CONTACT = 2, 183 DWRITE_PANOSE_LETTERFORM_NORMAL_WEIGHTED = 3, 184 DWRITE_PANOSE_LETTERFORM_NORMAL_BOXED = 4, 185 DWRITE_PANOSE_LETTERFORM_NORMAL_FLATTENED = 5, 186 DWRITE_PANOSE_LETTERFORM_NORMAL_ROUNDED = 6, 187 DWRITE_PANOSE_LETTERFORM_NORMAL_OFF_CENTER = 7, 188 DWRITE_PANOSE_LETTERFORM_NORMAL_SQUARE = 8, 189 DWRITE_PANOSE_LETTERFORM_OBLIQUE_CONTACT = 9, 190 DWRITE_PANOSE_LETTERFORM_OBLIQUE_WEIGHTED = 10, 191 DWRITE_PANOSE_LETTERFORM_OBLIQUE_BOXED = 11, 192 DWRITE_PANOSE_LETTERFORM_OBLIQUE_FLATTENED = 12, 193 DWRITE_PANOSE_LETTERFORM_OBLIQUE_ROUNDED = 13, 194 DWRITE_PANOSE_LETTERFORM_OBLIQUE_OFF_CENTER = 14, 195 DWRITE_PANOSE_LETTERFORM_OBLIQUE_SQUARE = 15 196 } 197 198 /// <summary> 199 /// Placement of midline across uppercase characters and treatment of diagonal 200 /// stem apexes. 201 /// Present for families: 2-text 202 /// </summary> 203 alias DWRITE_PANOSE_MIDLINE = int; 204 enum : DWRITE_PANOSE_MIDLINE 205 { 206 DWRITE_PANOSE_MIDLINE_ANY = 0, 207 DWRITE_PANOSE_MIDLINE_NO_FIT = 1, 208 DWRITE_PANOSE_MIDLINE_STANDARD_TRIMMED = 2, 209 DWRITE_PANOSE_MIDLINE_STANDARD_POINTED = 3, 210 DWRITE_PANOSE_MIDLINE_STANDARD_SERIFED = 4, 211 DWRITE_PANOSE_MIDLINE_HIGH_TRIMMED = 5, 212 DWRITE_PANOSE_MIDLINE_HIGH_POINTED = 6, 213 DWRITE_PANOSE_MIDLINE_HIGH_SERIFED = 7, 214 DWRITE_PANOSE_MIDLINE_CONSTANT_TRIMMED = 8, 215 DWRITE_PANOSE_MIDLINE_CONSTANT_POINTED = 9, 216 DWRITE_PANOSE_MIDLINE_CONSTANT_SERIFED = 10, 217 DWRITE_PANOSE_MIDLINE_LOW_TRIMMED = 11, 218 DWRITE_PANOSE_MIDLINE_LOW_POINTED = 12, 219 DWRITE_PANOSE_MIDLINE_LOW_SERIFED = 13 220 } 221 222 /// <summary> 223 /// Relative size of lowercase letters and treament of diacritic marks 224 /// and uppercase glyphs. 225 /// Present for families: 2-text 226 /// </summary> 227 alias DWRITE_PANOSE_XHEIGHT = int; 228 enum : DWRITE_PANOSE_XHEIGHT 229 { 230 DWRITE_PANOSE_XHEIGHT_ANY = 0, 231 DWRITE_PANOSE_XHEIGHT_NO_FIT = 1, 232 DWRITE_PANOSE_XHEIGHT_CONSTANT_SMALL = 2, 233 DWRITE_PANOSE_XHEIGHT_CONSTANT_STANDARD = 3, 234 DWRITE_PANOSE_XHEIGHT_CONSTANT_LARGE = 4, 235 DWRITE_PANOSE_XHEIGHT_DUCKING_SMALL = 5, 236 DWRITE_PANOSE_XHEIGHT_DUCKING_STANDARD = 6, 237 DWRITE_PANOSE_XHEIGHT_DUCKING_LARGE = 7, 238 DWRITE_PANOSE_XHEIGHT_CONSTANT_STD = DWRITE_PANOSE_XHEIGHT_CONSTANT_STANDARD, 239 DWRITE_PANOSE_XHEIGHT_DUCKING_STD = DWRITE_PANOSE_XHEIGHT_DUCKING_STANDARD 240 } 241 242 /// <summary> 243 /// Kind of tool used to create character forms. 244 /// Present for families: 3-script 245 /// </summary> 246 alias DWRITE_PANOSE_TOOL_KIND = int; 247 enum : DWRITE_PANOSE_TOOL_KIND 248 { 249 DWRITE_PANOSE_TOOL_KIND_ANY = 0, 250 DWRITE_PANOSE_TOOL_KIND_NO_FIT = 1, 251 DWRITE_PANOSE_TOOL_KIND_FLAT_NIB = 2, 252 DWRITE_PANOSE_TOOL_KIND_PRESSURE_POINT = 3, 253 DWRITE_PANOSE_TOOL_KIND_ENGRAVED = 4, 254 DWRITE_PANOSE_TOOL_KIND_BALL = 5, 255 DWRITE_PANOSE_TOOL_KIND_BRUSH = 6, 256 DWRITE_PANOSE_TOOL_KIND_ROUGH = 7, 257 DWRITE_PANOSE_TOOL_KIND_FELT_PEN_BRUSH_TIP = 8, 258 DWRITE_PANOSE_TOOL_KIND_WILD_BRUSH = 9 259 } 260 261 /// <summary> 262 /// Monospace vs proportional. 263 /// Present for families: 3-script, 5-symbol 264 /// </summary> 265 alias DWRITE_PANOSE_SPACING = int; 266 enum : DWRITE_PANOSE_SPACING 267 { 268 DWRITE_PANOSE_SPACING_ANY = 0, 269 DWRITE_PANOSE_SPACING_NO_FIT = 1, 270 DWRITE_PANOSE_SPACING_PROPORTIONAL_SPACED = 2, 271 DWRITE_PANOSE_SPACING_MONOSPACED = 3, 272 } 273 274 /// <summary> 275 /// Ratio between width and height of the face. 276 /// Present for families: 3-script 277 /// </summary> 278 alias DWRITE_PANOSE_ASPECT_RATIO = int; 279 enum : DWRITE_PANOSE_ASPECT_RATIO 280 { 281 DWRITE_PANOSE_ASPECT_RATIO_ANY = 0, 282 DWRITE_PANOSE_ASPECT_RATIO_NO_FIT = 1, 283 DWRITE_PANOSE_ASPECT_RATIO_VERY_CONDENSED = 2, 284 DWRITE_PANOSE_ASPECT_RATIO_CONDENSED = 3, 285 DWRITE_PANOSE_ASPECT_RATIO_NORMAL = 4, 286 DWRITE_PANOSE_ASPECT_RATIO_EXPANDED = 5, 287 DWRITE_PANOSE_ASPECT_RATIO_VERY_EXPANDED = 6 288 } 289 290 /// <summary> 291 /// Topology of letterforms. 292 /// Present for families: 3-script 293 /// </summary> 294 alias DWRITE_PANOSE_SCRIPT_TOPOLOGY = int; 295 enum : DWRITE_PANOSE_SCRIPT_TOPOLOGY 296 { 297 DWRITE_PANOSE_SCRIPT_TOPOLOGY_ANY = 0, 298 DWRITE_PANOSE_SCRIPT_TOPOLOGY_NO_FIT = 1, 299 DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_DISCONNECTED = 2, 300 DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_TRAILING = 3, 301 DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_CONNECTED = 4, 302 DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_DISCONNECTED = 5, 303 DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_TRAILING = 6, 304 DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_CONNECTED = 7, 305 DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_DISCONNECTED = 8, 306 DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_TRAILING = 9, 307 DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_CONNECTED = 10 308 } 309 310 /// <summary> 311 /// General look of the face, considering slope and tails. 312 /// Present for families: 3-script 313 /// </summary> 314 alias DWRITE_PANOSE_SCRIPT_FORM = int; 315 enum : DWRITE_PANOSE_SCRIPT_FORM 316 { 317 DWRITE_PANOSE_SCRIPT_FORM_ANY = 0, 318 DWRITE_PANOSE_SCRIPT_FORM_NO_FIT = 1, 319 DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_NO_WRAPPING = 2, 320 DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_SOME_WRAPPING = 3, 321 DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_MORE_WRAPPING = 4, 322 DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_EXTREME_WRAPPING = 5, 323 DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_NO_WRAPPING = 6, 324 DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_SOME_WRAPPING = 7, 325 DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_MORE_WRAPPING = 8, 326 DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_EXTREME_WRAPPING = 9, 327 DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_NO_WRAPPING = 10, 328 DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_SOME_WRAPPING = 11, 329 DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_MORE_WRAPPING = 12, 330 DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_EXTREME_WRAPPING = 13 331 } 332 333 /// <summary> 334 /// How character ends and miniscule ascenders are treated. 335 /// Present for families: 3-script 336 /// </summary> 337 alias DWRITE_PANOSE_FINIALS = int; 338 enum : DWRITE_PANOSE_FINIALS 339 { 340 DWRITE_PANOSE_FINIALS_ANY = 0, 341 DWRITE_PANOSE_FINIALS_NO_FIT = 1, 342 DWRITE_PANOSE_FINIALS_NONE_NO_LOOPS = 2, 343 DWRITE_PANOSE_FINIALS_NONE_CLOSED_LOOPS = 3, 344 DWRITE_PANOSE_FINIALS_NONE_OPEN_LOOPS = 4, 345 DWRITE_PANOSE_FINIALS_SHARP_NO_LOOPS = 5, 346 DWRITE_PANOSE_FINIALS_SHARP_CLOSED_LOOPS = 6, 347 DWRITE_PANOSE_FINIALS_SHARP_OPEN_LOOPS = 7, 348 DWRITE_PANOSE_FINIALS_TAPERED_NO_LOOPS = 8, 349 DWRITE_PANOSE_FINIALS_TAPERED_CLOSED_LOOPS = 9, 350 DWRITE_PANOSE_FINIALS_TAPERED_OPEN_LOOPS = 10, 351 DWRITE_PANOSE_FINIALS_ROUND_NO_LOOPS = 11, 352 DWRITE_PANOSE_FINIALS_ROUND_CLOSED_LOOPS = 12, 353 DWRITE_PANOSE_FINIALS_ROUND_OPEN_LOOPS = 13 354 } 355 356 /// <summary> 357 /// Relative size of the lowercase letters. 358 /// Present for families: 3-script 359 /// </summary> 360 alias DWRITE_PANOSE_XASCENT = int; 361 enum : DWRITE_PANOSE_XASCENT 362 { 363 DWRITE_PANOSE_XASCENT_ANY = 0, 364 DWRITE_PANOSE_XASCENT_NO_FIT = 1, 365 DWRITE_PANOSE_XASCENT_VERY_LOW = 2, 366 DWRITE_PANOSE_XASCENT_LOW = 3, 367 DWRITE_PANOSE_XASCENT_MEDIUM = 4, 368 DWRITE_PANOSE_XASCENT_HIGH = 5, 369 DWRITE_PANOSE_XASCENT_VERY_HIGH = 6 370 } 371 372 /// <summary> 373 /// General look of the face. 374 /// Present for families: 4-decorative 375 /// </summary> 376 alias DWRITE_PANOSE_DECORATIVE_CLASS = int; 377 enum : DWRITE_PANOSE_DECORATIVE_CLASS 378 { 379 DWRITE_PANOSE_DECORATIVE_CLASS_ANY = 0, 380 DWRITE_PANOSE_DECORATIVE_CLASS_NO_FIT = 1, 381 DWRITE_PANOSE_DECORATIVE_CLASS_DERIVATIVE = 2, 382 DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_TOPOLOGY = 3, 383 DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_ELEMENTS = 4, 384 DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_ASPECT = 5, 385 DWRITE_PANOSE_DECORATIVE_CLASS_INITIALS = 6, 386 DWRITE_PANOSE_DECORATIVE_CLASS_CARTOON = 7, 387 DWRITE_PANOSE_DECORATIVE_CLASS_PICTURE_STEMS = 8, 388 DWRITE_PANOSE_DECORATIVE_CLASS_ORNAMENTED = 9, 389 DWRITE_PANOSE_DECORATIVE_CLASS_TEXT_AND_BACKGROUND = 10, 390 DWRITE_PANOSE_DECORATIVE_CLASS_COLLAGE = 11, 391 DWRITE_PANOSE_DECORATIVE_CLASS_MONTAGE = 12 392 } 393 394 /// <summary> 395 /// Ratio between the width and height of the face. 396 /// Present for families: 4-decorative 397 /// </summary> 398 alias DWRITE_PANOSE_ASPECT = int; 399 enum : DWRITE_PANOSE_ASPECT 400 { 401 DWRITE_PANOSE_ASPECT_ANY = 0, 402 DWRITE_PANOSE_ASPECT_NO_FIT = 1, 403 DWRITE_PANOSE_ASPECT_SUPER_CONDENSED = 2, 404 DWRITE_PANOSE_ASPECT_VERY_CONDENSED = 3, 405 DWRITE_PANOSE_ASPECT_CONDENSED = 4, 406 DWRITE_PANOSE_ASPECT_NORMAL = 5, 407 DWRITE_PANOSE_ASPECT_EXTENDED = 6, 408 DWRITE_PANOSE_ASPECT_VERY_EXTENDED = 7, 409 DWRITE_PANOSE_ASPECT_SUPER_EXTENDED = 8, 410 DWRITE_PANOSE_ASPECT_MONOSPACED = 9 411 } 412 413 /// <summary> 414 /// Type of fill/line (treatment). 415 /// Present for families: 4-decorative 416 /// </summary> 417 alias DWRITE_PANOSE_FILL = int; 418 enum : DWRITE_PANOSE_FILL 419 { 420 DWRITE_PANOSE_FILL_ANY = 0, 421 DWRITE_PANOSE_FILL_NO_FIT = 1, 422 DWRITE_PANOSE_FILL_STANDARD_SOLID_FILL = 2, 423 DWRITE_PANOSE_FILL_NO_FILL = 3, 424 DWRITE_PANOSE_FILL_PATTERNED_FILL = 4, 425 DWRITE_PANOSE_FILL_COMPLEX_FILL = 5, 426 DWRITE_PANOSE_FILL_SHAPED_FILL = 6, 427 DWRITE_PANOSE_FILL_DRAWN_DISTRESSED = 7, 428 } 429 430 /// <summary> 431 /// Outline handling. 432 /// Present for families: 4-decorative 433 /// </summary> 434 alias DWRITE_PANOSE_LINING = int; 435 enum : DWRITE_PANOSE_LINING 436 { 437 DWRITE_PANOSE_LINING_ANY = 0, 438 DWRITE_PANOSE_LINING_NO_FIT = 1, 439 DWRITE_PANOSE_LINING_NONE = 2, 440 DWRITE_PANOSE_LINING_INLINE = 3, 441 DWRITE_PANOSE_LINING_OUTLINE = 4, 442 DWRITE_PANOSE_LINING_ENGRAVED = 5, 443 DWRITE_PANOSE_LINING_SHADOW = 6, 444 DWRITE_PANOSE_LINING_RELIEF = 7, 445 DWRITE_PANOSE_LINING_BACKDROP = 8 446 } 447 448 /// <summary> 449 /// Overall shape characteristics of the font. 450 /// Present for families: 4-decorative 451 /// </summary> 452 alias DWRITE_PANOSE_DECORATIVE_TOPOLOGY = int; 453 enum : DWRITE_PANOSE_DECORATIVE_TOPOLOGY 454 { 455 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_ANY = 0, 456 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_NO_FIT = 1, 457 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_STANDARD = 2, 458 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_SQUARE = 3, 459 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_MULTIPLE_SEGMENT = 4, 460 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_ART_DECO = 5, 461 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_UNEVEN_WEIGHTING = 6, 462 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_DIVERSE_ARMS = 7, 463 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_DIVERSE_FORMS = 8, 464 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_LOMBARDIC_FORMS = 9, 465 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_UPPER_CASE_IN_LOWER_CASE = 10, 466 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_IMPLIED_TOPOLOGY = 11, 467 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_HORSESHOE_E_AND_A = 12, 468 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_CURSIVE = 13, 469 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_BLACKLETTER = 14, 470 DWRITE_PANOSE_DECORATIVE_TOPOLOGY_SWASH_VARIANCE = 15 471 } 472 473 /// <summary> 474 /// Type of characters available in the font. 475 /// Present for families: 4-decorative 476 /// </summary> 477 alias DWRITE_PANOSE_CHARACTER_RANGES = int; 478 enum : DWRITE_PANOSE_CHARACTER_RANGES 479 { 480 DWRITE_PANOSE_CHARACTER_RANGES_ANY = 0, 481 DWRITE_PANOSE_CHARACTER_RANGES_NO_FIT = 1, 482 DWRITE_PANOSE_CHARACTER_RANGES_EXTENDED_COLLECTION = 2, 483 DWRITE_PANOSE_CHARACTER_RANGES_LITERALS = 3, 484 DWRITE_PANOSE_CHARACTER_RANGES_NO_LOWER_CASE = 4, 485 DWRITE_PANOSE_CHARACTER_RANGES_SMALL_CAPS = 5 486 } 487 488 /// <summary> 489 /// Kind of symbol set. 490 /// Present for families: 5-symbol 491 /// </summary> 492 alias DWRITE_PANOSE_SYMBOL_KIND = int; 493 enum : DWRITE_PANOSE_SYMBOL_KIND 494 { 495 DWRITE_PANOSE_SYMBOL_KIND_ANY = 0, 496 DWRITE_PANOSE_SYMBOL_KIND_NO_FIT = 1, 497 DWRITE_PANOSE_SYMBOL_KIND_MONTAGES = 2, 498 DWRITE_PANOSE_SYMBOL_KIND_PICTURES = 3, 499 DWRITE_PANOSE_SYMBOL_KIND_SHAPES = 4, 500 DWRITE_PANOSE_SYMBOL_KIND_SCIENTIFIC = 5, 501 DWRITE_PANOSE_SYMBOL_KIND_MUSIC = 6, 502 DWRITE_PANOSE_SYMBOL_KIND_EXPERT = 7, 503 DWRITE_PANOSE_SYMBOL_KIND_PATTERNS = 8, 504 DWRITE_PANOSE_SYMBOL_KIND_BOARDERS = 9, 505 DWRITE_PANOSE_SYMBOL_KIND_ICONS = 10, 506 DWRITE_PANOSE_SYMBOL_KIND_LOGOS = 11, 507 DWRITE_PANOSE_SYMBOL_KIND_INDUSTRY_SPECIFIC = 12 508 } 509 510 /// <summary> 511 /// Aspect ratio of symbolic characters. 512 /// Present for families: 5-symbol 513 /// </summary> 514 alias DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = int; 515 enum : DWRITE_PANOSE_SYMBOL_ASPECT_RATIO 516 { 517 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_ANY = 0, 518 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NO_FIT = 1, 519 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NO_WIDTH = 2, 520 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_EXCEPTIONALLY_WIDE = 3, 521 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_SUPER_WIDE = 4, 522 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_VERY_WIDE = 5, 523 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_WIDE = 6, 524 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NORMAL = 7, 525 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NARROW = 8, 526 DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_VERY_NARROW = 9 527 } 528 529 /// <summary> 530 /// Specifies the policy used by GetRecommendedRenderingMode to determine whether to 531 /// render glyphs in outline mode. Glyphs are rendered in outline mode by default at 532 /// large sizes for performance reasons, but how large (i.e., the outline threshold) 533 /// depends on the quality of outline rendering. If the graphics system renders anti- 534 /// aliased outlines then a relatively low threshold is used, but if the graphics 535 /// system renders aliased outlines then a much higher threshold is used. 536 /// </summary> 537 alias DWRITE_OUTLINE_THRESHOLD = int; 538 enum : DWRITE_OUTLINE_THRESHOLD 539 { 540 DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, 541 DWRITE_OUTLINE_THRESHOLD_ALIASED 542 } 543 544 /// <summary> 545 /// Baseline for text alignment. 546 /// </summary> 547 alias DWRITE_BASELINE = int; 548 enum : DWRITE_BASELINE 549 { 550 /// <summary> 551 /// The Roman baseline for horizontal, Central baseline for vertical. 552 /// </summary> 553 DWRITE_BASELINE_DEFAULT, 554 555 /// <summary> 556 /// The baseline used by alphabetic scripts such as Latin, Greek, Cyrillic. 557 /// </summary> 558 DWRITE_BASELINE_ROMAN, 559 560 /// <summary> 561 /// Central baseline, generally used for vertical text. 562 /// </summary> 563 DWRITE_BASELINE_CENTRAL, 564 565 /// <summary> 566 /// Mathematical baseline which math characters are centered on. 567 /// </summary> 568 DWRITE_BASELINE_MATH, 569 570 /// <summary> 571 /// Hanging baseline, used in scripts like Devanagari. 572 /// </summary> 573 DWRITE_BASELINE_HANGING, 574 575 /// <summary> 576 /// Ideographic bottom baseline for CJK, left in vertical. 577 /// </summary> 578 DWRITE_BASELINE_IDEOGRAPHIC_BOTTOM, 579 580 /// <summary> 581 /// Ideographic top baseline for CJK, right in vertical. 582 /// </summary> 583 DWRITE_BASELINE_IDEOGRAPHIC_TOP, 584 585 /// <summary> 586 /// The bottom-most extent in horizontal, left-most in vertical. 587 /// </summary> 588 DWRITE_BASELINE_MINIMUM, 589 590 /// <summary> 591 /// The top-most extent in horizontal, right-most in vertical. 592 /// </summary> 593 DWRITE_BASELINE_MAXIMUM, 594 } 595 596 /// <summary> 597 /// The desired kind of glyph orientation for the text. The client specifies 598 /// this to the analyzer as the desired orientation, but note this is the 599 /// client preference, and the constraints of the script will determine the 600 /// final presentation. 601 /// </summary> 602 alias DWRITE_VERTICAL_GLYPH_ORIENTATION = int; 603 enum : DWRITE_VERTICAL_GLYPH_ORIENTATION 604 { 605 /// <summary> 606 /// In vertical layout, naturally horizontal scripts (Latin, Thai, Arabic, 607 /// Devanagari) rotate 90 degrees clockwise, while ideographic scripts 608 /// (Chinese, Japanese, Korean) remain upright, 0 degrees. 609 /// </summary> 610 DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT, 611 612 /// <summary> 613 /// Ideographic scripts and scripts that permit stacking 614 /// (Latin, Hebrew) are stacked in vertical reading layout. 615 /// Connected scripts (Arabic, Syriac, 'Phags-pa, Ogham), 616 /// which would otherwise look broken if glyphs were kept 617 /// at 0 degrees, remain connected and rotate. 618 /// </summary> 619 DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED, 620 } 621 622 /// <summary> 623 /// How the glyph is oriented to the x-axis. This is an output from the text 624 /// analyzer, dependent on the desired orientation, bidi level, and character 625 /// properties. 626 /// </summary> 627 alias DWRITE_GLYPH_ORIENTATION_ANGLE = int; 628 enum : DWRITE_GLYPH_ORIENTATION_ANGLE 629 { 630 /// <summary> 631 /// Glyph orientation is upright. 632 /// </summary> 633 DWRITE_GLYPH_ORIENTATION_ANGLE_0_DEGREES, 634 635 /// <summary> 636 /// Glyph orientation is rotated 90 clockwise. 637 /// </summary> 638 DWRITE_GLYPH_ORIENTATION_ANGLE_90_DEGREES, 639 640 /// <summary> 641 /// Glyph orientation is upside-down. 642 /// </summary> 643 DWRITE_GLYPH_ORIENTATION_ANGLE_180_DEGREES, 644 645 /// <summary> 646 /// Glyph orientation is rotated 270 clockwise. 647 /// </summary> 648 DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES, 649 } 650 651 652 struct DWRITE_FONT_METRICS1 // : DWRITE_FONT_METRICS 653 { 654 alias dfm this; 655 DWRITE_FONT_METRICS dfm; 656 657 /// <summary> 658 /// Left edge of accumulated bounding blackbox of all glyphs in the font. 659 /// </summary> 660 INT16 glyphBoxLeft; 661 662 /// <summary> 663 /// Top edge of accumulated bounding blackbox of all glyphs in the font. 664 /// </summary> 665 INT16 glyphBoxTop; 666 667 /// <summary> 668 /// Right edge of accumulated bounding blackbox of all glyphs in the font. 669 /// </summary> 670 INT16 glyphBoxRight; 671 672 /// <summary> 673 /// Bottom edge of accumulated bounding blackbox of all glyphs in the font. 674 /// </summary> 675 INT16 glyphBoxBottom; 676 677 /// <summary> 678 /// Horizontal position of the subscript relative to the baseline origin. 679 /// This is typically negative (to the left) in italic/oblique fonts, and 680 /// zero in regular fonts. 681 /// </summary> 682 INT16 subscriptPositionX; 683 684 /// <summary> 685 /// Vertical position of the subscript relative to the baseline. 686 /// This is typically negative. 687 /// </summary> 688 INT16 subscriptPositionY; 689 690 /// <summary> 691 /// Horizontal size of the subscript em box in design units, used to 692 /// scale the simulated subscript relative to the full em box size. 693 /// This the numerator of the scaling ratio where denominator is the 694 /// design units per em. If this member is zero, the font does not specify 695 /// a scale factor, and the client should use its own policy. 696 /// </summary> 697 INT16 subscriptSizeX; 698 699 /// <summary> 700 /// Vertical size of the subscript em box in design units, used to 701 /// scale the simulated subscript relative to the full em box size. 702 /// This the numerator of the scaling ratio where denominator is the 703 /// design units per em. If this member is zero, the font does not specify 704 /// a scale factor, and the client should use its own policy. 705 /// </summary> 706 INT16 subscriptSizeY; 707 708 /// <summary> 709 /// Horizontal position of the superscript relative to the baseline origin. 710 /// This is typically positive (to the right) in italic/oblique fonts, and 711 /// zero in regular fonts. 712 /// </summary> 713 INT16 superscriptPositionX; 714 715 /// <summary> 716 /// Vertical position of the superscript relative to the baseline. 717 /// This is typically positive. 718 /// </summary> 719 INT16 superscriptPositionY; 720 721 /// <summary> 722 /// Horizontal size of the superscript em box in design units, used to 723 /// scale the simulated superscript relative to the full em box size. 724 /// This the numerator of the scaling ratio where denominator is the 725 /// design units per em. If this member is zero, the font does not specify 726 /// a scale factor, and the client should use its own policy. 727 /// </summary> 728 INT16 superscriptSizeX; 729 730 /// <summary> 731 /// Vertical size of the superscript em box in design units, used to 732 /// scale the simulated superscript relative to the full em box size. 733 /// This the numerator of the scaling ratio where denominator is the 734 /// design units per em. If this member is zero, the font does not specify 735 /// a scale factor, and the client should use its own policy. 736 /// </summary> 737 INT16 superscriptSizeY; 738 739 /// <summary> 740 /// Indicates that the ascent, descent, and lineGap are based on newer 741 /// 'typographic' values in the font, rather than legacy values. 742 /// </summary> 743 BOOL hasTypographicMetrics; 744 } 745 746 747 /// <summary> 748 /// Metrics for caret placement in a font. 749 /// </summary> 750 struct DWRITE_CARET_METRICS 751 { 752 /// <summary> 753 /// Vertical rise of the caret. Rise / Run yields the caret angle. 754 /// Rise = 1 for perfectly upright fonts (non-italic). 755 /// </summary> 756 INT16 slopeRise; 757 758 /// <summary> 759 /// Horizontal run of th caret. Rise / Run yields the caret angle. 760 /// Run = 0 for perfectly upright fonts (non-italic). 761 /// </summary> 762 INT16 slopeRun; 763 764 /// <summary> 765 /// Horizontal offset of the caret along the baseline for good appearance. 766 /// Offset = 0 for perfectly upright fonts (non-italic). 767 /// </summary> 768 INT16 offset; 769 } 770 771 772 /// <summary> 773 /// Typeface classification values, used for font selection and matching. 774 /// </summary> 775 /// <remarks> 776 /// Note the family type (index 0) is the only stable entry in the 10-byte 777 /// array, as all the following entries can change dynamically depending on 778 /// context of the first field. 779 /// </remarks> 780 union DWRITE_PANOSE 781 { 782 UINT8[10] values; 783 784 UINT8 familyKind; // this is the only field that never changes meaning 785 786 struct text_ 787 { 788 UINT8 familyKind; // = 2 for text 789 UINT8 serifStyle; 790 UINT8 weight; 791 UINT8 proportion; 792 UINT8 contrast; 793 UINT8 strokeVariation; 794 UINT8 armStyle; 795 UINT8 letterform; 796 UINT8 midline; 797 UINT8 xHeight; 798 } 799 text_ text; 800 801 struct script_ 802 { 803 UINT8 familyKind; // = 3 for script 804 UINT8 toolKind; 805 UINT8 weight; 806 UINT8 spacing; 807 UINT8 aspectRatio; 808 UINT8 contrast; 809 UINT8 scriptTopology; 810 UINT8 scriptForm; 811 UINT8 finials; 812 UINT8 xAscent; 813 } 814 script_ script; 815 816 struct decorative_ 817 { 818 UINT8 familyKind; // = 4 for decorative 819 UINT8 decorativeClass; 820 UINT8 weight; 821 UINT8 aspect; 822 UINT8 contrast; 823 UINT8 serifVariant; 824 UINT8 fill; // treatment 825 UINT8 lining; 826 UINT8 decorativeTopology; 827 UINT8 characterRange; 828 } 829 decorative_ decorative; 830 831 struct symbol_ 832 { 833 UINT8 familyKind; // = 5 for symbol 834 UINT8 symbolKind; 835 UINT8 weight; 836 UINT8 spacing; 837 UINT8 aspectRatioAndContrast; // hard coded to no-fit (1) 838 UINT8 aspectRatio94; 839 UINT8 aspectRatio119; 840 UINT8 aspectRatio157; 841 UINT8 aspectRatio163; 842 UINT8 aspectRatio211; 843 } 844 symbol_ symbol; 845 } 846 847 848 /// <summary> 849 /// Range of Unicode codepoints. 850 /// </summary> 851 struct DWRITE_UNICODE_RANGE 852 { 853 /// <summary> 854 /// The first codepoint in the Unicode range. 855 /// </summary> 856 UINT32 first; 857 858 /// <summary> 859 /// The last codepoint in the Unicode range. 860 /// </summary> 861 UINT32 last; 862 } 863 864 865 /// <summary> 866 /// Script-specific properties for caret navigation and justification. 867 /// </summary> 868 struct DWRITE_SCRIPT_PROPERTIES 869 { 870 align(1): 871 /// <summary> 872 /// The standardized four character code for the given script. 873 /// Note these only include the general Unicode scripts, not any 874 /// additional ISO 15924 scripts for bibliographic distinction 875 /// (for example, Fraktur Latin vs Gaelic Latin). 876 /// http://unicode.org/iso15924/iso15924-codes.html 877 /// </summary> 878 UINT32 isoScriptCode; 879 880 /// <summary> 881 /// The standardized numeric code, ranging 0-999. 882 /// http://unicode.org/iso15924/iso15924-codes.html 883 /// </summary> 884 UINT32 isoScriptNumber; 885 886 /// <summary> 887 /// Number of characters to estimate look-ahead for complex scripts. 888 /// Latin and all Kana are generally 1. Indic scripts are up to 15, 889 /// and most others are 8. Note that combining marks and variation 890 /// selectors can produce clusters longer than these look-aheads, 891 /// so this estimate is considered typical language use. Diacritics 892 /// must be tested explicitly separately. 893 /// </summary> 894 UINT32 clusterLookahead; 895 896 /// <summary> 897 /// Appropriate character to elongate the given script for justification. 898 /// 899 /// Examples: 900 /// Arabic - U+0640 Tatweel 901 /// Ogham - U+1680 Ogham Space Mark 902 /// </summary> 903 UINT32 justificationCharacter; 904 905 UINT32 data_; 906 //TODO: add helper properties for data members below 907 908 /* 909 /// <summary> 910 /// Restrict the caret to whole clusters, like Thai and Devanagari. Scripts 911 /// such as Arabic by default allow navigation between clusters. Others 912 /// like Thai always navigate across whole clusters. 913 /// </summary> 914 UINT32 restrictCaretToClusters : 1; 915 916 /// <summary> 917 /// The language uses dividers between words, such as spaces between Latin 918 /// or the Ethiopic wordspace. 919 /// 920 /// Examples: Latin, Greek, Devanagari, Ethiopic 921 /// Excludes: Chinese, Korean, Thai. 922 /// </summary> 923 UINT32 usesWordDividers : 1; 924 925 /// <summary> 926 /// The characters are discrete units from each other. This includes both 927 /// block scripts and clustered scripts. 928 /// 929 /// Examples: Latin, Greek, Cyrillic, Hebrew, Chinese, Thai 930 /// </summary> 931 UINT32 isDiscreteWriting : 1; 932 933 /// <summary> 934 /// The language is a block script, expanding between characters. 935 /// 936 /// Examples: Chinese, Japanese, Korean, Bopomofo. 937 /// </summary> 938 UINT32 isBlockWriting : 1; 939 940 /// <summary> 941 /// The language is justified within glyph clusters, not just between glyph 942 /// clusters. One such as the character sequence is Thai Lu and Sara Am 943 /// (U+E026, U+E033) which form a single cluster but still expand between 944 /// them. 945 /// 946 /// Examples: Thai, Lao, Khmer 947 /// </summary> 948 UINT32 isDistributedWithinCluster : 1; 949 950 /// <summary> 951 /// The script's clusters are connected to each other (such as the 952 /// baseline-linked Devanagari), and no separation should be added 953 /// between characters. Note that cursively linked scripts like Arabic 954 /// are also connected (but not all connected scripts are 955 /// cursive). 956 /// 957 /// Examples: Devanagari, Arabic, Syriac, Bengali, Gurmukhi, Ogham 958 /// Excludes: Latin, Chinese, Thaana 959 /// </summary> 960 UINT32 isConnectedWriting : 1; 961 962 /// <summary> 963 /// The script is naturally cursive (Arabic/Syriac), meaning it uses other 964 /// justification methods like kashida extension rather than intercharacter 965 /// spacing. Note that although other scripts like Latin and Japanese may 966 /// actually support handwritten cursive forms, they are not considered 967 /// cursive scripts. 968 /// 969 /// Examples: Arabic, Syriac, Mongolian 970 /// Excludes: Thaana, Devanagari, Latin, Chinese 971 /// </summary> 972 UINT32 isCursiveWriting : 1; 973 974 UINT32 reserved : 25; 975 */ 976 } 977 978 979 /// <summary> 980 /// Justification information per glyph. 981 /// </summary> 982 struct DWRITE_JUSTIFICATION_OPPORTUNITY 983 { 984 align(1): 985 /// <summary> 986 /// Minimum amount of expansion to apply to the side of the glyph. 987 /// This may vary from 0 to infinity, typically being zero except 988 /// for kashida. 989 /// </summary> 990 FLOAT expansionMinimum; 991 992 /// <summary> 993 /// Maximum amount of expansion to apply to the side of the glyph. 994 /// This may vary from 0 to infinity, being zero for fixed-size characters 995 /// and connected scripts, and non-zero for discrete scripts, and non-zero 996 /// for cursive scripts at expansion points. 997 /// </summary> 998 FLOAT expansionMaximum; 999 1000 /// <summary> 1001 /// Maximum amount of compression to apply to the side of the glyph. 1002 /// This may vary from 0 up to the glyph cluster size. 1003 /// </summary> 1004 FLOAT compressionMaximum; 1005 1006 UINT32 data_; 1007 //TODO: add helper properties for data members below 1008 /* 1009 /// <summary> 1010 /// Priority of this expansion point. Larger priorities are applied later, 1011 /// while priority zero does nothing. 1012 /// </summary> 1013 UINT32 expansionPriority : 8; 1014 1015 /// <summary> 1016 /// Priority of this compression point. Larger priorities are applied later, 1017 /// while priority zero does nothing. 1018 /// </summary> 1019 UINT32 compressionPriority : 8; 1020 1021 /// <summary> 1022 /// Allow this expansion point to use up any remaining slack space even 1023 /// after all expansion priorities have been used up. 1024 /// </summary> 1025 UINT32 allowResidualExpansion : 1; 1026 1027 /// <summary> 1028 /// Allow this compression point to use up any remaining space even after 1029 /// all compression priorities have been used up. 1030 /// </summary> 1031 UINT32 allowResidualCompression : 1; 1032 1033 /// <summary> 1034 /// Apply expansion/compression to the leading edge of the glyph. This will 1035 /// be false for connected scripts, fixed-size characters, and diacritics. 1036 /// It is generally false within a multi-glyph cluster, unless the script 1037 /// allows expansion of glyphs within a cluster, like Thai. 1038 /// </summary> 1039 UINT32 applyToLeadingEdge : 1; 1040 1041 /// <summary> 1042 /// Apply expansion/compression to the trailing edge of the glyph. This will 1043 /// be false for connected scripts, fixed-size characters, and diacritics. 1044 /// It is generally false within a multi-glyph cluster, unless the script 1045 /// allows expansion of glyphs within a cluster, like Thai. 1046 /// </summary> 1047 UINT32 applyToTrailingEdge : 1; 1048 1049 UINT32 reserved : 12; 1050 */ 1051 } 1052 1053 1054 1055 1056 /// <summary> 1057 /// The root factory interface for all DWrite objects. 1058 /// </summary> 1059 mixin( uuid!(IDWriteFactory1, "30572f99-dac6-41db-a16e-0486307e606a") ); 1060 interface IDWriteFactory1 : IDWriteFactory 1061 { 1062 extern(Windows): 1063 /// <summary> 1064 /// Gets a font collection representing the set of end-user defined 1065 /// custom fonts. 1066 /// </summary> 1067 /// <param name="fontCollection">Receives a pointer to the EUDC font 1068 /// collection object, or NULL in case of failure.</param> 1069 /// <param name="checkForUpdates">If this parameter is nonzero, the 1070 /// function performs an immediate check for changes to the set of 1071 /// EUDC fonts. If this parameter is FALSE, the function will still 1072 /// detect changes, but there may be some latency. For example, an 1073 /// application might specify TRUE if it has itself just modified a 1074 /// font and wants to be sure the font collection contains that font. 1075 /// </param> 1076 /// <returns> 1077 /// Standard HRESULT error code. Note that if no EUDC is set on the system, 1078 /// the returned collection will be empty, meaning it will return success 1079 /// but GetFontFamilyCount will be zero. 1080 /// </returns> 1081 /// <remarks> 1082 /// Querying via IDWriteFontCollection::FindFamilyName for a specific 1083 /// family (like MS Gothic) will return the matching family-specific EUDC 1084 /// font if one exists. Querying for "" will return the global EUDC font. 1085 /// For example, if you were matching an EUDC character within a run of 1086 /// the base font PMingLiu, you would retrieve the corresponding EUDC font 1087 /// face using GetEudcFontCollection, then FindFamilyName with "PMingLiu", 1088 /// followed by GetFontFamily and CreateFontFace. 1089 /// 1090 /// Be aware that eudcedit.exe can create placeholder empty glyphs that 1091 /// have zero advance width and no glyph outline. Although they are present 1092 /// in the font (HasCharacter returns true), you are best to ignore 1093 /// these and continue on with font fallback in your layout if the metrics 1094 /// for the glyph are zero. 1095 /// </remarks> 1096 HRESULT GetEudcFontCollection( 1097 /*out*/ IDWriteFontCollection* fontCollection, 1098 BOOL checkForUpdates = FALSE 1099 ); 1100 1101 /// <summary> 1102 /// Creates a rendering parameters object with the specified properties. 1103 /// </summary> 1104 /// <param name="gamma">The gamma value used for gamma correction, which must be greater than zero and cannot exceed 256.</param> 1105 /// <param name="enhancedContrast">The amount of contrast enhancement, zero or greater.</param> 1106 /// <param name="enhancedContrastGrayscale">The amount of contrast enhancement to use for grayscale antialiasing, zero or greater.</param> 1107 /// <param name="clearTypeLevel">The degree of ClearType level, from 0.0f (no ClearType) to 1.0f (full ClearType).</param> 1108 /// <param name="pixelGeometry">The geometry of a device pixel.</param> 1109 /// <param name="renderingMode">Method of rendering glyphs. In most cases, this should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode.</param> 1110 /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param> 1111 /// <returns> 1112 /// Standard HRESULT error code. 1113 /// </returns> 1114 HRESULT CreateCustomRenderingParams( 1115 FLOAT gamma, 1116 FLOAT enhancedContrast, 1117 FLOAT enhancedContrastGrayscale, 1118 FLOAT clearTypeLevel, 1119 DWRITE_PIXEL_GEOMETRY pixelGeometry, 1120 DWRITE_RENDERING_MODE renderingMode, 1121 /*out*/ IDWriteRenderingParams1* renderingParams 1122 ); 1123 1124 //using IDWriteFactory::CreateCustomRenderingParams; 1125 } 1126 1127 1128 /// <summary> 1129 /// The interface that represents an absolute reference to a font face. 1130 /// It contains font face type, appropriate file references and face identification data. 1131 /// Various font data such as metrics, names and glyph outlines is obtained from IDWriteFontFace. 1132 /// </summary> 1133 mixin( uuid!(IDWriteFontFace1, "a71efdb4-9fdb-4838-ad90-cfc3be8c3daf") ); 1134 interface IDWriteFontFace1 : IDWriteFontFace 1135 { 1136 extern(Windows): 1137 /// <summary> 1138 /// Gets common metrics for the font in design units. 1139 /// These metrics are applicable to all the glyphs within a font, 1140 /// and are used by applications for layout calculations. 1141 /// </summary> 1142 /// <param name="fontMetrics">Metrics structure to fill in.</param> 1143 void GetMetrics( 1144 /*out*/ DWRITE_FONT_METRICS1* fontMetrics 1145 ); 1146 1147 /// <summary> 1148 /// Gets common metrics for the font in design units. 1149 /// These metrics are applicable to all the glyphs within a font, 1150 /// and are used by applications for layout calculations. 1151 /// </summary> 1152 /// <param name="emSize">Logical size of the font in DIP units. A DIP 1153 /// ("device-independent pixel") equals 1/96 inch.</param> 1154 /// <param name="pixelsPerDip">Number of physical pixels per DIP. For 1155 /// example, if the DPI of the rendering surface is 96 this value is 1156 /// 1.0f. If the DPI is 120, this value is 120.0f/96.</param> 1157 /// <param name="transform">Optional transform applied to the glyphs and 1158 /// their positions. This transform is applied after the scaling 1159 /// specified by the font size and pixelsPerDip.</param> 1160 /// <param name="fontMetrics">Font metrics structure to fill in.</param> 1161 /// <returns> 1162 /// Standard HRESULT error code. 1163 /// </returns> 1164 HRESULT GetGdiCompatibleMetrics( 1165 FLOAT emSize, 1166 FLOAT pixelsPerDip, 1167 const(DWRITE_MATRIX)* transform, 1168 /*out*/ DWRITE_FONT_METRICS1* fontMetrics 1169 ); 1170 1171 /// <summary> 1172 /// Gets caret metrics for the font in design units. These are used by 1173 /// text editors for drawing the correct caret placement/slant. 1174 /// </summary> 1175 /// <param name="caretMetrics">Metrics structure to fill in.</param> 1176 void GetCaretMetrics( 1177 /*out*/ DWRITE_CARET_METRICS* caretMetrics 1178 ); 1179 1180 /// <summary> 1181 /// Returns the list of character ranges supported by the font, which is 1182 /// useful for scenarios like character picking, glyph display, and 1183 /// efficient font selection lookup. This is similar to GDI's 1184 /// GetFontUnicodeRanges, except that it returns the full Unicode range, 1185 /// not just 16-bit UCS-2. 1186 /// </summary> 1187 /// <param name="maxRangeCount">Maximum number of character ranges passed 1188 /// in from the client.</param> 1189 /// <param name="unicodeRanges">Array of character ranges.</param> 1190 /// <param name="actualRangeCount">Actual number of character ranges, 1191 /// regardless of the maximum count.</param> 1192 /// <remarks> 1193 /// These ranges are from the cmap, not the OS/2::ulCodePageRange1. 1194 /// </remarks> 1195 /// <returns> 1196 /// Standard HRESULT error code. 1197 /// </returns> 1198 HRESULT GetUnicodeRanges( 1199 UINT32 maxRangeCount, 1200 /*out*/ DWRITE_UNICODE_RANGE* unicodeRanges, 1201 /*out*/ UINT32* actualRangeCount 1202 ); 1203 1204 /// <summary> 1205 /// Returns true if the font is monospaced, meaning its characters are the 1206 /// same fixed-pitch width (non-proportional). 1207 /// </summary> 1208 BOOL IsMonospacedFont(); 1209 1210 /// <summary> 1211 /// Returns the advances in design units for a sequences of glyphs. 1212 /// </summary> 1213 /// <param name="glyphCount">Number of glyphs to retrieve advances for.</param> 1214 /// <param name="glyphIndices">Array of glyph id's to retrieve advances for.</param> 1215 /// <param name="glyphAdvances">Returned advances in font design units for 1216 /// each glyph.</param> 1217 /// <param name="isSideways">Retrieve the glyph's vertical advance height 1218 /// rather than horizontal advance widths.</param> 1219 /// <remarks> 1220 /// This is equivalent to calling GetGlyphMetrics and using only the 1221 /// advance width/height. 1222 /// </remarks> 1223 /// <returns> 1224 /// Standard HRESULT error code. 1225 /// </returns> 1226 HRESULT GetDesignGlyphAdvances( 1227 UINT32 glyphCount, 1228 const(UINT16)* glyphIndices, 1229 /*out*/ INT32* glyphAdvances, 1230 BOOL isSideways = FALSE 1231 ); 1232 1233 /// <summary> 1234 /// Returns the pixel-aligned advances for a sequences of glyphs, the same 1235 /// as GetGdiCompatibleGlyphMetrics would return. 1236 /// </summary> 1237 /// <param name="emSize">Logical size of the font in DIP units. A DIP 1238 /// ("device-independent pixel") equals 1/96 inch.</param> 1239 /// <param name="pixelsPerDip">Number of physical pixels per DIP. For 1240 /// example, if the DPI of the rendering surface is 96 this value is 1241 /// 1.0f. If the DPI is 120, this value is 120.0f/96.</param> 1242 /// <param name="transform">Optional transform applied to the glyphs and 1243 /// their positions. This transform is applied after the scaling 1244 /// specified by the font size and pixelsPerDip.</param> 1245 /// <param name="useGdiNatural">When FALSE, the metrics are the same as 1246 /// GDI aliased text (DWRITE_MEASURING_MODE_GDI_CLASSIC). When TRUE, 1247 /// the metrics are the same as those measured by GDI using a font 1248 /// using CLEARTYPE_NATURAL_QUALITY (DWRITE_MEASURING_MODE_GDI_NATURAL).</param> 1249 /// <param name="isSideways">Retrieve the glyph's vertical advances rather 1250 /// than horizontal advances.</param> 1251 /// <param name="glyphCount">Total glyphs to retrieve adjustments for.</param> 1252 /// <param name="glyphIndices">Array of glyph id's to retrieve advances.</param> 1253 /// <param name="glyphAdvances">Returned advances in font design units for 1254 /// each glyph.</param> 1255 /// <remarks> 1256 /// This is equivalent to calling GetGdiCompatibleGlyphMetrics and using only 1257 /// the advance width/height. Like GetGdiCompatibleGlyphMetrics, these are in 1258 /// design units, meaning they must be scaled down by 1259 /// DWRITE_FONT_METRICS::designUnitsPerEm. 1260 /// </remarks> 1261 /// <returns> 1262 /// Standard HRESULT error code. 1263 /// </returns> 1264 HRESULT GetGdiCompatibleGlyphAdvances( 1265 FLOAT emSize, 1266 FLOAT pixelsPerDip, 1267 const(DWRITE_MATRIX)* transform, 1268 BOOL useGdiNatural, 1269 BOOL isSideways, 1270 UINT32 glyphCount, 1271 const(UINT16)* glyphIndices, 1272 /*out*/ INT32* glyphAdvances 1273 ); 1274 1275 /// <summary> 1276 /// Retrieves the kerning pair adjustments from the font's kern table. 1277 /// </summary> 1278 /// <param name="glyphCount">Number of glyphs to retrieve adjustments for.</param> 1279 /// <param name="glyphIndices">Array of glyph id's to retrieve adjustments 1280 /// for.</param> 1281 /// <param name="glyphAdvanceAdjustments">Returned advances in font design units for 1282 /// each glyph. The last glyph adjustment is zero.</param> 1283 /// <remarks> 1284 /// This is not a direct replacement for GDI's character based 1285 /// GetKerningPairs, but it serves the same role, without the client 1286 /// needing to cache them locally. It also uses glyph id's directly 1287 /// rather than UCS-2 characters (how the kern table actually stores 1288 /// them) which avoids glyph collapse and ambiguity, such as the dash 1289 /// and hyphen, or space and non-breaking space. 1290 /// </remarks> 1291 /// <remarks> 1292 /// Newer fonts may have only GPOS kerning instead of the legacy pair 1293 /// table kerning. Such fonts, like Gabriola, will only return 0's for 1294 /// adjustments. This function does not virtualize and flatten these 1295 /// GPOS entries into kerning pairs. 1296 /// </remarks> 1297 /// <returns> 1298 /// Standard HRESULT error code. 1299 /// </returns> 1300 HRESULT GetKerningPairAdjustments( 1301 UINT32 glyphCount, 1302 const(UINT16)* glyphIndices, 1303 /*out*/ INT32* glyphAdvanceAdjustments 1304 ); 1305 1306 /// <summary> 1307 /// Returns whether or not the font supports pair-kerning. 1308 /// </summary> 1309 /// <remarks> 1310 /// If the font does not support pair table kerning, there is no need to 1311 /// call GetKerningPairAdjustments (it would be all zeroes). 1312 /// </remarks> 1313 /// <returns> 1314 /// Whether the font supports kerning pairs. 1315 /// </returns> 1316 BOOL HasKerningPairs(); 1317 1318 /// <summary> 1319 /// Determines the recommended text rendering mode to be used based on the 1320 /// font, size, world transform, and measuring mode. 1321 /// </summary> 1322 /// <param name="fontEmSize">Logical font size in DIPs.</param> 1323 /// <param name="dpiX">Number of pixels per logical inch in the horizontal direction.</param> 1324 /// <param name="dpiY">Number of pixels per logical inch in the vertical direction.</param> 1325 /// <param name="transform">Specifies the world transform.</param> 1326 /// <param name="outlineThreshold">Specifies the quality of the graphics system's outline rendering, 1327 /// affects the size threshold above which outline rendering is used.</param> 1328 /// <param name="measuringMode">Specifies the method used to measure during text layout. For proper 1329 /// glyph spacing, the function returns a rendering mode that is compatible with the specified 1330 /// measuring mode.</param> 1331 /// <param name="renderingMode">Receives the recommended rendering mode.</param> 1332 /// <remarks> 1333 /// This method should be used to determine the actual rendering mode in cases where the rendering 1334 /// mode of the rendering params object is DWRITE_RENDERING_MODE_DEFAULT. 1335 /// </remarks> 1336 /// <returns> 1337 /// Standard HRESULT error code. 1338 /// </returns> 1339 HRESULT GetRecommendedRenderingMode( 1340 FLOAT fontEmSize, 1341 FLOAT dpiX, 1342 FLOAT dpiY, 1343 const(DWRITE_MATRIX)* transform, 1344 BOOL isSideways, 1345 DWRITE_OUTLINE_THRESHOLD outlineThreshold, 1346 DWRITE_MEASURING_MODE measuringMode, 1347 /*out*/ DWRITE_RENDERING_MODE* renderingMode 1348 ); 1349 1350 /// <summary> 1351 /// Retrieves the vertical forms of the nominal glyphs retrieved from 1352 /// GetGlyphIndices, using the font's 'vert' table. This is used in 1353 /// CJK vertical layout so the correct characters are shown. 1354 /// </summary> 1355 /// <param name="glyphCount">Number of glyphs to retrieve.</param> 1356 /// <param name="nominalGlyphIndices">Original glyph indices from cmap.</param> 1357 /// <param name="verticalGlyphIndices">The vertical form of glyph indices.</param> 1358 /// <remarks> 1359 /// Call GetGlyphIndices to get the nominal glyph indices, followed by 1360 /// calling this to remap the to the substituted forms, when the run 1361 /// is sideways, and the font has vertical glyph variants. 1362 /// </remarks> 1363 /// <returns> 1364 /// Standard HRESULT error code. 1365 /// </returns> 1366 HRESULT GetVerticalGlyphVariants( 1367 UINT32 glyphCount, 1368 const(UINT16)* nominalGlyphIndices, 1369 /*out*/ UINT16* verticalGlyphIndices 1370 ); 1371 1372 /// <summary> 1373 /// Returns whether or not the font has any vertical glyph variants. 1374 /// </summary> 1375 /// <remarks> 1376 /// For OpenType fonts, this will return true if the font contains a 'vert' 1377 /// feature. 1378 /// </remarks> 1379 /// <returns> 1380 /// True if the font contains vertical glyph variants. 1381 /// </returns> 1382 BOOL HasVerticalGlyphVariants(); 1383 } 1384 1385 1386 /// <summary> 1387 /// The IDWriteFont interface represents a physical font in a font collection. 1388 /// </summary> 1389 mixin( uuid!(IDWriteFont1, "acd16696-8c14-4f5d-877e-fe3fc1d32738") ); 1390 interface IDWriteFont1 : IDWriteFont 1391 { 1392 extern(Windows): 1393 /// <summary> 1394 /// Gets common metrics for the font in design units. 1395 /// These metrics are applicable to all the glyphs within a font, 1396 /// and are used by applications for layout calculations. 1397 /// </summary> 1398 /// <param name="fontMetrics">Metrics structure to fill in.</param> 1399 void GetMetrics( 1400 /*out*/ DWRITE_FONT_METRICS1* fontMetrics 1401 ); 1402 1403 /// <summary> 1404 /// Gets the PANOSE values from the font, used for font selection and 1405 /// matching. 1406 /// </summary> 1407 /// <param name="panose">PANOSE structure to fill in.</param> 1408 /// <remarks> 1409 /// The function does not simulate these, such as substituting a weight or 1410 /// proportion inferred on other values. If the font does not specify them, 1411 /// they are all set to 'any' (0). 1412 /// </remarks> 1413 void GetPanose( 1414 /*out*/ DWRITE_PANOSE* panose 1415 ); 1416 1417 /// <summary> 1418 /// Returns the list of character ranges supported by the font, which is 1419 /// useful for scenarios like character picking, glyph display, and 1420 /// efficient font selection lookup. This is similar to GDI's 1421 /// GetFontUnicodeRanges, except that it returns the full Unicode range, 1422 /// not just 16-bit UCS-2. 1423 /// </summary> 1424 /// <param name="maxRangeCount">Maximum number of character ranges passed 1425 /// in from the client.</param> 1426 /// <param name="unicodeRanges">Array of character ranges.</param> 1427 /// <param name="actualRangeCount">Actual number of character ranges, 1428 /// regardless of the maximum count.</param> 1429 /// <remarks> 1430 /// These ranges are from the cmap, not the OS/2::ulCodePageRange1. 1431 /// </remarks> 1432 /// <returns> 1433 /// Standard HRESULT error code. 1434 /// </returns> 1435 HRESULT GetUnicodeRanges( 1436 UINT32 maxRangeCount, 1437 /*out*/ DWRITE_UNICODE_RANGE* unicodeRanges, 1438 /*out*/ UINT32* actualRangeCount 1439 ); 1440 1441 /// <summary> 1442 /// Returns true if the font is monospaced, meaning its characters are the 1443 /// same fixed-pitch width (non-proportional). 1444 /// </summary> 1445 BOOL IsMonospacedFont(); 1446 } 1447 1448 /// <summary> 1449 /// The interface that represents text rendering settings for glyph rasterization and filtering. 1450 /// </summary> 1451 mixin( uuid!(IDWriteRenderingParams1, "94413cf4-a6fc-4248-8b50-6674348fcad3") ); 1452 interface IDWriteRenderingParams1 : IDWriteRenderingParams 1453 { 1454 extern(Windows): 1455 /// <summary> 1456 /// Gets the amount of contrast enhancement to use for grayscale antialiasing. 1457 /// Valid values are greater than or equal to zero. 1458 /// </summary> 1459 FLOAT GetGrayscaleEnhancedContrast(); 1460 } 1461 1462 /// <summary> 1463 /// Analyzes various text properties for complex script processing. 1464 /// </summary> 1465 mixin( uuid!(IDWriteTextAnalyzer1, "80DAD800-E21F-4E83-96CE-BFCCE500DB7C") ); 1466 interface IDWriteTextAnalyzer1 : IDWriteTextAnalyzer 1467 { 1468 extern(Windows): 1469 /// <summary> 1470 /// Applies spacing between characters, properly adjusting glyph clusters 1471 /// and diacritics. 1472 /// </summary> 1473 /// <param name="leadingSpacing">The spacing before each character, in reading order.</param> 1474 /// <param name="trailingSpacing">The spacing after each character, in reading order.</param> 1475 /// <param name="minimumAdvanceWidth">The minimum advance of each character, 1476 /// to prevent characters from becoming too thin or zero-width. This 1477 /// must be zero or greater.</param> 1478 /// <param name="textLength">The length of the clustermap and original text.</param> 1479 /// <param name="glyphCount">The number of glyphs.</param> 1480 /// <param name="clusterMap">Mapping from character ranges to glyph ranges.</param> 1481 /// <param name="glyphAdvances">The advance width of each glyph.</param> 1482 /// <param name="glyphOffsets">The offset of the origin of each glyph.</param> 1483 /// <param name="glyphProperties">Properties of each glyph, from GetGlyphs.</param> 1484 /// <param name="modifiedGlyphAdvances">The new advance width of each glyph.</param> 1485 /// <param name="modifiedGlyphOffsets">The new offset of the origin of each glyph.</param> 1486 /// <remarks> 1487 /// The input and output advances/offsets are allowed to alias the same array. 1488 /// </remarks> 1489 /// <returns> 1490 /// Standard HRESULT error code. 1491 /// </returns> 1492 HRESULT ApplyCharacterSpacing( 1493 FLOAT leadingSpacing, 1494 FLOAT trailingSpacing, 1495 FLOAT minimumAdvanceWidth, 1496 UINT32 textLength, 1497 UINT32 glyphCount, 1498 const(UINT16)* clusterMap, 1499 const(FLOAT)* glyphAdvances, 1500 const(DWRITE_GLYPH_OFFSET)* glyphOffsets, 1501 const(DWRITE_SHAPING_GLYPH_PROPERTIES)* glyphProperties, 1502 /*out*/ FLOAT* modifiedGlyphAdvances, 1503 /*out*/ DWRITE_GLYPH_OFFSET* modifiedGlyphOffsets 1504 ); 1505 1506 /// <summary> 1507 /// Retrieves the given baseline from the font. 1508 /// </summary> 1509 /// <param name="fontFace">The font face to read.</param> 1510 /// <param name="baseline">The baseline of interest.</param> 1511 /// <param name="isVertical">Whether the baseline is vertical or horizontal.</param> 1512 /// <param name="isSimulationAllowed">Simulate the baseline if it is missing in the font.</param> 1513 /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param> 1514 /// <param name="localeName">The language of the run.</param> 1515 /// <param name="baselineCoordinate">The baseline coordinate value in design units.</param> 1516 /// <param name="exists">Whether the returned baseline exists in the font.</param> 1517 /// <remarks> 1518 /// If the baseline does not exist in the font, it is not considered an 1519 /// error, but the function will return exists = false. You may then use 1520 /// heuristics to calculate the missing base, or, if the flag 1521 /// simulationAllowed is true, the function will compute a reasonable 1522 /// approximation for you. 1523 /// </remarks> 1524 /// <returns> 1525 /// Standard HRESULT error code. 1526 /// </returns> 1527 HRESULT GetBaseline( 1528 IDWriteFontFace fontFace, 1529 DWRITE_BASELINE baseline, 1530 BOOL isVertical, 1531 BOOL isSimulationAllowed, 1532 DWRITE_SCRIPT_ANALYSIS scriptAnalysis, 1533 const(WCHAR)* localeName, 1534 /*out*/ INT32* baselineCoordinate, 1535 /*out*/ BOOL* exists 1536 ); 1537 1538 /// <summary> 1539 /// Analyzes a text range for script orientation, reading text and 1540 /// attributes from the source and reporting results to the sink. 1541 /// </summary> 1542 /// <param name="analysisSource">Source object to analyze.</param> 1543 /// <param name="textPosition">Starting position within the source object.</param> 1544 /// <param name="textLength">Length to analyze.</param> 1545 /// <param name="analysisSink">Callback object.</param> 1546 /// <returns> 1547 /// Standard HRESULT error code. 1548 /// </returns> 1549 /// <remarks> 1550 /// All bidi analysis should be resolved before calling this. 1551 /// </remarks> 1552 HRESULT AnalyzeVerticalGlyphOrientation( 1553 IDWriteTextAnalysisSource1 analysisSource, 1554 UINT32 textPosition, 1555 UINT32 textLength, 1556 IDWriteTextAnalysisSink1 analysisSink 1557 ); 1558 1559 /// <summary> 1560 /// Returns 2x3 transform matrix for the respective angle to draw the 1561 /// glyph run. 1562 /// </summary> 1563 /// <param name="glyphOrientationAngle">The angle reported into 1564 /// SetGlyphOrientation.</param> 1565 /// <param name="isSideways">Whether the run's glyphs are sideways or not.</param> 1566 /// <param name="transform">Returned transform.</param> 1567 /// </remarks> 1568 /// <returns> 1569 /// Standard HRESULT error code. 1570 /// </returns> 1571 /// <remarks> 1572 /// The returned displacement is zero. 1573 /// </remarks> 1574 HRESULT GetGlyphOrientationTransform( 1575 DWRITE_GLYPH_ORIENTATION_ANGLE glyphOrientationAngle, 1576 BOOL isSideways, 1577 /*out*/ DWRITE_MATRIX* transform 1578 ); 1579 1580 /// <summary> 1581 /// Returns the properties for a given script. 1582 /// </summary> 1583 /// <param name="scriptAnalysis">The script for a run of text returned 1584 /// from IDWriteTextAnalyzer::AnalyzeScript.</param> 1585 /// <param name="scriptProperties">Information for the script.</param> 1586 /// <returns> 1587 /// Returns properties for the given script. If the script is invalid, 1588 /// it returns generic properties for the unknown script and E_INVALIDARG. 1589 /// </returns> 1590 HRESULT GetScriptProperties( 1591 DWRITE_SCRIPT_ANALYSIS scriptAnalysis, 1592 /*out*/ DWRITE_SCRIPT_PROPERTIES* scriptProperties 1593 ); 1594 1595 /// <summary> 1596 /// Determines the complexity of text, and whether or not full script 1597 /// shaping needs to be called (GetGlyphs). 1598 /// </summary> 1599 /// <param name="fontFace">The font face to read.</param> 1600 /// <param name="textLength">Length of the text to check.</param> 1601 /// <param name="textString">The text to check for complexity. This string 1602 /// may be UTF-16, but any supplementary characters will be considered 1603 /// complex.</param> 1604 /// <param name="isTextSimple">If true, the text is simple, and the 1605 /// glyphIndices array will already have the nominal glyphs for you. 1606 /// Otherwise you need to call GetGlyphs to properly shape complex 1607 /// scripts and OpenType features. 1608 /// </param> 1609 /// <param name="textLengthRead">The length read of the text run with the 1610 /// same complexity, simple or complex. You may call again from that 1611 /// point onward.</param> 1612 /// <param name="glyphIndices">Optional glyph indices for the text. If the 1613 /// function returned that the text was simple, you already have the 1614 /// glyphs you need. Otherwise the glyph indices are not meaningful, 1615 /// and you should call shaping instead.</param> 1616 /// <remarks> 1617 /// Text is not simple if the characters are part of a script that has 1618 /// complex shaping requirements, require bidi analysis, combine with 1619 /// other characters, reside in the supplementary planes, or have glyphs 1620 /// which participate in standard OpenType features. The length returned 1621 /// will not split combining marks from their base characters. 1622 /// </remarks> 1623 /// <returns> 1624 /// Standard HRESULT error code. 1625 /// </returns> 1626 HRESULT GetTextComplexity( 1627 const(WCHAR)* textString, 1628 UINT32 textLength, 1629 IDWriteFontFace fontFace, 1630 /*out*/ BOOL* isTextSimple, 1631 /*out*/ UINT32* textLengthRead, 1632 /*out*/ UINT16* glyphIndices 1633 ); 1634 1635 /// <summary> 1636 /// Retrieves justification opportunity information for each of the glyphs 1637 /// given the text and shaping glyph properties. 1638 /// </summary> 1639 /// <param name="fontFace">Font face that was used for shaping. This is 1640 /// mainly important for returning correct results of the kashida 1641 /// width.</param> 1642 /// <param name="fontEmSize">Font em size used for the glyph run.</param> 1643 /// <param name="scriptAnalysis">Script of the text from the itemizer.</param> 1644 /// <param name="textLength">Length of the text.</param> 1645 /// <param name="glyphCount">Number of glyphs.</param> 1646 /// <param name="textString">Characters used to produce the glyphs.</param> 1647 /// <param name="clusterMap">Clustermap produced from shaping.</param> 1648 /// <param name="glyphProperties">Glyph properties produced from shaping.</param> 1649 /// <param name="justificationOpportunities">Receives information for the 1650 /// allowed justification expansion/compression for each glyph.</param> 1651 /// <remarks> 1652 /// This function is called per-run, after shaping is done via GetGlyphs(). 1653 /// Note this function only supports natural metrics (DWRITE_MEASURING_MODE_NATURAL). 1654 /// </remarks> 1655 /// <returns> 1656 /// Standard HRESULT error code. 1657 /// </returns> 1658 HRESULT GetJustificationOpportunities( 1659 IDWriteFontFace fontFace, 1660 FLOAT fontEmSize, 1661 DWRITE_SCRIPT_ANALYSIS scriptAnalysis, 1662 UINT32 textLength, 1663 UINT32 glyphCount, 1664 const(WCHAR)* textString, 1665 const(UINT16)* clusterMap, 1666 const(DWRITE_SHAPING_GLYPH_PROPERTIES)* glyphProperties, 1667 /*out*/ DWRITE_JUSTIFICATION_OPPORTUNITY* justificationOpportunities 1668 ); 1669 1670 /// <summary> 1671 /// Justifies an array of glyph advances to fit the line width. 1672 /// </summary> 1673 /// <param name="lineWidth">Width of the line.</param> 1674 /// <param name="glyphCount">Number of glyphs.</param> 1675 /// <param name="justificationOpportunities">Opportunities per glyph. Call 1676 /// GetJustificationOpportunities() to get suitable opportunities 1677 /// according to script.</param> 1678 /// <param name="glyphAdvances">Original glyph advances from shaping.</param> 1679 /// <param name="glyphOffsets">Original glyph offsets from shaping.</param> 1680 /// <param name="justifiedGlyphAdvances">Justified glyph advances.</param> 1681 /// <param name="justifiedGlyphOffsets">Justified glyph offsets.</param> 1682 /// <remarks> 1683 /// This is called after all the opportunities have been collected, and it 1684 /// spans across the entire line. The input and output arrays are allowed 1685 /// to alias each other, permitting in-place update. 1686 /// </remarks> 1687 /// <returns> 1688 /// Standard HRESULT error code. 1689 /// </returns> 1690 HRESULT JustifyGlyphAdvances( 1691 FLOAT lineWidth, 1692 UINT32 glyphCount, 1693 const(DWRITE_JUSTIFICATION_OPPORTUNITY)* justificationOpportunities, 1694 const(FLOAT)* glyphAdvances, 1695 const(DWRITE_GLYPH_OFFSET)* glyphOffsets, 1696 /*out*/ FLOAT* justifiedGlyphAdvances, 1697 /*out*/ DWRITE_GLYPH_OFFSET* justifiedGlyphOffsets 1698 ); 1699 1700 /// <summary> 1701 /// Fills in new glyphs for complex scripts where justification increased 1702 /// the advances of glyphs, such as Arabic with kashida. 1703 /// </summary> 1704 /// <param name="fontFace">Font face used for shaping.</param> 1705 /// <param name="fontEmSize">Font em size used for the glyph run.</param> 1706 /// <param name="scriptAnalysis">Script of the text from the itemizer.</param> 1707 /// <param name="textLength">Length of the text.</param> 1708 /// <param name="glyphCount">Number of glyphs.</param> 1709 /// <param name="maxGlyphCount">Maximum number of output glyphs allocated 1710 /// by caller.</param> 1711 /// <param name="clusterMap">Clustermap produced from shaping.</param> 1712 /// <param name="glyphIndices">Original glyphs produced from shaping.</param> 1713 /// <param name="glyphAdvances">Original glyph advances produced from shaping.</param> 1714 /// <param name="justifiedGlyphAdvances">Justified glyph advances from 1715 /// JustifyGlyphAdvances().</param> 1716 /// <param name="justifiedGlyphOffsets">Justified glyph offsets from 1717 /// JustifyGlyphAdvances().</param> 1718 /// <param name="glyphProperties">Properties of each glyph, from GetGlyphs.</param> 1719 /// <param name="actualGlyphCount">The new glyph count written to the 1720 /// modified arrays, or the needed glyph count if the size is not 1721 /// large enough.</param> 1722 /// <param name="modifiedClusterMap">Updated clustermap.</param> 1723 /// <param name="modifiedGlyphIndices">Updated glyphs with new glyphs 1724 /// inserted where needed.</param> 1725 /// <param name="modifiedGlyphAdvances">Updated glyph advances.</param> 1726 /// <param name="modifiedGlyphOffsets">Updated glyph offsets.</param> 1727 /// <remarks> 1728 /// This is called after the line has been justified, and it is per-run. 1729 /// It only needs to be called if the script has a specific justification 1730 /// character via GetScriptProperties, and it is mainly for cursive scripts 1731 /// like Arabic. If maxGlyphCount is not large enough, the error 1732 /// E_NOT_SUFFICIENT_BUFFER will be returned, with actualGlyphCount holding 1733 /// the final/needed glyph count. 1734 /// </remarks> 1735 /// <returns> 1736 /// Standard HRESULT error code. 1737 /// </returns> 1738 HRESULT GetJustifiedGlyphs( 1739 IDWriteFontFace fontFace, 1740 FLOAT fontEmSize, 1741 DWRITE_SCRIPT_ANALYSIS scriptAnalysis, 1742 UINT32 textLength, 1743 UINT32 glyphCount, 1744 UINT32 maxGlyphCount, 1745 const(UINT16)* clusterMap, 1746 const(UINT16)* glyphIndices, 1747 const(FLOAT)* glyphAdvances, 1748 const(FLOAT)* justifiedGlyphAdvances, 1749 const(DWRITE_GLYPH_OFFSET)* justifiedGlyphOffsets, 1750 const(DWRITE_SHAPING_GLYPH_PROPERTIES)* glyphProperties, 1751 /*out*/ UINT32* actualGlyphCount, 1752 /*out*/ UINT16* modifiedClusterMap, 1753 /*out*/ UINT16* modifiedGlyphIndices, 1754 /*out*/ FLOAT* modifiedGlyphAdvances, 1755 /*out*/ DWRITE_GLYPH_OFFSET* modifiedGlyphOffsets 1756 ); 1757 } 1758 1759 1760 /// <summary> 1761 /// The interface implemented by the client to provide needed information to 1762 /// the text analyzer, such as the text and associated text properties. 1763 /// If any of these callbacks returns an error, the analysis functions will 1764 /// stop prematurely and return a callback error. 1765 /// </summary> 1766 mixin( uuid!(IDWriteTextAnalysisSource1, "639CFAD8-0FB4-4B21-A58A-067920120009") ); 1767 interface IDWriteTextAnalysisSource1 : IDWriteTextAnalysisSource 1768 { 1769 extern(Windows): 1770 /// <summary> 1771 /// The text analyzer calls back to this to get the desired glyph 1772 /// orientation and resolved bidi level, which it uses along with the 1773 /// script properties of the text to determine the actual orientation of 1774 /// each character, which it reports back to the client via the sink 1775 /// SetGlyphOrientation method. 1776 /// </summary> 1777 /// <param name="textPosition">First position of the piece to obtain. All 1778 /// positions are in UTF-16 code-units, not whole characters, which 1779 /// matters when supplementary characters are used.</param> 1780 /// <param name="textLength">Number of UTF-16 units of the retrieved chunk. 1781 /// The returned length is not the length of the block, but the length 1782 /// remaining in the block, from the given position until its end. 1783 /// So querying for a position that is 75 positions into a 100 1784 /// postition block would return 25.</param> 1785 /// <param name="glyphOrientation">The type of glyph orientation the 1786 /// client wants for this range, up to the returned text length.</param> 1787 /// <param name="bidiLevel">The bidi level for this range up to 1788 /// the returned text length, which comes from an earlier 1789 /// bidirectional analysis.</param> 1790 /// <returns> 1791 /// Standard HRESULT error code. Returning an error will abort the 1792 /// analysis. 1793 /// </returns> 1794 HRESULT GetVerticalGlyphOrientation( 1795 UINT32 textPosition, 1796 /*out*/ UINT32* textLength, 1797 /*out*/ DWRITE_VERTICAL_GLYPH_ORIENTATION* glyphOrientation, 1798 /*out*/ UINT8* bidiLevel 1799 ); 1800 } 1801 1802 1803 /// <summary> 1804 /// The interface implemented by the client to receive the 1805 /// output of the text analyzers. 1806 /// </summary> 1807 mixin( uuid!(IDWriteTextAnalysisSink1, "B0D941A0-85E7-4D8B-9FD3-5CED9934482A") ); 1808 interface IDWriteTextAnalysisSink1 : IDWriteTextAnalysisSink 1809 { 1810 extern(Windows): 1811 /// <summary> 1812 /// The text analyzer calls back to this to report the actual orientation 1813 /// of each character for shaping and drawing. 1814 /// </summary> 1815 /// <param name="textPosition">Starting position to report from.</param> 1816 /// <param name="textLength">Number of UTF-16 units of the reported range.</param> 1817 /// <param name="glyphOrientationAngle">Angle of the glyphs within the text 1818 /// range (pass to GetGlyphOrientationTransform to get the world 1819 /// relative transform).</param> 1820 /// <param name="adjustedBidiLevel">The adjusted bidi level to be used by 1821 /// the client layout for reordering runs. This will differ from the 1822 /// resolved bidi level retrieved from the source for cases such as 1823 /// Arabic stacked top-to-bottom, where the glyphs are still shaped 1824 /// as RTL, but the runs are TTB along with any CJK or Latin.</param> 1825 /// <param name="isSideways">Whether the glyphs are rotated on their side, 1826 /// which is the default case for CJK and the case stacked Latin</param> 1827 /// <param name="isRightToLeft">Whether the script should be shaped as 1828 /// right-to-left. For Arabic stacked top-to-bottom, even when the 1829 /// adjusted bidi level is coerced to an even level, this will still 1830 /// be true.</param> 1831 /// <returns> 1832 /// A successful code or error code to abort analysis. 1833 /// </returns> 1834 HRESULT SetGlyphOrientation( 1835 UINT32 textPosition, 1836 UINT32 textLength, 1837 DWRITE_GLYPH_ORIENTATION_ANGLE glyphOrientationAngle, 1838 UINT8 adjustedBidiLevel, 1839 BOOL isSideways, 1840 BOOL isRightToLeft 1841 ); 1842 } 1843 1844 1845 /// <summary> 1846 /// The IDWriteTextLayout1 interface represents a block of text after it has 1847 /// been fully analyzed and formatted. 1848 /// 1849 /// All coordinates are in device independent pixels (DIPs). 1850 /// </summary> 1851 mixin( uuid!(IDWriteTextLayout1, "9064D822-80A7-465C-A986-DF65F78B8FEB") ); 1852 interface IDWriteTextLayout1 : IDWriteTextLayout 1853 { 1854 extern(Windows): 1855 /// <summary> 1856 /// Enables/disables pair-kerning on the given range. 1857 /// </summary> 1858 /// <param name="isPairKerningEnabled">The Boolean flag indicates whether text is pair-kerned.</param> 1859 /// <param name="textRange">Text range to which this change applies.</param> 1860 /// <returns> 1861 /// Standard HRESULT error code. 1862 /// </returns> 1863 HRESULT SetPairKerning( 1864 BOOL isPairKerningEnabled, 1865 DWRITE_TEXT_RANGE textRange 1866 ); 1867 1868 /// <summary> 1869 /// Get whether or not pair-kerning is enabled at given position. 1870 /// </summary> 1871 /// <param name="currentPosition">The current text position.</param> 1872 /// <param name="isPairKerningEnabled">The Boolean flag indicates whether text is pair-kerned.</param> 1873 /// <param name="textRange">The position range of the current format.</param> 1874 /// <returns> 1875 /// Standard HRESULT error code. 1876 /// </returns> 1877 HRESULT GetPairKerning( 1878 UINT32 currentPosition, 1879 /*out*/ BOOL* isPairKerningEnabled, 1880 /*out*/ DWRITE_TEXT_RANGE* textRange = null 1881 ); 1882 1883 /// <summary> 1884 /// Sets the spacing between characters. 1885 /// </summary> 1886 /// <param name="leadingSpacing">The spacing before each character, in reading order.</param> 1887 /// <param name="trailingSpacing">The spacing after each character, in reading order.</param> 1888 /// <param name="minimumAdvanceWidth">The minimum advance of each character, 1889 /// to prevent characters from becoming too thin or zero-width. This 1890 /// must be zero or greater.</param> 1891 /// <param name="textRange">Text range to which this change applies.</param> 1892 /// <returns> 1893 /// Standard HRESULT error code. 1894 /// </returns> 1895 HRESULT SetCharacterSpacing( 1896 FLOAT leadingSpacing, 1897 FLOAT trailingSpacing, 1898 FLOAT minimumAdvanceWidth, 1899 DWRITE_TEXT_RANGE textRange 1900 ); 1901 1902 /// <summary> 1903 /// Gets the spacing between characters. 1904 /// </summary> 1905 /// <param name="currentPosition">The current text position.</param> 1906 /// <param name="leadingSpacing">The spacing before each character, in reading order.</param> 1907 /// <param name="trailingSpacing">The spacing after each character, in reading order.</param> 1908 /// <param name="minimumAdvanceWidth">The minimum advance of each character, 1909 /// to prevent characters from becoming too thin or zero-width. This 1910 /// must be zero or greater.</param> 1911 /// <param name="textRange">The position range of the current format.</param> 1912 /// <returns> 1913 /// Standard HRESULT error code. 1914 /// </returns> 1915 HRESULT GetCharacterSpacing( 1916 UINT32 currentPosition, 1917 /*out*/ FLOAT* leadingSpacing, 1918 /*out*/ FLOAT* trailingSpacing, 1919 /*out*/ FLOAT* minimumAdvanceWidth, 1920 /*out*/ DWRITE_TEXT_RANGE* textRange = null 1921 ); 1922 } 1923 1924 /// <summary> 1925 /// Represents the type of antialiasing to use for text when the rendering mode calls for 1926 /// antialiasing. 1927 /// </summary> 1928 alias DWRITE_TEXT_ANTIALIAS_MODE = int; 1929 enum : DWRITE_TEXT_ANTIALIAS_MODE 1930 { 1931 /// <summary> 1932 /// ClearType antialiasing computes coverage independently for the red, green, and blue 1933 /// color elements of each pixel. This allows for more detail than conventional antialiasing. 1934 /// However, because there is no one alpha value for each pixel, ClearType is not suitable 1935 /// rendering text onto a transparent intermediate bitmap. 1936 /// </summary> 1937 DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, 1938 1939 /// <summary> 1940 /// Grayscale antialiasing computes one coverage value for each pixel. Because the alpha 1941 /// value of each pixel is well-defined, text can be rendered onto a transparent bitmap, 1942 /// which can then be composited with other content. Note that grayscale rendering with 1943 /// IDWriteBitmapRenderTarget1 uses premultiplied alpha. 1944 /// </summary> 1945 DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE 1946 } 1947 1948 /// <summary> 1949 /// Encapsulates a 32-bit device independent bitmap and device context, which can be used for rendering glyphs. 1950 /// </summary> 1951 mixin( uuid!(IDWriteBitmapRenderTarget1, "791e8298-3ef3-4230-9880-c9bdecc42064") ); 1952 interface IDWriteBitmapRenderTarget1 : IDWriteBitmapRenderTarget 1953 { 1954 extern(Windows): 1955 /// <summary> 1956 /// Gets the current text antialiasing mode of the bitmap render target. 1957 /// </summary> 1958 /// <returns> 1959 /// Returns the antialiasing mode. 1960 /// </returns> 1961 DWRITE_TEXT_ANTIALIAS_MODE GetTextAntialiasMode(); 1962 1963 /// <summary> 1964 /// Sets the current text antialiasing mode of the bitmap render target. 1965 /// </summary> 1966 /// <returns> 1967 /// Returns S_OK if successful, or E_INVALIDARG if the argument is not valid. 1968 /// </returns> 1969 /// <remarks> 1970 /// The antialiasing mode of a newly-created bitmap render target defaults to 1971 /// DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE. An application can change the antialiasing 1972 /// mode by calling SetTextAntialiasMode. For example, an application might specify 1973 /// grayscale antialiasing when rendering text onto a transparent bitmap. 1974 /// </remarks> 1975 HRESULT SetTextAntialiasMode( 1976 DWRITE_TEXT_ANTIALIAS_MODE antialiasMode 1977 ); 1978 }