nnhubbard / ZSSRichTextEditor

A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view
MIT License
3.78k stars 584 forks source link

add interface for setFontSize #213

Open hangpuyan opened 6 years ago

hangpuyan commented 6 years ago
  1. 在ZSSRichTextEditor.m 文件添加接口 /* font 1-7 /
    • (void)setFontSize:(int)font { NSString *normal = [NSString stringWithFormat:@"zss_editor.setFontSize(\"%d\");",font]; [self.editorView stringByEvaluatingJavaScriptFromString:normal]; }
  2. ZSSRichTextEditor.js 文件中添加接口 zss_editor.setFontSize = function(aFontSize) {

    document.execCommand("styleWithCSS", null, true); document.execCommand('fontSize', false, aFontSize); document.execCommand("styleWithCSS", null, false); zss_editor.enabledEditingItems();

}