Draw Outlined Text (RichText)

How can I make the text in a RichText have an outline? draw.SimpleTextOutlined will no do for obvious reasons.

For what obvious reasons?

RichText draws itself just fine and the entire RichText system would probably have to be recreated in a paint hook to work exactly the same (as far as I know)

You can add outline to a font.

Yes.
And it’s quite ugly compared to SimpleTextOutlined.

Github: https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/includes/modules/draw.lua



function SimpleTextOutlined(text, font, x, y, colour, xalign, yalign, outlinewidth, outlinecolour)

	local steps = ( outlinewidth * 2 ) / 3
	if ( steps < 1 ) then steps = 1 end

	for _x = -outlinewidth, outlinewidth, steps do
		for _y = -outlinewidth, outlinewidth, steps do
			SimpleText( text, font, x + _x, y + _y, outlinecolour, xalign, yalign )
		end
	end

	return SimpleText( text, font, x, y, colour, xalign, yalign )

end


I guess doing something like that would do.

What?
My point was that the font outline property is ugly compared to SimpleTextOutlined, not the other way around.

I posted how draw.SimpleTextOutline works … so you could make a draw function to replace RichText :v
RichText is an engine panel, so you kinda have to recreate it to make your own paint function.