0

I'm having issue with spacing of my text after creating using the code below. I'm using a ttf file as input but the text looks like this: https://i.stack.imgur.com/ygG2V.png

private void ConvertToGeometry(int count, double size)
{

  ushort[] indices = new ushort[count];
  double[] advWidths = new double[count];
  System.Windows.Point origin = new System.Windows.Point(0, 0);

  for (int n = 0; n < count; n++)
  {
    ushort glyphIndex = gtf.CharacterToGlyphMap[m_textString[n]];
    indices[n] = glyphIndex;
    double width = gtf.AdvanceWidths[glyphIndex] * size;
    advWidths[n] = width;

    m_glyphRunList.Add(new GlyphRun(gtf,
                                    0,
                                    false,
                                    size,
                                    indices,
                                    origin,
                                    advWidths,
                                    null,
                                    null,
                                    null,
                                    null,
                                    null,
                                    null));
  }
}

}

Wonka Bear
  • 21
  • 4

0 Answers0