Skip to content

SetColWidth changes font in the column

Hi,

I'm running v2.0.2 and when I do:

	f := excelize.NewFile()

	index := f.NewSheet("TestSheet")
	f.SetColWidth("TestSheet", "B", "B", 20)

	f.SetCellValue("TestSheet", "B2", "Hello there!")
	f.SetActiveSheet(index)
	// f.SetDefaultFont("Liberation Sans")

	if err := f.SaveAs("Book1.xlsx"); err != nil {
		println(err.Error())
	}

it changes the width, but also seems to have "Calibri" font, and now 11px size and not 10px which seems to be the default for me. I open the file in LibreOffice. If I also do the commented out row there, it goes back to what seems to be the default font for me.

I would expect it to not change the font, so what am I missing here? Oh, and yes, not doing the SetColWidth it doesn't change the font.

Thanks!