Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
local-tinymce
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
athos
local-tinymce
Commits
7bce58d7
Commit
7bce58d7
authored
Apr 01, 2017
by
Георгий Попов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
append instruction how to add a new font to the README file
parent
15cd5089
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
README.md
README.md
+33
-2
ckeditor.editor.js
js/ckeditor.editor.js
+5
-0
No files found.
README.md
View file @
7bce58d7
...
...
@@ -14,9 +14,9 @@
## Использование
`$ firefox index.html`
## Настройка
## Настройка
CKEditor
### Добавление собственных стилей
в CKEditor
### Добавление собственных стилей
Для добавления собственного стиля необходимо редактировать файл
**js/ckeditor.editor.js**
.
Файл содержит конфигурацию редактора. Стили задаются в массиве '
**stylesSet**
':
...
...
@@ -72,3 +72,34 @@ stylesSet: [
}
}
```
### Добавление новых шрифтов
Для добавления собственного шрифта необходимо редактировать файл
**js/ckeditor.editor.js**
.
Файл содержит конфигурацию редактора. Стили задаются в переменной '
**font_names**
':
```
javascript
// Font names. To add a new font to a select list just append it to this string
font_names
:
'Arial; Comic Sans MS; Courier New; Georgia;'
+
'Lucida Sans Unicode; Tahoma; Times New Roman; Terminus;'
+
'Trebuchet MS; Verdana;'
```
Чтобы добавить новый шрифт в выпадающий список доступных шрифтов редактора, необходимо просто добавить название
желаемого шрифта в переменную
**font_names**
. Также можно задать шрифту псевдоним (название, которое будет
отображаться в списке), для этого нужно добавить в переменную псевдоним нового шрифта, а затем, разделив косой чертой,
добавить список действительных шрифтов для псевдонима в порядке приоритета через зяпятую.
Например, если мы хотим добавить новый шрифт 'My new font', который на самом деле
будет (Arial, Helvetica, sans-serif) в список:
```
javascript
// Font names. To add a new font to a select list just append it to this string
font_names
:
'Arial; Comic Sans MS; Courier New; Georgia;'
+
'Lucida Sans Unicode; Tahoma; Times New Roman; Terminus;'
+
'Trebuchet MS; Verdana; My New Font/Arial, Helvetica, sans-serif;'
```
Обратите внимание на конец последней строки. Новый шрифт содержит название, список
действительных шрифтов а также заканчивается точкой с запятой.
После этого редактор должен отобразить наш шрифт
**My new font**
в списке.
js/ckeditor.editor.js
View file @
7bce58d7
...
...
@@ -51,6 +51,11 @@ document.addEventListener('DOMContentLoaded', function() {
// Make the editing area bigger than default.
height
:
window
.
innerWidth
||
document
.
documentElement
.
clientWidth
,
// Font names. To add a new font to a select list just append it to this string
font_names
:
'Arial; Comic Sans MS; Courier New; Georgia;'
+
'Lucida Sans Unicode; Tahoma; Times New Roman; Terminus;'
+
'Trebuchet MS; Verdana;'
,
// Define the list of styles which should be available in the Styles dropdown list.
// If the "class" attribute is used to style an element, make sure to define the style for the class in "mystyles.css"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment