Browse Source

Properly scale fixed pitch fonts

pull/4825/head
Benedikt Schroeder 6 years ago
parent
commit
51437baf73
  1. 4
      src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs

4
src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs

@ -238,11 +238,13 @@ namespace Avalonia.Direct2D1
width = 0; width = 0;
var scale = (float)(glyphRun.FontRenderingEmSize / glyphTypeface.DesignEmHeight);
if (glyphRun.GlyphAdvances.IsEmpty) if (glyphRun.GlyphAdvances.IsEmpty)
{ {
for (var i = 0; i < glyphCount; i++) for (var i = 0; i < glyphCount; i++)
{ {
var advance = glyphTypeface.GetGlyphAdvance(glyphRun.GlyphIndices[i]); var advance = glyphTypeface.GetGlyphAdvance(glyphRun.GlyphIndices[i]) * scale;
run.Advances[i] = advance; run.Advances[i] = advance;

Loading…
Cancel
Save