/// <summary>
        /// Draws a string with variable line heights.
        /// </summary>
        /// <param name="spriteBatch">The <see cref="SpriteBatch"/> to use.</param>
        /// <param name="spriteFont">The <see cref="DynamicSpriteFont"/> to use.</param>
        /// <param name="str">The text to draw.</param>
        /// <param name="location">The top left location of drawn string.</param>
        /// <param name="maxBounds">Maximum bounds. Set its X and/or Y to 0 to disable the constraint on that dimension.</param>
        /// <param name="scale">The scaling factor.</param>
        /// <param name="spacing">The spacing factor. Its X component is used for character spacing, and Y component for line spacing.</param>
        /// <param name="color">The color of the text.</param>
        /// <returns>Size of the drawn string, in pixels.</returns>
        public static Vector2 DrawString([NotNull] this SpriteBatch spriteBatch, [NotNull] DynamicSpriteFont spriteFont, [CanBeNull] string str, Vector2 location, Vector2 maxBounds, Vector2 scale, Vector2 spacing, Color color)
        {
            if (!spriteFont.CanDraw)
            {
                throw new InvalidOperationException();
            }

            if (string.IsNullOrEmpty(str))
            {
                return(Vector2.Zero);
            }

            return(spriteFont.DrawOrMeasure(spriteBatch, str, location, maxBounds, scale, spacing, color));
        }