CellsHelper.GetTextWidth

CellsHelper.GetTextWidth method

Get width of text in unit of points.

public static double GetTextWidth(string text, Font font, double scaling)
ParameterTypeDescription
textStringThe text.
fontFontThe font of the text.
scalingDoubleThe scaling of text.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class CellsHelperMethodGetTextWidthWithStringFontDoubleDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Font font = workbook.DefaultStyle.Font;
            double textWidth = CellsHelper.GetTextWidth("Sample Text", font, 1.0);
            Console.WriteLine("Text width: " + textWidth);
        }
    }
}

See Also