You just get the textformatter module and use the formatValue(). It accepts Page, Field, String but you can also pass an empty page and field as most textformatters also don't use it except HannaCode I think.
$str = $page->textfield;
$modules->TextformatterModuleName->formatValue(new Page(), new Field(), $str);
echo $str;
This is deprecated, but should work for most textformatters still
$str = $page->textfield;
$modules->TextformatterModuleName->format($str);
echo $str;