首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在gwt富编辑器素材中添加自定义字体

如何在gwt富编辑器素材中添加自定义字体
EN

Stack Overflow用户
提问于 2017-06-21 23:42:39
回答 1查看 208关注 0票数 0

目前只有四种字体在字体家族下拉列表中可见,我必须将font calibri font,lato添加到各自的下拉列表中。

EN

回答 1

Stack Overflow用户

发布于 2017-06-26 16:02:42

我唯一能够正常工作的富文本编辑器是来自smartGWT库的编辑器。它也不是一个很好的编辑器,但确实可以工作。

下面是如何设置字体、背景颜色以及小部件控件:

代码语言:javascript
复制
import com.smartgwt.client.widgets.RichTextEditor;

final RichTextEditor rte = new RichTextEditor();
rte.setSize("700px", "400px");
rte.setValue(callback.getRichTextHtml(html.name)); // the html content
rte.setControlGroups(new String[]{"fontControls", "styleControls", "formatControls", "colorControls", "bulletControls"});
rte.setEditAreaBackgroundColor(ArgbToHex(html.a, html.r, html.g, html.b)); // html string value

LinkedHashMap<String, String> fonts = new LinkedHashMap<>();
fonts.put("FreeSans", "Sans"); // put your fonts here
fonts.put("FreeSerif", "Serif");
fonts.put("FreeMono", "Mono");
rte.setFontNames(fonts);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44680676

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档