Now use the new MeasureText function.

This commit is contained in:
the_fiddler 2008-06-24 18:29:02 +00:00
parent f2ac359999
commit f347036a6b

View file

@ -37,6 +37,8 @@ namespace OpenTK.Graphics
// Interleaved, vertex, texcoord, vertex, etc... Starts with 8 chars, will expand as needed. // Interleaved, vertex, texcoord, vertex, etc... Starts with 8 chars, will expand as needed.
Vector2[] vertices = new Vector2[8 * 8]; Vector2[] vertices = new Vector2[8 * 8];
ushort[] indices = new ushort[6 * 8]; ushort[] indices = new ushort[6 * 8];
IList<RectangleF> ranges = new List<RectangleF>();
#region --- Constructors --- #region --- Constructors ---
@ -206,8 +208,7 @@ namespace OpenTK.Graphics
if (alignment == StringAlignment.Near && !rightToLeft || alignment == StringAlignment.Far && rightToLeft) if (alignment == StringAlignment.Near && !rightToLeft || alignment == StringAlignment.Far && rightToLeft)
{ {
ICollection<RectangleF> ranges = new List<RectangleF>(); font.MeasureText(text, SizeF.Empty, null, ranges);
font.MeasureCharacterRanges(text, ref ranges);
int current = 0; int current = 0;
//foreach (char c in text) //foreach (char c in text)