Axiom.Fonts.Font.StrBBox C# (CSharp) Method

StrBBox() private method

Returns the size in pixels of a box that could contain the whole string.
private StrBBox ( string text, float char_height, Axiom.Graphics.RenderWindow window ) : Pair
text string
char_height float
window Axiom.Graphics.RenderWindow
return Pair
		Pair<int> StrBBox( string text, float char_height, RenderWindow window )
		{
			int height = 0, width = 0;
			Real vsX, vsY, veX, veY;
			int w, h;

			w = window.Width;
			h = window.Height;

			for ( int i = 0; i < text.Length; i++ )
			{
				GetGlyphTexCoords( text[ i ], out vsX, out vsY, out veX, out veY );

				// Calculate view-space width and height of char
				vsY = char_height;
				vsX = GetGlyphAspectRatio( text[ i ] ) * char_height;

				width += (int)( vsX * w );
				if ( vsY * h > height || ( ( i == 0 ) && text[ i - 1 ] == '\n' ) )
					height += (int)( vsY * h );
			}

			return new Pair<int>( height, width );
		}