从客户端更新字体设置
Contents
[
Hide
]
本主题讨论在 Aspose.Cells.GridWeb 控件中从客户端更改字体设置。
Aspose.Cells GridWeb 现在支持从客户端更改字体设置。为此,API 提供了以下功能
- 更新单元格字体样式参数 - r/i/b/ib 用于常规/斜体/粗体/斜体&&粗体
- 更新单元格字体大小参数 - 字体名称等 ‘系统’
- 更新单元格字体名称:参数 - 字体大小等。 ‘12pt’
- 更新单元格字体颜色: 参数 - 无/u/l/ul/ 无/下划线/删除线/下划线&&删除线
- 更新单元格字体线参数 - html 颜色,如 #aa22ee 或众所周知的颜色名称,如绿色、红色、…
- 更新单元格背景颜色参数 - html 颜色,如 #aa22ee 或众所周知的颜色名称,如绿色、红色、…
以下代码片段演示了在 GridWeb 中从客户端更改字体设置。
示例代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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> |