XF 1.3 Limit the font size both in the editor and by bbcode


Well-known member
Hi guys I want to limit the font size in the font drop down menu at the editor and also limit the parsing of the size bbcode up to for example 5 so if size=10 the size used should be 5. Is this possible?

Jake Bunce

XenForo moderator
Staff member

Search for "getTextSize". That function validates the sizes. It can be edited to eliminate some sizes.

You will see it only allows up to 7 by default:

				switch ($inputSize)
					case 1: $size = '9px'; break;
					case 2: $size = '10px'; break;
					case 3: $size = '12px'; break;
					case 4: $size = '15px'; break;
					case 5: $size = '18px'; break;
					case 6: $size = '22px'; break;

					case 7:
						$size = '26px';


Well-known member
Thanks, it works! Now how I can remove the options from 1 to 7 that appear when clicking on the "Font Size" control on the editor? I just want three options: 1, 2 and 3 for consistency with the changes I made in Base.php
Font sizes are configured in two areas.

The "getTextSize" function in the processing file validates the sizes, translating units to pixel units. It can be edited to your specifications.

Also consider what you will see in the editor itself, visually. This can be adjusted to display the new font sizes by editing editor_contents.css.