Uppdatera fonterinställningar från klientens sida

Contents
[ ]

Aspose.Cells GridWeb stöder nu att ändra typsnittsinställningar från klientens sida. För detta tillhandahåller API:en följande funktioner

  • updateCellFontStyle: Parametrar - r/i/b/ib för vanlig/kursiv/fet/kursiv&&fet
  • updateCellFontSize: Parametrar - fontnamn, etc. ‘System’
  • updateCellFontName: Parametrar - fontstorlek, etc. ‘12pt’
  • updateCellFontColor: Parametrar - none/u/l/ul/ för none/underline/strikout/understruken&&streckad
  • updateCellFontLine: Parametrar - html-färg som #aa22ee eller välkända färgnamn som grönt, rött,…
  • updateCellBackGroundColor: Parametrar - html-färg som #aa22ee eller välkända färgnamn som grönt, rött,…

Följande kodsnutt visar hur man ändrar typsnittsinställningar från klientens sida i GridWeb.

Exempelkod

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
<script>
function makeFontItalic(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontStyle, "i");
}
function makeFontBold(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontStyle, "b");
}
function changeFontSize(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontSize, "5pt");
}
function changeFontFamily(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontName, "Corbel Light");
}
function changeFontColor(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellFontColor, "green");
}
function changeFontBackgroundColor(){
gridwebinstance.getByIndex(0).rangeupdate(updateCellBackGroundColor, "yellow");
}
</script>