sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.69k stars 641 forks source link

TextLayout1.SetPairKerning does not affect glyphRun in CustomTextRenderer #942

Open heikovetter opened 6 years ago

heikovetter commented 6 years ago

Hello, it looks like there is a problem with the TextLayout1.SetPairKerning method. I use a CustomTextRenderer. The glyphRun.Advances I get in the CustomTextRenderer.DrawGlyphRun Method doesn’t change when I set Kerning to false (or true).

textLayout1.SetPairKerning(new RawBool(false), new TextRange(0, this.trueTypeText.Text.Length)); textLayout1.Draw(this.customTextRenderer, xPosition, yPosition);

public Result CustomTextRenderer.DrawGlyphRun(object clientDrawingContext, float baselineOriginX, float baselineOriginY, MeasuringMode measuringMode, GlyphRun glyphRun, GlyphRunDescription glyphRunDescription, ComObject clientDrawingEffect) { glyphRun.Advances // always the same. }