Post by gedielson » Tue Nov 25, 2014 5:21 am

Hello.

I don't know if this is happening only with me, in the Summernote editor:

When I load the page, the font button shows the default font configured in the javascript. But, when I click in the text area, the font automatically changes to "Open Sans". I have looked in all summernote javascript and css files, but none of them even mention the Open Sans font. I don't have any idea from where the editor is "bringing" this font.

I would apreciate any help.

Thanks in advance.

User avatar
New member

Posts

Joined
Wed Oct 01, 2014 7:37 am
Location - Brazil

Post by yuno » Mon Dec 15, 2014 2:14 pm

try edit here for your default font-family!
admin
opencart-2000\admin\view\stylesheet\stylesheet.css (3 hits)
Line 6: font-family: 'Open Sans', sans-serif;
Line 23: font-family: 'Open Sans', sans-serif;
Line 143: font-family: 'Open Sans', sans-serif;

catalogy
opencart-2000\catalog\view\theme\default\stylesheet\stylesheet.css (2 hits)
Line 2: font-family: 'Open Sans', sans-serif;
Line 317: font-family: 'Open Sans', sans-serif;

add more
opencart-2000\admin\view\javascript\summernote\summernote.js
line 1125: ['font', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']],

OpenCart®
PHP Developer.
更多中文教學在 OpenCart香港官方網站 !
QQ: 2039574815


Active Member

Posts

Joined
Tue Feb 11, 2014 9:24 am

Post by gedielson » Tue Dec 16, 2014 5:24 am

Hi, Yuno. You was right!

This change happens because when you click on SummerNote edit area, it automatically gets the <body> font-family. So, I just took the note-editor class that is dynamically created and then I added a css style:

Code: Select all

.note-editor{font-family:Arial}
This way I solved the problem and kept the other styles.

I had already added the other font styles to the SummerNote JavaScript.

Very Thanks! You helped me a lot!

;D

http://gepeixoto.com.br


User avatar
New member

Posts

Joined
Wed Oct 01, 2014 7:37 am
Location - Brazil

Post by pnair39 » Sun Feb 15, 2015 8:41 am

do you have an example of what you did to create css style?

User avatar
New member

Posts

Joined
Thu Dec 25, 2014 12:24 pm

Post by gedielson » Mon Feb 16, 2015 12:33 am

pnair39 wrote:do you have an example of what you did to create css style?
Hi, pnair39. When you load the page, the Summerote javascript create the editor inside a <div> with class "note-editor". So, open your admin/view/stylesheet/stylesheet.css and at the last line add

Code: Select all

.note-editor{font-family:Arial}
Just replace the "Arial" by your Summernote default font-family, that is found in admin/view/javascript/summernote/summernote.js, line 1163:

Code: Select all

1162|    // default fontName
1163|    defaultFontName: 'Helvetica Neue',
This should do the trick.

http://gepeixoto.com.br


User avatar
New member

Posts

Joined
Wed Oct 01, 2014 7:37 am
Location - Brazil
Who is online

Users browsing this forum: No registered users and 8 guests