Posted 8 August 2019, 7:15 am EST
Hi,
How can I use the System Font Stack as font family for Spread JS cells?
font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif;
Thanks,
Raju
Forums Home / Spread / SpreadJS
Posted by: nchalla on 8 August 2019, 7:15 am EST
Posted 8 August 2019, 7:15 am EST
Hi,
How can I use the System Font Stack as font family for Spread JS cells?
font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif;
Thanks,
Raju
Posted 9 August 2019, 12:56 am EST
Hi Raju,
You may set the font the spread cells using the font attribute of style object. Please refer to the following code snippet:
var style = new GC.Spread.Sheets.Style();
// set font
style.font = '12px -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif'; // same as CSS font attribute
// apply style on whole sheet
sheet.setDefaultStyle(style);
// set style for a single cell
sheet.setStyle(rowIndex, colIndex, style);
// set style for cell range
var rng = sheet.getRange(rowIndex, colIndex, rowCount, colCount);
rng.font('12px -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif');
API References:
• setDefaultStyle: http://help.grapecity.com/spread/SpreadSheets12/webframe.html#SpreadJS~GC.Spread.Sheets.Worksheet~setDefaultStyle.html
• setStyle: http://help.grapecity.com/spread/SpreadSheets12/webframe.html#SpreadJS~GC.Spread.Sheets.Worksheet~setStyle.html
• getRange: http://help.grapecity.com/spread/SpreadSheets12/webframe.html#SpreadJS~GC.Spread.Sheets.Worksheet~getRange.html
Regards