From f347036a6b1d62f551eaba897f181b4738c96633 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Tue, 24 Jun 2008 18:29:02 +0000 Subject: [PATCH] Now use the new MeasureText function. --- Source/Utilities/Fonts/TextPrinter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Utilities/Fonts/TextPrinter.cs b/Source/Utilities/Fonts/TextPrinter.cs index 83e07162..22964c74 100644 --- a/Source/Utilities/Fonts/TextPrinter.cs +++ b/Source/Utilities/Fonts/TextPrinter.cs @@ -37,6 +37,8 @@ namespace OpenTK.Graphics // Interleaved, vertex, texcoord, vertex, etc... Starts with 8 chars, will expand as needed. Vector2[] vertices = new Vector2[8 * 8]; ushort[] indices = new ushort[6 * 8]; + IList ranges = new List(); + #region --- Constructors --- @@ -206,8 +208,7 @@ namespace OpenTK.Graphics if (alignment == StringAlignment.Near && !rightToLeft || alignment == StringAlignment.Far && rightToLeft) { - ICollection ranges = new List(); - font.MeasureCharacterRanges(text, ref ranges); + font.MeasureText(text, SizeF.Empty, null, ranges); int current = 0; //foreach (char c in text)