diff --git a/config/packages/fos_ckeditor.yaml b/config/packages/fos_ckeditor.yaml index 048dbf83..a88e43a8 100644 --- a/config/packages/fos_ckeditor.yaml +++ b/config/packages/fos_ckeditor.yaml @@ -22,6 +22,13 @@ fos_ck_editor: enterMode: 2 toolbar: label_toolbar extraPlugins: "partdb_label" + font_names: > + DejaVu Sans Mono/DejaVu Sans Mono; + DejaVu Sans/DejaVu Sans; + DejaVu Serif/DejaVu Serif; + Helvetica/Helvetica, Arial, sans-serif; + Times New Roman/Times New Roman, Times, serif; + Courier New/Courier New, Courier, monospace; plugins: bbcode: @@ -46,7 +53,7 @@ fos_ck_editor: - ["SpecialChar"] - ["Source"] - "/" - - ['Format', 'FontSize'] + - ['Format', 'FontSize', 'Font'] - ['Table', 'HorizontalRule'] - ['Placeholders'] description_toolbar: diff --git a/public/ckeditor/plugins/partdb_label/plugin.js b/public/ckeditor/plugins/partdb_label/plugin.js index 94626989..e04befb1 100644 --- a/public/ckeditor/plugins/partdb_label/plugin.js +++ b/public/ckeditor/plugins/partdb_label/plugin.js @@ -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. diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSans-Bold.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSans-Bold.woff new file mode 100644 index 00000000..77ea1108 Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSans-Bold.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSans-BoldOblique.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSans-BoldOblique.woff new file mode 100644 index 00000000..501b77e4 Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSans-BoldOblique.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSans-Oblique.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSans-Oblique.woff new file mode 100644 index 00000000..d01f9098 Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSans-Oblique.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSans.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSans.woff new file mode 100644 index 00000000..0c0b50cb Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSans.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono-Bold.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono-Bold.woff new file mode 100644 index 00000000..abb18d0c Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono-Bold.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono-BoldOblique.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono-BoldOblique.woff new file mode 100644 index 00000000..abb1c2b3 Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono-BoldOblique.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono-Oblique.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono-Oblique.woff new file mode 100644 index 00000000..6493cb63 Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono-Oblique.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono.woff new file mode 100644 index 00000000..629c3523 Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSansMono.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif-Bold.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif-Bold.woff new file mode 100644 index 00000000..0ec61b37 Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif-Bold.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif-BoldItalic.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif-BoldItalic.woff new file mode 100644 index 00000000..45ce687b Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif-BoldItalic.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif-Italic.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif-Italic.woff new file mode 100644 index 00000000..51ee3548 Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif-Italic.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif.woff b/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif.woff new file mode 100644 index 00000000..abf7b5cb Binary files /dev/null and b/public/ckeditor/plugins/partdb_label/styles/DejaVuSerif.woff differ diff --git a/public/ckeditor/plugins/partdb_label/styles/style.css b/public/ckeditor/plugins/partdb_label/styles/style.css new file mode 100644 index 00000000..9d4e566c --- /dev/null +++ b/public/ckeditor/plugins/partdb_label/styles/style.css @@ -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 . + */ + + +@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; +}