public void SetStyle(int start, int length, NativeTextStyleProperty properties, ref NativeTextStyle style) { if (!TextLayout_SetStyle(NativePointer, (uint)start, (uint)length, properties, ref style, out var error)) { throw new InvalidOperationException("Couldn't set text style: " + error); } }
private static extern bool TextLayout_SetStyle(IntPtr textLayout, uint start, uint length, NativeTextStyleProperty properties, ref NativeTextStyle style, [MarshalAs(UnmanagedType.LPWStr)] out string error );