diff options
| author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2019-03-13 14:21:38 +0200 | 
|---|---|---|
| committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2019-03-13 14:21:38 +0200 | 
| commit | eed5671681cc508fe0f06b06018e5a14894d4f32 (patch) | |
| tree | e15db75029d6dcd0c7fb1bfeb8bd73713e6c364c | |
| parent | 4cf87635396a793a76e71e66560cdd6c93955255 (diff) | |
SL-10610 mac fix for showing special characters
| -rw-r--r-- | indra/llrender/llfontregistry.cpp | 31 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/fonts.xml | 1 | 
2 files changed, 23 insertions, 9 deletions
| diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index 3c829596ce..10896ecb5d 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -44,6 +44,8 @@ using std::map;  bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc);  bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node); +const std::string MACOSX_FONT_PATH_LIBRARY = "/Library/Fonts/"; +  LLFontDescriptor::LLFontDescriptor():  	mStyle(0)  { @@ -434,24 +436,35 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)  		++file_name_it)  	{  		LLFontGL *fontp = new LLFontGL; -		std::string font_path = local_path + *file_name_it; +		string_vec_t font_paths; +		font_paths.push_back(local_path + *file_name_it); +		font_paths.push_back(sys_path + *file_name_it); +#if LL_DARWIN +		font_paths.push_back(MACOSX_FONT_PATH_LIBRARY + *file_name_it); +#endif  		// *HACK: Fallback fonts don't render, so we can use that to suppress  		// creation of OpenGL textures for test apps. JC  		BOOL is_fallback = !is_first_found || !mCreateGLTextures;  		F32 extra_scale = (is_fallback)?fallback_scale:1.0; -		if (!fontp->loadFace(font_path, extra_scale * point_size, -							 LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback)) +		F32 point_size_scale = extra_scale * point_size; +		bool is_font_loaded = false; +		for(string_vec_t::iterator font_paths_it = font_paths.begin(); +			font_paths_it != font_paths.end(); +			++font_paths_it)  		{ -			font_path = sys_path + *file_name_it; - -			if (!fontp->loadFace(font_path, extra_scale * point_size, +			if (fontp->loadFace(*font_paths_it, point_size_scale,  								 LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback))  			{ -				LL_INFOS_ONCE("LLFontRegistry") << "Couldn't load font " << *file_name_it << " from path " << local_path << LL_ENDL; -				delete fontp; -				fontp = NULL; +				is_font_loaded = true; +				break;  			}  		} +		if(!is_font_loaded) +		{ +			LL_INFOS_ONCE("LLFontRegistry") << "Couldn't load font " << *file_name_it <<  LL_ENDL; +			delete fontp; +			fontp = NULL; +		}  		if(fontp)  		{ diff --git a/indra/newview/skins/default/xui/en/fonts.xml b/indra/newview/skins/default/xui/en/fonts.xml index 8b1d50e58f..6ef7195ebf 100644 --- a/indra/newview/skins/default/xui/en/fonts.xml +++ b/indra/newview/skins/default/xui/en/fonts.xml @@ -21,6 +21,7 @@        <file>AppleSDGothicNeo-Regular.otf</file>        <file>华文细黑.ttf</file>        <file>PingFang.ttc</file> +      <file>STIXGeneral.otf</file>      </os>    </font> | 
