MyBB Community Forums

Full Version: Is it possible to add a new font in font list
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to add a new font here in this list?

[Image: 07Z6YVV.png]
Yes, its possible.

First, add your font (I assume you know how to do that) using global css.

next open the template: Ungroup Templates > codebuttons and find this line:
plugins: "bbcode,undo",
add your font after that:
fonts:"my-font",

Note: This will show only the font you just added. If you wanna keep all the existing fonts as well you need to add the new font to the default font string:
fonts: "my-font,Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",
(2019-01-09, 09:16 AM)effone Wrote: [ -> ]Yes, its possible.

First, add your font (I assume you know how to do that) using global css.

next open the template: Ungroup Templates > codebuttons and find this line:
plugins: "bbcode,undo",
add your font after that:
fonts:"my-font",

Note: This will show only the font you just added. If you wanna keep all the existing fonts as well you need to add the new font to the default font string:
fonts: "my-font,Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",

ٰ I did this and found one issue. I installed a new font "Jameel Noori Nastaleeq" and when I type something in the editor then it shows me text in new font which is working perfectly. In the screenshot below, first line is written in new font while second line is written in Arial.

[Image: duVFpEj.png]

When when I post something then it doesn't display like above font. In the screenshot below, both lines appear to be in Arial.

[Image: fLrKO1G.png]

Interestingly when I take a look at View Source in browser, then it shows that it is picking up correct font.


<div class="post_body scaleimages" id="pid_3527">

<span style="font-size: xx-large;" class="mycode_size">
<span style="font-family: Jameel Noori Nastaleeq;" class="mycode_font">یہ جمیل نوری فانٹ ہے</span></span><br />

<br />

<span style="font-size: xx-large;" class="mycode_size">
<span style="font-family: Arial Black;" class="mycode_font">یہ نارمل فانٹ ہے</span></span>

</div>
And here's my global.css

@font-face {
    font-family: 'Jameel Noori Nastaleeq';
    src: url('/fonts/jameelnoorinastaleeq-webfont.woff2') format('woff2'),
         url('/fonts/jameelnoorinastaleeq-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
Imterestimg.
I will look further a way to adapt the font in editor. But if you post as is the final post will be exactly as you wanted.
Sorry if I was not clear in my post.

In editor the font displays fine.
But in forum post it doesn't. So I wonder what can be done to fix this i.e. if it is displaying fine in editor then it should also display fine in forum post.