目前只有四种字体在字体家族下拉列表中可见,我必须将font calibri font,lato添加到各自的下拉列表中。
发布于 2017-06-26 16:02:42
我唯一能够正常工作的富文本编辑器是来自smartGWT库的编辑器。它也不是一个很好的编辑器,但确实可以工作。
下面是如何设置字体、背景颜色以及小部件控件:
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);https://stackoverflow.com/questions/44680676
复制相似问题