diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2026-01-27 00:02:44 +0200 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-01-27 06:41:19 +0200 |
| commit | 343190399399a3b1d5ce64739163163e32ab1a1f (patch) | |
| tree | c7daa279d32155a11821b4393d44514d2bea265f /indra/llrender/llfontregistry.cpp | |
| parent | 92dc2af47d5fc904e30024db71de13013123f7fc (diff) | |
Restore DejaVuSans as a fallback, but alter size
Diffstat (limited to 'indra/llrender/llfontregistry.cpp')
| -rw-r--r-- | indra/llrender/llfontregistry.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index 777bba3f25..370b08319f 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -181,16 +181,16 @@ LLFontDescriptor LLFontDescriptor::normalize() const return LLFontDescriptor(new_name,new_size,new_style, getFontFiles(), getFontCollectionFiles()); } -void LLFontDescriptor::addFontFile(const std::string& file_name, EFontHinting hinting, S32 flags, const std::string& char_functor) +void LLFontDescriptor::addFontFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, const std::string& char_functor) { char_functor_map_t::const_iterator it = mCharFunctors.find(char_functor); - mFontFiles.push_back(LLFontFileInfo(file_name, hinting, flags, (mCharFunctors.end() != it) ? it->second : nullptr)); + mFontFiles.push_back(LLFontFileInfo(file_name, hinting, flags, size_delta, (mCharFunctors.end() != it) ? it->second : nullptr)); } -void LLFontDescriptor::addFontCollectionFile(const std::string& file_name, EFontHinting hinting, S32 flags, const std::string& char_functor) +void LLFontDescriptor::addFontCollectionFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, const std::string& char_functor) { char_functor_map_t::const_iterator it = mCharFunctors.find(char_functor); - mFontCollectionFiles.push_back(LLFontFileInfo(file_name, hinting, flags, (mCharFunctors.end() != it) ? it->second : nullptr)); + mFontCollectionFiles.push_back(LLFontFileInfo(file_name, hinting, flags, size_delta, (mCharFunctors.end() != it) ? it->second : nullptr)); } LLFontRegistry::LLFontRegistry(bool create_gl_textures) @@ -329,17 +329,23 @@ bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc) } } + F32 size_delta = 0.f; + if (child->hasAttribute("size_delta")) + { + child->getAttributeF32("size_delta", size_delta); + } + if (child->hasAttribute("load_collection")) { bool col = false; child->getAttributeBOOL("load_collection", col); if (col) { - desc.addFontCollectionFile(font_file_name, hinting, flags, char_functor); + desc.addFontCollectionFile(font_file_name, hinting, flags, size_delta, char_functor); } } - desc.addFontFile(font_file_name, hinting, flags, char_functor); + desc.addFontFile(font_file_name, hinting, flags, size_delta, char_functor); } else if (child->hasName("os")) { @@ -496,7 +502,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) // Add ultimate fallback list - generated dynamically on linux, // null elsewhere. std::transform(getUltimateFallbackList().begin(), getUltimateFallbackList().end(), std::back_inserter(font_files), - [](const std::string& file_name) { return LLFontFileInfo(file_name, EFontHinting::FORCE_AUTOHINT, 0); }); + [](const std::string& file_name) { return LLFontFileInfo(file_name, EFontHinting::FORCE_AUTOHINT, 0, 0.f); }); // Load fonts based on names. if (font_files.empty()) @@ -551,7 +557,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) { fontp = new LLFontGL; } - if (fontp->loadFace(font_path, point_size_scale, + if (fontp->loadFace(font_path, point_size_scale + font_file_it->mSizeDelta, LLFontGL::sVertDPI, LLFontGL::sHorizDPI, is_fallback, i, font_file_it->mHinting, font_file_it->mFlags)) { is_font_loaded = true; |
