• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/hook/page/themefonts.php
  • Класс: BitrixLandingHookPageThemeFonts
  • Вызов: ThemeFonts::convertFontName
static function convertFontName(string $fontName): string
{
	$fontName = str_replace(['g-font-', '-', 'ibm ', 'pt '], ['', ' ', 'IBM ', 'PT '], $fontName);

	$pattern = [
		'/sc(?:(?![a-z]))/i',
		'/jp(?:(?![a-z]))/i',
		'/kr(?:(?![a-z]))/i',
		'/tc(?:(?![a-z]))/i',
	];
	$replace = ['SC', 'JP', 'KR', 'TC'];
	$fontNameNew = preg_filter($pattern, $replace, $fontName);
	if ($fontNameNew)
	{
		$fontName = $fontNameNew;
	}

	$fontName = ucwords($fontName);

	return $fontName;
}