From d9e82ab14aaa3e0daceacda8cf72ade379e9caf1 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 26 Jan 2023 17:04:35 -0800 Subject: DRTVWR-489-emoji: Pull in some small changes from Kitty's work to move the macOS build forwards --- indra/llrender/llfontregistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index 44f2bd4cc5..c9a9ee3a03 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -483,7 +483,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) #if LL_DARWIN font_search_paths.push_back(MACOSX_FONT_PATH_LIBRARY); font_search_paths.push_back(MACOSX_FONT_PATH_LIBRARY + MACOSX_FONT_SUPPLEMENTAL); - font_search_paths.push_back(sys_path + MACOSX_FONT_SUPPLEMENTAL); + font_search_paths.push_back(LLFontGL::getFontPathSystem() + MACOSX_FONT_SUPPLEMENTAL); #endif // The fontname string may contain multiple font file names separated by semicolons. -- cgit v1.2.3 From b2f890408e2dc63a0f842273c41c0efed770cb9a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 2 Feb 2023 00:34:24 +0200 Subject: SL-19089 Changing UI scale crashes viewer This makes no sense, trying to add a glyph now will have no width or height set, neither character width or heigh, yet release viewer does that. Fixed code to match release and set width and height despite char width not being up to date. --- indra/llrender/llfontbitmapcache.cpp | 14 ++++++++++++++ indra/llrender/llfontfreetype.cpp | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index 8809f9f475..42b0045cf3 100644 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp @@ -92,6 +92,20 @@ BOOL LLFontBitmapCache::nextOpenPos(S32 width, S32& pos_x, S32& pos_y, EFontGlyp { // We're out of space in the current image, or no image // has been allocated yet. Make a new one. + + S32 image_width = mMaxCharWidth * 20; + S32 pow_iw = 2; + while (pow_iw < image_width) + { + pow_iw *= 2; + } + image_width = pow_iw; + image_width = llmin(512, image_width); // Don't make bigger than 512x512, ever. + S32 image_height = image_width; + + mBitmapWidth = image_width; + mBitmapHeight = image_height; + S32 num_components = getNumComponents(bitmap_type); mImageRawVec[bitmap_idx].push_back(new LLImageRaw(mBitmapWidth, mBitmapHeight, num_components)); bitmap_num = mImageRawVec[bitmap_idx].size() - 1; diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 5535c07615..e4010579b3 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -798,11 +798,11 @@ void LLFontFreetype::setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32 llassert(!mIsFallback); llassert(image_raw && (image_raw->getComponents() == 2)); - U8 *target = image_raw->getData(); + llassert(target); - if (!data) + if (!data || !target) { return; } -- cgit v1.2.3