MyBB Community Forums

Full Version: How to change editor default font
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Original post was old and about default fonts.
Newer question, somewhat related is about dealing with size formatting when posting copy/paste text in WYSIWYG editor mode.
Another similar issue that could occur is color formatting.

Three choices:
1. Suggest and/or force source mode entry which strips out format codes.
2. Ignore size formatting with mycode entry.
3. Permit size formatting after making core edit that limits max and minimum size.

The first has already been discussed.

The second is easy enough with mycode.
AdminCP / Configuration / MyCode menu / Add New MyCode

Title: Drop Size
Short description: ignores size formatting
Regular expression: \[\/?size[^\]]*\]
Replacement: <strong></strong>
Enabled: Yes

Replacement in earlier versions could be left blank, but newer versions require an entry to complete the process.

Pasting dark type in a theme with a dark background is a problem that could be solved in a similar fashion by dropping color formats which then relies on the theme's default text colors.

Title: Drop Color
Short description: ignores color formatting
Regular expression: \[\/?color[^\]]*\]
Replacement: <strong></strong>
Enabled: Yes

With the third option you can permit size formatting if you make a core edit to

inc/class_parser.php
to fix size parameter, type size too small in pasted text

find beginning line 831
		if($size < 1)
		{
			$size = 1;
		}
and replace with
		if($size < 7) //core edit, original value is 1
		{
			$size = 7; //core edit, original value is 1
		}

Size 7 (in points or pixels) is equivalent to current editor's 1=xx-small, and size 50 (in points or pixels) is equivalent to current editor's 7=xx-large.

If you make the core edit, you may have to enter it again each software update, until it becomes a standard part of code. That will permit your members to copy/paste size formatting.
Pages: 1 2 3