|
@@ -133,6 +133,7 @@ class EditorDemo extends React.Component<EditorDemoProps> {
|
|
|
'blockquote',
|
|
|
'font-size',
|
|
|
'line-height',
|
|
|
+ 'font-family',
|
|
|
];
|
|
|
|
|
|
const extendControls: ExtendControlType[] = [
|
|
@@ -195,6 +196,29 @@ class EditorDemo extends React.Component<EditorDemoProps> {
|
|
|
|
|
|
const { editorState } = this.state;
|
|
|
|
|
|
+ const fontFamilies = [
|
|
|
+ {
|
|
|
+ name: 'Araial',
|
|
|
+ family: 'Arial, Helvetica, sans-serif',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'Georgia',
|
|
|
+ family: 'Georgia, serif',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'Impact',
|
|
|
+ family: 'Impact, serif',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'Monospace',
|
|
|
+ family: '"Courier New", Courier, monospace',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'Tahoma',
|
|
|
+ family: 'tahoma, arial, "Hiragino Sans GB", 宋体, sans-serif',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
return (
|
|
|
<div className="my-component">
|
|
|
<BraftEditor
|
|
@@ -202,6 +226,7 @@ class EditorDemo extends React.Component<EditorDemoProps> {
|
|
|
imageResizable={false}
|
|
|
style={{ border: '1px solid #d9d9d9', width: '375px' }}
|
|
|
controls={controls}
|
|
|
+ fontFamilies={fontFamilies}
|
|
|
imageControls={imageControls}
|
|
|
ref={(instance) => (this.state.editorInstance = instance)}
|
|
|
extendControls={extendControls}
|