gpt4 book ai didi

TinyMCE 4 如何更改字体大小样式?

转载 作者:行者123 更新时间:2023-12-03 21:24:00 30 4
gpt4 key购买 nike

我想为文本添加更改字体样式;

为此,我使用这个脚本:

tinymce.init({
selector: selector_id,
theme: "modern",
theme_modern_font_sizes: ["6px,7px,8px,9px,10px,11px,12px,13px,14px,15px,16px,17px,18px,19px,20px,21px,22px,23px,24px,25px,26px,27px,28px,29px,30px,31px,32px,36px,38px,40px"],
font_size_style_values: ["6px,7px,8px,9px,10px,11px,12px,13px,14px,15px,16px,17px,18px,19px,20px,21px,22px,23px,24px,25px,26px,27px,28px,29px,30px,31px,32px,36px,38px,40px"],
/* width: 300,
height: 300, */
plugins: [
"advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality template paste textcolor"
],
content_css: "./style.css",
toolbar: "insertfile undo redo | fontsizeselect | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor",
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
file_browser_callback : elFinderBrowser ,
spellchecker_languages : '+Русский=ru,English=en'
});

但是在我的字体大小(6px、7px、8px、9px 和其他)中,我看到 8pt、10px、12pt 和其他。

请告诉我为什么我在选择中看不到我的字体大小,我该如何使它正确?

最佳答案

您的设置接缝适用于 tinymce 3.x。忘记了,升级到 4.x 并使用如下:

    tinymce.init({
fontsize_formats: "8pt 9pt 10pt 11pt 12pt 26pt 36pt",
theme: 'modern',

然后在工具栏中:
    toolbar: "undo redo pastetext | styleselect | fontselect | fontsizeselect"

关于TinyMCE 4 如何更改字体大小样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20183796/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com