MyBB Community Forums

Full Version: Custom font is not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I have problem with the custom font installation in my forum.
I have read so many posts about this topic and followed but font is not working for me.

In global.css i am creating new font :
@font-face{ 
    font-family: mainFont;
    url('https://anupamsworld.net/forum/uploads/Berlin_Sans_FB_Regular.woff') format('woff'),
    url('https://anupamsworld.net/forum/uploads/Berlin_Sans_FB_Regular.ttf') format('truetype'),
    url('https://anupamsworld.net/forum/uploads/Berlin_Sans_FB_Regular.otf') format('opentype') ;
}
or this way also :
@font-face{ 
    font-family: mainFont;
    url('https://anupamsworld.net/forum/uploads/Berlin_Sans_FB_Regular.otf') format('opentype'),
}
and in container :
#container {
	color: #333;
	text-align: left;
	line-height: 1.4;
	margin: 0;
	font-family: mainFont;
	font-size: 13px;
	min-width: 990px;
}
and changed the body also :

body {
	background: #fff;
	color: #333;
	text-align: center;
	line-height: 1.4;
	margin: 0;
	font-family: mainFont;
	font-size: 13px;
	overflow-y: scroll;
}


Still its not working for me.
Can anyone help me with proper guidance ?
Please help me.

Thanks...
Use @import through CSS. Google it.
@import calls in CSS should be avoided. Link to the font in headerinclude template, and then change the font-family specification in global.css
(2017-05-14, 02:30 PM)Ashley1 Wrote: [ -> ]@import calls in CSS should be avoided.


Any particular issues with that ? I have myself used it for a long period.
(2017-05-14, 02:52 PM)meetdilip Wrote: [ -> ]
(2017-05-14, 02:30 PM)Ashley1 Wrote: [ -> ]@import calls in CSS should be avoided.


Any particular issues with that ? I have myself used it for a long period.

It's not recommended practice now, for best page speed performance.
(2017-05-14, 03:06 PM)Ashley1 Wrote: [ -> ]
(2017-05-14, 02:52 PM)meetdilip Wrote: [ -> ]
(2017-05-14, 02:30 PM)Ashley1 Wrote: [ -> ]@import calls in CSS should be avoided.


Any particular issues with that ? I have myself used it for a long period.

It's not recommended practice now, for best page speed performance.

Any source on this ? Something by Google.
^^Well i don't recall seeing something specifically from Google, but you can do some homework on page speed optimization and you will find it. Another something to avoid is using in line styles, rather use CSS class definitions.