Allow to choose between the different fonts in CKEDITOR.

This commit is contained in:
Jan Böhmer 2020-04-25 19:19:12 +02:00
parent 74b1b7acf5
commit 2768eb1745
15 changed files with 128 additions and 5 deletions

View file

@ -87,14 +87,13 @@ CKEDITOR.plugins.add('partdb_label', {
hidpi: true,
icons: 'placeholder',
lang: ['en', 'de'],
onLoad: function() {
// Register styles for placeholder widget frame.
CKEDITOR.addCss( '.cke_placeholder{background-color:#ff0}' );
},
init: function (editor) {
var config = editor.config,
lang = editor.lang.partdb_label;
var pluginDirectory = this.path;
editor.addContentsCss( pluginDirectory + 'styles/style.css' );
// Put ur init code here.
editor.widgets.add( 'placeholder', {
// Widget code.

View file

@ -0,0 +1,117 @@
/*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2020 Jan Böhmer (https://github.com/jbtronics)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
@font-face {
font-family: "DejaVu Sans Mono";
font-style: normal;
font-weight: normal;
src: local(DejaVu Sans Mono), local(DejaVuSansMono),
url(DejaVuSansMono.woff) format("woff");
}
@font-face {
font-family: "DejaVu Sans Mono";
font-style: normal;
font-weight: bold;
src: local(DejaVu Sans Mono Bold), local(DejaVuSansMono-Bold),
url(DejaVuSansMono-Bold.woff) format("woff");
}
@font-face {
font-family: "DejaVu Sans Mono";
font-style: oblique;
font-weight: bold;
src: local(DejaVu Sans Mono Bold Oblique), local(DejaVuSansMono-BoldOblique),
url(DejaVuSansMono-BoldOblique.woff) format("woff");
}
@font-face {
font-family: "DejaVu Sans Mono";
font-style: oblique;
font-weight: normal;
src: local(DejaVu Sans Mono Oblique), local(DejaVuSansMono-Oblique),
url(DejaVuSansMono-Oblique.woff) format("woff");
}
@font-face {
font-family: "DejaVu Sans";
font-style: normal;
font-weight: normal;
src: local(DejaVu Sans), local(DejaVuSans),
url(DejaVuSans.woff) format("woff");
}
@font-face {
font-family: "DejaVu Sans";
font-style: normal;
font-weight: bold;
src: local(DejaVu Sans Bold), local(DejaVuSans-Bold),
url(DejaVuSans-Bold.woff) format("woff");
}
@font-face {
font-family: "DejaVu Sans";
font-style: oblique;
font-weight: bold;
src: local(DejaVu Sans Bold Oblique), local(DejaVuSans-BoldOblique),
url(DejaVuSans-BoldOblique.woff) format("woff");
}
@font-face {
font-family: "DejaVu Sans";
font-style: oblique;
font-weight: normal;
src: local(DejaVu Sans Oblique), local(DejaVuSans-Oblique),
url(DejaVuSans-Oblique.woff) format("woff");
}
@font-face {
font-family: "DejaVu Serif";
font-style: normal;
font-weight: normal;
src: local(DejaVu Serif), local(DejaVuSerif),
url(DejaVuSerif.woff) format("woff");
}
@font-face {
font-family: "DejaVu Serif";
font-style: normal;
font-weight: bold;
src: local(DejaVu Serif Bold), local(DejaVuSerif-Bold),
url(DejaVuSerif-Bold.woff) format("woff");
}
@font-face {
font-family: "DejaVu Serif";
font-style: italic;
font-weight: bold;
src: local(DejaVu Serif Bold Italic), local(DejaVuSerif-BoldItalic),
url(DejaVuSerif-BoldItalic.woff) format("woff");
}
@font-face {
font-family: "DejaVu Serif";
font-style: italic;
font-weight: normal;
src: local(DejaVu Serif Italic), local(DejaVuSerif-Italic),
url(DejaVuSerif-Italic.woff) format("woff");
}
.cke_placeholder {
background-color:#ff0
}
.cke_editable {
font-family: "DejaVu Sans Mono";
font-size: 9pt;
line-height: 1.5;
}