How to set default font size lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- witenite · 2017-04-20 10:41 Hi, quick question. I see that a couple of defaults can be asserted in fpspreadsheet (or an object of type TsWorksheet) such as columnwidth, but how do you set a default font size? So far I have used this: tblProperties.CellFontsizes[0,0,tblProperties.ColCount- 1,tblProperties.RowCount-1] := FontSize; // Set font size for the whole grid as per default where tblProperties is of type TsWorksheetGrid. This however takes an extraordinary amount of time to complete, even for a very moderate sized table. Given my success with working at sheet level (IE type TsWorksheet) I feel there must be a way to set the default size, or else a means of cycling through rapidly to set the size for all cells. ---------------------------------------------------------------------- wp · 2017-04-21 10:47 The workbook contains a list of all fonts, and the font with index 0 is the default font. There is a function workbook.GetDefaultFont to return the parameters of this font, and a procedure workbook.SetDefaultFont to set its font name and size: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program project1; uses  fpstypes, fpspreadsheet, fpsallformats; var  book: TsWorkbook;  sheet: TsWorksheet;  fnt: TsFont; begin  book := TsWorkbook.Create;  try    sheet := book.AddWorksheet('Sheet 1');    fnt := book.GetDefaultFont;    book.SetDefaultFont(fnt.FontName, 18);    sheet.WriteText(0, 0, 'ABC');    sheet.WriteRowHeight(0, 1.1, suLines);     book.WriteToFile('def_font.xlsx', sfOOXML, true);    book.WriteToFile('def_font.xls', sfExcel8, true);    book.WriteToFile('def_font.ods', sfOpenDocument, true);  finally    book.Free;  end; end. This code modifies the size of the default font to 18pt and stores some dummy data. You may also need to adjust the row heights. Please note that, for the Excel file formats, the current fpspreadsheet adds the default font from the file as a new item to the font list. Therefore, existing cells are formatted with the new font, but new cells will use the old default font. This issue is fixed in svn trunk of fpspreadsheet. ---------------------------------------------------------------------- witenite · 2017-04-23 09:12 Many thanks WP, that worked a charm. Useful information on the font type too, which I have read about elsewhere online.