1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Desktop: Fixes #10036: Applied font family and font size to RTE (#10102)

This commit is contained in:
Abdelrrahman Elhaddad 2024-03-15 11:30:45 +02:00 committed by GitHub
parent 310a90744a
commit 85d98f5254
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 0 deletions

View File

@ -565,6 +565,8 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
useEffect(() => { useEffect(() => {
if (!scriptLoaded) return; if (!scriptLoaded) return;
const theme = themeStyle(props.themeId);
const loadEditor = async () => { const loadEditor = async () => {
const language = closestSupportedLocale(props.locale, true, supportedLocales); const language = closestSupportedLocale(props.locale, true, supportedLocales);
@ -598,6 +600,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
]; ];
const editors = await (window as any).tinymce.init({ const editors = await (window as any).tinymce.init({
content_style: `* {font-size: ${props.fontSize}px; font-family: "${props.fontFamily}"; line-height: ${theme.lineHeight};}`,
selector: `#${rootIdRef.current}`, selector: `#${rootIdRef.current}`,
width: '100%', width: '100%',
body_class: 'jop-tinymce', body_class: 'jop-tinymce',

View File

@ -464,6 +464,7 @@ function NoteEditor(props: NoteEditorProps) {
noteToolbarButtonInfos: props.toolbarButtonInfos, noteToolbarButtonInfos: props.toolbarButtonInfos,
plugins: props.plugins, plugins: props.plugins,
fontSize: Setting.value('style.editor.fontSize'), fontSize: Setting.value('style.editor.fontSize'),
fontFamily: Setting.value('style.editor.fontFamily'),
contentMaxWidth: props.contentMaxWidth, contentMaxWidth: props.contentMaxWidth,
isSafeMode: props.isSafeMode, isSafeMode: props.isSafeMode,
useCustomPdfViewer: props.useCustomPdfViewer, useCustomPdfViewer: props.useCustomPdfViewer,

View File

@ -118,6 +118,7 @@ export interface NoteBodyEditorProps {
noteToolbarButtonInfos: ToolbarButtonInfo[]; noteToolbarButtonInfos: ToolbarButtonInfo[];
plugins: PluginStates; plugins: PluginStates;
fontSize: number; fontSize: number;
fontFamily: string;
contentMaxWidth: number; contentMaxWidth: number;
isSafeMode: boolean; isSafeMode: boolean;
noteId: string; noteId: string;