I'm using DirectWrite (through SharpDX) to draw a TextLayout and it works as expected except for a couple things. I'm calling this TextLayout constructor:
http://sharpdx.org/documentation/api/m-sharpdx-directwrite-textlayout--ctor-2
My code is pretty straight forward:
// define 45 deg rotation matrix
var transformMatrix = new SharpDX.DirectWrite.Matrix();
transformMatrix.M11 = 0.7f;
transformMatrix.M12 = 0.7f;
transformMatrix.M21 = -0.7f;
transformMatrix.M22 = 0.7f;
transformMatrix.Dx = 0;
transformMatrix.Dy = 0;
var pixelsPerDip = 5;
var TextLayout = new SharpDX.DirectWrite.TextLayout(DWFactory, "Hello world!",
TextFormat, 400, 200, pixelsPerDip, transformMatrix, true);
I can change the transform matrix to any values whatsoever but it has no effect on my output. I've also found that pixelsPerDip
has no effect except for not drawing the text when I specify zero. I dug into the SharpDX source and these inputs seem to be handled correctly. What am I doing wrong?
The TextLayout constructor I'm using calls CreateGdiCompatibleTextLayout()
. Is it possible that something else I'm doing/using is not GDI compatible which then causes my issues?