Implemented functions of text format and text layout regarding text
alignment.
Try 3: Used proper enum value to set the enum variables.
+ if(alignment!=DWRITE_TEXT_ALIGNMENT_CENTER && alignment!=DWRITE_TEXT_ALIGNMENT_LEADING && + alignment!=DWRITE_TEXT_ALIGNMENT_JUSTIFIED && alignment!=DWRITE_TEXT_ALIGNMENT_TRAILING) + return E_INVALIDARG; + This->format.text_align = alignment;
This doesn't look great, you'll need a test that shows it really rejects meaningless values,
and if it does it would be simpler to compare with greatest enum value.