private StringFormatFlags? GetFlags(TextLayer textLayer) { if (textLayer.Vertical && textLayer.RightToLeft) { return StringFormatFlags.DirectionVertical | StringFormatFlags.DirectionRightToLeft; } if (textLayer.Vertical) { return StringFormatFlags.DirectionVertical; } if (textLayer.RightToLeft) { return StringFormatFlags.DirectionRightToLeft; } return null; }