设置字体

dev_aliyun2
杨树林 5 years ago committed by harry
parent e388b61115
commit 477b63bff4

@ -1,65 +1,66 @@
@charset "utf-8";
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体"; content: "宋体";
font-family: "SimSun"; font-family:SimSun !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体"; content: "黑体";
font-family: "SimHei"; font-family:SimHei !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑"; content: "微软雅黑";
font-family: "Microsoft YaHei"; font-family:Microsoft YaHei !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体"; content: "楷体";
font-family: "KaiTi"; font-family:KaiTi !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=FangSong]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=FangSong]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=FangSong]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=FangSong]::before {
content: "仿宋"; content: "仿宋";
font-family: "FangSong"; font-family:FangSong !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial"; content: "Arial";
font-family: "Arial"; font-family:Arial !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman"; content: "Times New Roman";
font-family: "Times New Roman"; font-family:Times New Roman !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=sans-serif]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=sans-serif]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=sans-serif]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=sans-serif]::before {
content: "sans-serif"; content: "sans-serif";
font-family: "sans-serif"; font-family:sans-serif !important;
} }
.ql-font-SimSun { .ql-font-SimSun {
font-family: "SimSun"; font-family:SimSun !important;
} }
.ql-font-SimHei { .ql-font-SimHei {
font-family: "SimHei"; font-family:SimHei !important;
} }
.ql-font-Microsoft-YaHei { .ql-font-Microsoft-YaHei {
font-family: "Microsoft YaHei"; font-family:Microsoft YaHei !important;
} }
.ql-font-KaiTi { .ql-font-KaiTi {
font-family: "KaiTi"; font-family:KaiTi !important;
} }
.ql-font-FangSong { .ql-font-FangSong {
font-family: "FangSong"; font-family:FangSong !important;
} }
.ql-font-Arial { .ql-font-Arial {
font-family: "Arial"; font-family:Arial !important;
} }
.ql-font-Times-New-Roman { .ql-font-Times-New-Roman {
font-family: "Times New Roman"; font-family:Times New Roman !important;
} }
.ql-font-sans-serif { .ql-font-sans-serif {
font-family: "sans-serif"; font-family:sans-serif !important;
} }

@ -20,12 +20,12 @@ import { fetchUploadImage } from '../../services/ojService.js';
import { getImageUrl } from 'educoder' import { getImageUrl } from 'educoder'
import ImageBlot from './ImageBlot'; import ImageBlot from './ImageBlot';
import FillBlot from './FillBlot'; import FillBlot from './FillBlot';
const Size = Quill.import('attributors/style/size'); var Size = Quill.import('attributors/style/size');
const Font = Quill.import('formats/font');
// const Color = Quill.import('attributes/style/color'); // const Color = Quill.import('attributes/style/color');
Size.whitelist = ['14px', '16px', '18px', '20px', false]; Size.whitelist = ['14px', '16px', '18px', '20px', false];
Font.whitelist = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']; var fonts = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong'];
var Font = Quill.import('formats/font');
Font.whitelist = fonts; //将字体加入到白名单
window.Quill = Quill; window.Quill = Quill;
window.katex = katex; window.katex = katex;
Quill.register(ImageBlot); Quill.register(ImageBlot);
@ -58,7 +58,7 @@ function QuillForEditor({
{align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表 {align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表
{script: 'sub'}, {script: 'super'}, {script: 'sub'}, {script: 'super'},
{ 'color': [] }, { 'background': [] }, { 'color': [] }, { 'background': [] },
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}, { 'font': []},
{header: [1,2,3,4,5,false]}, {header: [1,2,3,4,5,false]},
'blockquote', 'code-block', 'blockquote', 'code-block',
'link', 'image', 'video', 'link', 'image', 'video',

@ -339,9 +339,9 @@ class ChoquesEditor extends Component {
// //////console.log("xuanzheshijuan"); // //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray); // //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish); // //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']}, const options=['code-block', 'image', 'formula',
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']}, 'bold', 'italic', 'underline', 'strike',{size: ['14px', '16px', '18px', '20px']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']} { 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']}
] ]
return( return(
<div className="padding20-30 signleEditor duoxuano" id={qNumber}> <div className="padding20-30 signleEditor duoxuano" id={qNumber}>
@ -370,6 +370,9 @@ class ChoquesEditor extends Component {
line-height: 20px; line-height: 20px;
min-width: 150px; min-width: 150px;
} }
.signleEditor .quill_editor_for_react_area .ql-container .ql-editor p{
font-family: MicrosoftYaHei;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}

@ -358,9 +358,10 @@ class JudquestionEditor extends Component {
// ////////console.log(answerTagArray); // ////////console.log(answerTagArray);
// ////////console.log(!exerciseIsPublish); // ////////console.log(!exerciseIsPublish);
const params= this.props&&this.props.match&&this.props.match.params; const params= this.props&&this.props.match&&this.props.match.params;
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']}, const options=['code-block', 'image', 'formula',
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']}, 'bold', 'italic', 'underline', 'strike',
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']} {size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']}
] ]
return( return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}> <div className="padding20-30 signleEditor danxuano" id={qNumber}>
@ -389,6 +390,9 @@ class JudquestionEditor extends Component {
line-height: 20px; line-height: 20px;
min-width: 150px; min-width: 150px;
} }
.signleEditor .quill_editor_for_react_area .ql-container .ql-editor p{
font-family: MicrosoftYaHei;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}

@ -378,9 +378,10 @@ class SingleEditor extends Component {
// //////console.log("xuanzheshijuan"); // //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray); // //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish); // //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']}, const options=['code-block', 'image', 'formula',
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']}, 'bold', 'italic', 'underline', 'strike',
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']} ,{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']}
] ]
return( return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}> <div className="padding20-30 signleEditor danxuano" id={qNumber}>
@ -410,6 +411,9 @@ class SingleEditor extends Component {
line-height: 20px; line-height: 20px;
min-width: 150px; min-width: 150px;
} }
.signleEditor .quill_editor_for_react_area .ql-container .ql-editor p{
font-family: MicrosoftYaHei;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}

@ -1,65 +1,67 @@
@charset "utf-8";
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体"; content: "宋体";
font-family: "SimSun"; font-family:SimSun !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体"; content: "黑体";
font-family: "SimHei"; font-family:SimHei !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑"; content: "微软雅黑";
font-family: "Microsoft YaHei"; font-family:Microsoft YaHei !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体"; content: "楷体";
font-family: "KaiTi"; font-family:KaiTi !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=FangSong]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=FangSong]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=FangSong]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=FangSong]::before {
content: "仿宋"; content: "仿宋";
font-family: "FangSong"; font-family:FangSong !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial"; content: "Arial";
font-family: "Arial"; font-family:Arial !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman"; content: "Times New Roman";
font-family: "Times New Roman"; font-family:Times New Roman !important;
} }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=sans-serif]::before, .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=sans-serif]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=sans-serif]::before { .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=sans-serif]::before {
content: "sans-serif"; content: "sans-serif";
font-family: "sans-serif"; font-family:sans-serif !important;
} }
.ql-font-SimSun { .ql-font-SimSun {
font-family: "SimSun"; font-family:SimSun !important;
} }
.ql-font-SimHei { .ql-font-SimHei {
font-family: "SimHei"; font-family:SimHei !important;
} }
.ql-font-Microsoft-YaHei { .ql-font-Microsoft-YaHei {
font-family: "Microsoft YaHei"; font-family:Microsoft YaHei !important;
} }
.ql-font-KaiTi { .ql-font-KaiTi {
font-family: "KaiTi"; font-family:KaiTi !important;
} }
.ql-font-FangSong { .ql-font-FangSong {
font-family: "FangSong"; font-family:FangSong !important;
} }
.ql-font-Arial { .ql-font-Arial {
font-family: "Arial"; font-family:Arial !important;
} }
.ql-font-Times-New-Roman { .ql-font-Times-New-Roman {
font-family: "Times New Roman"; font-family:Times New Roman !important;
} }
.ql-font-sans-serif { .ql-font-sans-serif {
font-family: "sans-serif"; font-family:sans-serif !important;
} }

Loading…
Cancel
Save