From 7269f7a3a567f2823b0cca1d0bc716a7a0389ecc Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 8 Aug 2023 22:16:09 +0300 Subject: viewer#2023 Google Inter --- indra/llrender/llfontgl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llrender/llfontgl.cpp') diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 16eec1fdd2..d95eea526b 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -90,14 +90,14 @@ void LLFontGL::destroyGL() mFontFreetype->destroyGL(); } -bool LLFontGL::loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, bool is_fallback, S32 face_n) +bool LLFontGL::loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, bool is_fallback, S32 face_n, EFontHinting hinting, S32 flags) { if(mFontFreetype == reinterpret_cast(NULL)) { mFontFreetype = new LLFontFreetype; } - return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, is_fallback, face_n); + return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, is_fallback, face_n, hinting, flags); } S32 LLFontGL::getNumFaces(const std::string& filename) -- cgit v1.3 From 6ee601c642b3a4fa182334eb1ca015d71d6eaedd Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Tue, 14 Apr 2026 23:17:36 +0300 Subject: #2023 Load from a variable font WIP, beacsue variable fonts are not yeat included. --- autobuild.xml | 4 +- indra/llrender/llfontfreetype.cpp | 106 +++++++++++++++++++++++---- indra/llrender/llfontfreetype.h | 4 +- indra/llrender/llfontgl.cpp | 4 +- indra/llrender/llfontgl.h | 2 +- indra/llrender/llfontregistry.cpp | 22 ++++-- indra/llrender/llfontregistry.h | 11 ++- indra/newview/skins/default/xui/en/fonts.xml | 22 +++--- indra/newview/skins/default/xui/ja/fonts.xml | 62 +++++----------- 9 files changed, 151 insertions(+), 86 deletions(-) (limited to 'indra/llrender/llfontgl.cpp') diff --git a/autobuild.xml b/autobuild.xml index 32c9bc27af..2580a4dc65 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2493,11 +2493,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors creds github hash - 9bd007dd70635d85d716ca00484cefa700cdb6f0 + 164a34f4bac8a886217bffb68464a883f8f14cc6 hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-google-fonts/releases/assets/365756469 + https://api.github.com/repos/secondlife/3p-google-fonts/releases/assets/396854332 name common diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 063e308da0..9b00df2bf6 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -39,6 +39,7 @@ // For some reason, this won't work if it's not wrapped in the ifdef #ifdef FT_FREETYPE_H #include FT_FREETYPE_H +#include FT_MULTIPLE_MASTERS_H #endif #include "lldir.h" @@ -165,7 +166,7 @@ LLFontFreetype::~LLFontFreetype() // mFallbackFonts cleaned up by LLPointer destructor } -bool LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, bool is_fallback, S32 face_n, EFontHinting hinting, S32 flags) +bool LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 weight, bool is_fallback, S32 face_n, EFontHinting hinting, S32 flags) { // Don't leak face objects. This is also needed to deal with // changed font file names. @@ -191,6 +192,18 @@ bool LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v mIsFallback = is_fallback; mHinting = hinting; mFontFlags = flags; + mWeight = weight; + + bool variable_font = false; + if (weight >= 0) + { + variable_font = setVariationAxis("wght", static_cast(weight)); + + // For Inter, also set optical size based on point size + // This makes text look better at different sizes + setVariationAxis("opsz", point_size); + } + F32 pixels_per_em = (point_size / 72.f)*vert_dpi; // Size in inches * dpi error = FT_Set_Char_Size(mFTFace, /* handle to face object */ @@ -252,6 +265,12 @@ bool LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v // Ex: Inter SemiBold doesn't have FT_STYLE_FLAG_BOLD and without this style it would be bolded programmatically. mStyle |= LLFontGL::BOLD; } + else if (weight >= 600 && variable_font) + { + // If the font is heavy enough, consider it bold and avoid programmatic bolding + // even if it doesn't have the bold style set. + mStyle |= LLFontGL::BOLD; + } if(mFTFace->style_flags & FT_STYLE_FLAG_ITALIC) { @@ -359,12 +378,8 @@ F32 LLFontFreetype::getXKerning(llwchar char_left, llwchar char_right) const llverify(!FT_Get_Kerning(mFTFace, left_glyph, right_glyph, ft_kerning_unfitted, &delta)); - if (mFTFace->face_flags & FT_FACE_FLAG_SCALABLE) - { - // Return the X advance - return (F32)(delta.x * (1.0 / 64.0)); - } - return (F32)delta.x; + // ft_kerning_unfitted mode always returns 26.6 fixed-point values + return (F32)(delta.x * (1.0 / 64.0)); } F32 LLFontFreetype::getXKerning(const LLFontGlyphInfo* left_glyph_info, const LLFontGlyphInfo* right_glyph_info) const @@ -379,12 +394,8 @@ F32 LLFontFreetype::getXKerning(const LLFontGlyphInfo* left_glyph_info, const LL llverify(!FT_Get_Kerning(mFTFace, left_glyph, right_glyph, ft_kerning_unfitted, &delta)); - if (mFTFace->face_flags & FT_FACE_FLAG_SCALABLE) - { - // Return the X advance - return (F32)(delta.x * (1.0 / 64.0)); - } - return (F32)delta.x; + // ft_kerning_unfitted mode always returns 26.6 fixed-point values + return (F32)(delta.x * (1.0 / 64.0)); } bool LLFontFreetype::hasGlyph(llwchar wch) const @@ -697,7 +708,7 @@ void LLFontFreetype::renderGlyph(EFontGlyphType bitmap_type, U32 glyph_index, ll void LLFontFreetype::reset(F32 vert_dpi, F32 horz_dpi) { resetBitmapCache(); - loadFace(mName, mPointSize, vert_dpi ,horz_dpi, mIsFallback, 0, mHinting, mFontFlags); + loadFace(mName, mPointSize, vert_dpi ,horz_dpi, mWeight, mIsFallback, 0, mHinting, mFontFlags); if (!mIsFallback) { // This is the head of the list - need to rebuild ourself and all fallbacks. @@ -865,6 +876,73 @@ void LLFontFreetype::setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32 } } +bool LLFontFreetype::setVariationAxis(const std::string& axis_tag, F32 value) +{ + if (!mFTFace) + return false; + + // Check if this is a variable font + FT_MM_Var* master = nullptr; + if (FT_Get_MM_Var(mFTFace, &master) != 0) + { + // Not a variable font - this is not an error, just silently skip + return false; + } + + // Find the axis by tag (e.g., "wght" for weight) + FT_UInt axis_index = 0; + bool found = false; + for (FT_UInt i = 0; i < master->num_axis; i++) + { + // Compare the 4-byte tag + if (master->axis[i].tag == FT_MAKE_TAG(axis_tag[0], axis_tag[1], axis_tag[2], axis_tag[3])) + { + axis_index = i; + found = true; + + // Clamp value to valid range for this axis + F32 min_val = master->axis[i].minimum / 65536.0f; + F32 max_val = master->axis[i].maximum / 65536.0f; + value = llclamp(value, min_val, max_val); + + break; + } + } + + if (!found) + { + FT_Done_MM_Var(gFTLibrary, master); + LL_WARNS_ONCE("FontVariation") << "Axis '" << axis_tag << "' not found in font: " << mName << LL_ENDL; + return false; + } + + FT_UInt num_coords = master->num_axis; + FT_Fixed* coords = new FT_Fixed[num_coords]; + + // Get current coordinates + FT_Get_Var_Design_Coordinates(mFTFace, num_coords, coords); + + // Update the specific axis + coords[axis_index] = (FT_Fixed)(value * 65536.0f); + + // Set all coordinates + int error = FT_Set_Var_Design_Coordinates(mFTFace, num_coords, coords); + + delete[] coords; + FT_Done_MM_Var(gFTLibrary, master); + + if (error != 0) + { + LL_WARNS() << "Failed to set variation coordinates for " << axis_tag + << " = " << value << " in font: " << mName << LL_ENDL; + return false; + } + + LL_INFOS("FontVariation") << "Set " << axis_tag << " = " << value + << " for font: " << mName << LL_ENDL; + return true; +} + namespace ll { diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index 96f99fd31c..d2b128e4ce 100644 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -101,7 +101,7 @@ public: // is_fallback should be true for fallback fonts that aren't used // to render directly (Unicode backup, primarily) - bool loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, bool is_fallback, S32 face_n, EFontHinting hinting, S32 flags); + bool loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 weight, bool is_fallback, S32 face_n, EFontHinting hinting, S32 flags); S32 getNumFaces(const std::string& filename); @@ -163,6 +163,7 @@ private: void resetBitmapCache(); void setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32 width, U32 height, U8 *data, S32 stride = 0) const; bool setSubImageBGRA(U32 x, U32 y, U32 bitmap_num, U16 width, U16 height, const U8* data, U32 stride) const; + bool setVariationAxis(const std::string& axis_tag, F32 value); bool hasGlyph(llwchar wch) const; // Has a glyph for this character LLFontGlyphInfo* addGlyph(llwchar wch, EFontGlyphType glyph_type) const; // Add a new character to the font if necessary LLFontGlyphInfo* addGlyphFromFont( @@ -187,6 +188,7 @@ private: bool mIsFallback; EFontHinting mHinting; S32 mFontFlags; + S32 mWeight = -1; typedef std::pair, char_functor_t> fallback_font_t; typedef std::vector fallback_font_vector_t; fallback_font_vector_t mFallbackFonts; // A list of fallback fonts to look for glyphs in (for Unicode chars) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index d95eea526b..b2ca9cce75 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -90,14 +90,14 @@ void LLFontGL::destroyGL() mFontFreetype->destroyGL(); } -bool LLFontGL::loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, bool is_fallback, S32 face_n, EFontHinting hinting, S32 flags) +bool LLFontGL::loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, S32 weight, bool is_fallback, S32 face_n, EFontHinting hinting, S32 flags) { if(mFontFreetype == reinterpret_cast(NULL)) { mFontFreetype = new LLFontFreetype; } - return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, is_fallback, face_n, hinting, flags); + return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, weight, is_fallback, face_n, hinting, flags); } S32 LLFontGL::getNumFaces(const std::string& filename) diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index 652cec8e5b..7743d61e40 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -87,7 +87,7 @@ public: void destroyGL(); - bool loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, bool is_fallback, S32 face_n, EFontHinting hinting, S32 flags); + bool loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, S32 weight, bool is_fallback, S32 face_n, EFontHinting hinting, S32 flags); S32 getNumFaces(const std::string& filename); S32 getCacheGeneration() const; diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index 370b08319f..a107b263d8 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, F32 size_delta, const std::string& char_functor) +void LLFontDescriptor::addFontFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight, const std::string& char_functor) { char_functor_map_t::const_iterator it = mCharFunctors.find(char_functor); - mFontFiles.push_back(LLFontFileInfo(file_name, hinting, flags, size_delta, (mCharFunctors.end() != it) ? it->second : nullptr)); + mFontFiles.push_back(LLFontFileInfo(file_name, hinting, flags, size_delta, weight, (mCharFunctors.end() != it) ? it->second : nullptr)); } -void LLFontDescriptor::addFontCollectionFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, const std::string& char_functor) +void LLFontDescriptor::addFontCollectionFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight, const std::string& char_functor) { char_functor_map_t::const_iterator it = mCharFunctors.find(char_functor); - mFontCollectionFiles.push_back(LLFontFileInfo(file_name, hinting, flags, size_delta, (mCharFunctors.end() != it) ? it->second : nullptr)); + mFontCollectionFiles.push_back(LLFontFileInfo(file_name, hinting, flags, size_delta, weight, (mCharFunctors.end() != it) ? it->second : nullptr)); } LLFontRegistry::LLFontRegistry(bool create_gl_textures) @@ -291,6 +291,7 @@ bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc) std::string char_functor; EFontHinting hinting = EFontHinting::FORCE_AUTOHINT; S32 flags = 0; + S32 weight = -1; if (child->hasAttribute("functor")) { @@ -335,17 +336,22 @@ bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc) child->getAttributeF32("size_delta", size_delta); } + if (child->hasAttribute("font_weight")) + { + child->getAttributeS32("font_weight", weight); + } + if (child->hasAttribute("load_collection")) { bool col = false; child->getAttributeBOOL("load_collection", col); if (col) { - desc.addFontCollectionFile(font_file_name, hinting, flags, size_delta, char_functor); + desc.addFontCollectionFile(font_file_name, hinting, flags, size_delta, weight, char_functor); } } - desc.addFontFile(font_file_name, hinting, flags, size_delta, char_functor); + desc.addFontFile(font_file_name, hinting, flags, size_delta, weight, char_functor); } else if (child->hasName("os")) { @@ -502,7 +508,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, 0.f); }); + [](const std::string& file_name) { return LLFontFileInfo(file_name, EFontHinting::FORCE_AUTOHINT, 0, 0.f, -1); }); // Load fonts based on names. if (font_files.empty()) @@ -558,7 +564,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) fontp = new LLFontGL; } 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)) + LLFontGL::sVertDPI, LLFontGL::sHorizDPI, font_file_it->mWeight, is_fallback, i, font_file_it->mHinting, font_file_it->mFlags)) { is_font_loaded = true; if (is_first_found) diff --git a/indra/llrender/llfontregistry.h b/indra/llrender/llfontregistry.h index a5fa9f338a..fcbb2667e4 100644 --- a/indra/llrender/llfontregistry.h +++ b/indra/llrender/llfontregistry.h @@ -43,21 +43,23 @@ enum class EFontHinting : S32 struct LLFontFileInfo { - LLFontFileInfo(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, const std::function& char_functor = nullptr) + LLFontFileInfo(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight, const std::function& char_functor = nullptr) : FileName(file_name) , CharFunctor(char_functor) , mHinting(hinting) , mFlags(flags) , mSizeDelta(size_delta) + , mWeight(weight) { } - LLFontFileInfo(const LLFontFileInfo& ffi, EFontHinting hinting, S32 flags, F32 size_delta) + LLFontFileInfo(const LLFontFileInfo& ffi, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight) : FileName(ffi.FileName) , CharFunctor(ffi.CharFunctor) , mHinting(hinting) , mFlags(flags) , mSizeDelta(size_delta) + , mWeight(weight) { } @@ -65,6 +67,7 @@ struct LLFontFileInfo std::function CharFunctor; EFontHinting mHinting; S32 mFlags; + S32 mWeight; // -1 - default, whatever is in the file. // Not all fonts are the same size, Ex: dejavu is bigger than inter, // so in some cases we want to adjust relative sizes to make characters @@ -91,10 +94,10 @@ public: const std::string& getSize() const { return mSize; } void setSize(const std::string& size) { mSize = size; } - void addFontFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, const std::string& char_functor = LLStringUtil::null); + void addFontFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight, const std::string& char_functor = LLStringUtil::null); const font_file_info_vec_t & getFontFiles() const { return mFontFiles; } void setFontFiles(const font_file_info_vec_t& font_files) { mFontFiles = font_files; } - void addFontCollectionFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, const std::string& char_functor = LLStringUtil::null); + void addFontCollectionFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight, const std::string& char_functor = LLStringUtil::null); const font_file_info_vec_t& getFontCollectionFiles() const { return mFontCollectionFiles; } void setFontCollectionFiles(const font_file_info_vec_t& font_collection_files) { mFontCollectionFiles = font_collection_files; } diff --git a/indra/newview/skins/default/xui/en/fonts.xml b/indra/newview/skins/default/xui/en/fonts.xml index 81f5d8afe2..efa4706485 100644 --- a/indra/newview/skins/default/xui/en/fonts.xml +++ b/indra/newview/skins/default/xui/en/fonts.xml @@ -4,7 +4,7 @@ - Inter_18pt-Regular.ttf + Inter-VariableFont_opsz,wght.ttf DejaVuSans.ttf TwemojiSVG.ttf @@ -37,7 +37,7 @@ - Inter_18pt-ExtraBold.ttf + Inter-VariableFont_opsz,wght.ttf DejaVuSans-Bold.ttf arialbd.ttf @@ -50,7 +50,7 @@ - Inter_18pt-Regular.ttf + Inter-VariableFont_opsz,wght.ttf DejaVuSans.ttf arial.ttf @@ -64,7 +64,7 @@ name="SansSerif" comment="Name of bold sans-serif font" font_style="BOLD"> - Inter_18pt-Bold.ttf + Inter-VariableFont_opsz,wght.ttf DejaVuSans-Bold.ttf @@ -72,7 +72,7 @@ name="SansSerif" comment="Name of italic sans-serif font" font_style="ITALIC"> - Inter_18pt-Italic.ttf + Inter-Italic-VariableFont_opsz,wght.ttf DejaVuSans-Oblique.ttf @@ -80,7 +80,7 @@ name="SansSerif" comment="Name of bold italic sans-serif font" font_style="BOLD|ITALIC"> - Inter_18pt-BoldItalic.ttf + Inter-Italic-VariableFont_opsz,wght.ttf DejaVuSans-BoldOblique.ttf @@ -121,7 +121,7 @@ - Inter_18pt-Regular.ttf + Inter-VariableFont_opsz,wght.ttf DejaVuSans.ttf arial.ttf @@ -135,7 +135,7 @@ name="Helvetica" comment="Name of Helvetica font (bold)" font_style="BOLD"> - Inter_18pt-ExtraBold.ttf + Inter-VariableFont_opsz,wght.ttf DejaVuSans-Bold.ttf arialbd.ttf @@ -149,7 +149,7 @@ name="Helvetica" comment="Name of Helvetica font (italic)" font_style="ITALIC"> - Inter_18pt-Italic.ttf + Inter-Italic-VariableFont_opsz,wght.ttf DejaVuSans-Oblique.ttf ariali.ttf @@ -163,7 +163,7 @@ name="Helvetica" comment="Name of Helvetica font (bold italic)" font_style="BOLD|ITALIC"> - Inter_18pt-BoldItalic.ttf + Inter-Italic-VariableFont_opsz,wght.ttf DejaVuSans-BoldOblique.ttf arialbi.ttf @@ -177,7 +177,7 @@ name="OverrideTest" comment="Name of font to test overriding"> times.ttf - Inter_18pt-Regular.ttf + Inter-VariableFont_opsz,wght.ttf NotoSansCJKjp-SemiBold.otf - - Inter_18pt-Regular.ttf - + Inter-VariableFont_opsz,wght.ttf YuGothM.ttc @@ -82,9 +80,7 @@ NotoSansCJKjp-Bold.otf - - Inter_18pt-SemiBold.ttf - + Inter-VariableFont_opsz,wght.ttf YuGothB.ttc @@ -104,11 +100,9 @@ - NotoSansCJKjp-Bold.otf + NotoSansCJKjp-SemiBold.otf - - Inter_18pt-Regular.ttf - + Inter-VariableFont_opsz,wght.ttf arial.ttf @@ -121,19 +115,13 @@ - - Inter_18pt-SemiBold.ttf - + Inter-VariableFont_opsz,wght.ttf - - Inter_18pt-Italic.ttf - + Inter-Italic-VariableFont_opsz,wght.ttf - - Inter_18pt-SemiBoldItalic.ttf - + Inter-Italic-VariableFont_opsz,wght.ttf @@ -144,29 +132,25 @@ - - Inter_18pt-Regular.ttf - + DejaVuSans.ttf - - Inter_18pt-SemiBold.ttf + + DejaVuSans-Bold.ttf - - Inter_18pt-Italic.ttf + + DejaVuSans-Oblique.ttf - - Inter_18pt-SemiBoldItalic.ttf + + DejaVuSans-BoldOblique.ttf - - Inter_18pt-Regular.ttf - + Inter-VariableFont_opsz,wght.ttf arial.ttf @@ -179,9 +163,7 @@ - - Inter_18pt-SemiBold.ttf - + Inter-VariableFont_opsz,wght.ttf arialbd.ttf @@ -194,9 +176,7 @@ - - Inter_18pt-Italic.ttf - + Inter-Italic-VariableFont_opsz,wght.ttf ariali.ttf @@ -209,9 +189,7 @@ - - Inter_18pt-SemiBoldItalic.ttf - + Inter-Italic-VariableFont_opsz,wght.ttf arialbi.ttf @@ -227,9 +205,7 @@ times.ttf - - Inter_18pt-Regular.ttf - + Inter-VariableFont_opsz,wght.ttf -- cgit v1.3 From 3a1b1038a5f412f8cbb7ebdae639a8d2e363981b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 22 Apr 2026 00:08:49 +0300 Subject: change default font to SansSerifSmall --- indra/llrender/llfontgl.cpp | 9 ++++++++- indra/llrender/llfontgl.h | 1 + indra/llrender/llfontregistry.cpp | 2 +- indra/llui/lluictrl.cpp | 2 +- indra/newview/llviewerchat.cpp | 2 +- .../skins/default/xui/en/floater_add_payment_method.xml | 4 ---- indra/newview/skins/default/xui/en/floater_buy_currency.xml | 13 ------------- .../skins/default/xui/en/floater_inventory_settings.xml | 11 ----------- indra/newview/skins/default/xui/en/floater_test_slapp.xml | 1 - indra/newview/skins/default/xui/en/floater_test_textbox.xml | 4 ++-- indra/newview/skins/default/xui/en/floater_toybox.xml | 2 -- indra/newview/skins/default/xui/en/fonts.xml | 2 +- indra/newview/skins/default/xui/en/panel_group_general.xml | 3 +-- indra/newview/skins/default/xui/en/panel_group_notices.xml | 1 - indra/newview/skins/default/xui/en/panel_hint.xml | 1 - indra/newview/skins/default/xui/en/panel_hint_image.xml | 1 - indra/newview/skins/default/xui/en/panel_main_inventory.xml | 1 - .../skins/default/xui/en/panel_marketplace_listings.xml | 1 - indra/newview/skins/default/xui/en/sidepanel_inventory.xml | 2 -- .../skins/default/xui/en/widgets/panel_camera_item.xml | 1 - 20 files changed, 16 insertions(+), 48 deletions(-) (limited to 'indra/llrender/llfontgl.cpp') diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index b2ca9cce75..5d99c35047 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -1115,7 +1115,14 @@ LLFontGL* LLFontGL::getFontSansSerifSmallItalic() //static LLFontGL* LLFontGL::getFontSansSerif() { - static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Medium",0)); + static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Small",0)); + return fontp; +} + +// static +LLFontGL* LLFontGL::getFontSansSerifMedium() +{ + static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif", "Medium", 0)); return fontp; } diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index 7743d61e40..3b82d8e43d 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -204,6 +204,7 @@ public: static LLFontGL* getFontSansSerifSmallBold(); static LLFontGL* getFontSansSerifSmallItalic(); static LLFontGL* getFontSansSerif(); + static LLFontGL* getFontSansSerifMedium(); static LLFontGL* getFontSansSerifBig(); static LLFontGL* getFontSansSerifHuge(); static LLFontGL* getFontSansSerifBold(); diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index a107b263d8..890308ab54 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -170,7 +170,7 @@ LLFontDescriptor LLFontDescriptor::normalize() const if (new_size != s_template_string && new_size.empty() && findSubString(new_name,"Monospace")) new_size = "Monospace"; if (new_size.empty()) - new_size = "Medium"; + new_size = "Small"; if (removeSubString(new_name,"Bold")) new_style |= LLFontGL::BOLD; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 05461edd82..9a27049d37 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -80,7 +80,7 @@ LLUICtrl::Params::Params() mouseenter_callback("mouseenter_callback"), mouseleave_callback("mouseleave_callback"), control_name("control_name"), - font("font", LLFontGL::getFontEmojiMedium()), + font("font", LLFontGL::getFontEmojiSmall()), font_halign("halign"), font_valign("valign"), length("length"), // ignore LLXMLNode cruft diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp index 2ca2c5c07d..a9aa63e68f 100644 --- a/indra/newview/llviewerchat.cpp +++ b/indra/newview/llviewerchat.cpp @@ -200,7 +200,7 @@ LLFontGL* LLViewerChat::getChatFont() break; default: case 1: - fontp = LLFontGL::getFontSansSerif(); + fontp = LLFontGL::getFontSansSerifMedium(); break; case 2: fontp = LLFontGL::getFontSansSerifBig(); diff --git a/indra/newview/skins/default/xui/en/floater_add_payment_method.xml b/indra/newview/skins/default/xui/en/floater_add_payment_method.xml index 8538c255bf..308f4feb5a 100644 --- a/indra/newview/skins/default/xui/en/floater_add_payment_method.xml +++ b/indra/newview/skins/default/xui/en/floater_add_payment_method.xml @@ -50,7 +50,6 @@ follows="top|left|right" height="24" label="Get started" - font="SansSerifMedium" layout="topleft" left="320" name="continue_btn" @@ -99,7 +98,6 @@ type="string" length="1" follows="top|left" - font="SansSerifMedium" text_color="White" height="75" width="260" @@ -114,7 +112,6 @@ type="string" length="1" follows="top|left" - font="SansSerifMedium" text_color="White" height="75" width="260" @@ -128,7 +125,6 @@ type="string" length="1" follows="top|left" - font="SansSerifMedium" text_color="White" height="75" width="260" diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index e8e83301be..5e0903a40f 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -93,7 +93,6 @@ type="string" length="1" follows="top|left" - font="SansSerifMedium" height="16" layout="topleft" left="20" @@ -105,7 +104,6 @@ Double-click on folder in multi-folder view: @@ -37,7 +36,6 @@ follows="left|top" top_pad="8" layout="topleft" - font="SansSerifMedium" left="60" width="300" height="66" @@ -90,7 +88,6 @@ left_pad="12" top_delta="2" name="single_folder_txt" - font="SansSerifMedium" text_color="White" width="300"> Double-click on folder in single-folder view: @@ -100,7 +97,6 @@ follows="left|top" top_pad="8" layout="topleft" - font="SansSerifMedium" left="60" width="300" height="44" @@ -142,7 +138,6 @@ layout="topleft" left_pad="13" name="find_original_txt" - font="SansSerifMedium" text_color="White" top_delta="1" width="310"> @@ -153,7 +148,6 @@ follows="left|top" top_pad="8" layout="topleft" - font="SansSerifMedium" left="60" width="300" height="44" @@ -196,7 +190,6 @@ left_pad="12" top_delta="2" name="favorites_txt" - font="SansSerifMedium" text_color="White" width="300"> Favorites @@ -206,7 +199,6 @@ layout="topleft" follows="left|top" top_pad="8" - font="SansSerifMedium" left="60" width="300" height="18" @@ -219,7 +211,6 @@ follows="left|top" top_pad="5" layout="topleft" - font="SansSerifMedium" left="60" width="150" height="18" @@ -232,7 +223,6 @@ follows="left|top" top_pad="5" layout="topleft" - font="SansSerifMedium" left="60" width="150" height="18" @@ -276,7 +266,6 @@ left_pad="12" top_delta="2" name="single_folder_txt" - font="SansSerifMedium" text_color="White" width="300"> Pressing enter on an avatar attachment diff --git a/indra/newview/skins/default/xui/en/floater_test_slapp.xml b/indra/newview/skins/default/xui/en/floater_test_slapp.xml index 5a13a0147e..35f5961285 100644 --- a/indra/newview/skins/default/xui/en/floater_test_slapp.xml +++ b/indra/newview/skins/default/xui/en/floater_test_slapp.xml @@ -17,7 +17,6 @@ follows="left|top|right" height="16" name="trusted_txt" - font="SansSerifMedium" text_color="white" layout="topleft" left="16"> diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml index 023df69f0f..e736fc58b2 100644 --- a/indra/newview/skins/default/xui/en/floater_test_textbox.xml +++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml @@ -99,7 +99,7 @@ font.name="SansSerifSmall" name="test_text10" tool_tip="text"> - SansSerifSmall + SansSerif The 华文细黑 brown fox ヒラキjumped over the lazy dog. - SansSerif + SansSerifMedium The 华文细黑 brown fox ヒラキjumped over the lazy dog. diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml index 61cd6a83d4..371147b28a 100644 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml @@ -108,7 +108,6 @@ left="2" width="306" halign="center" - font="SansSerifMedium" font_shadow="hard" valign="top"> Drop folders here to create new listings diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index de47e05291..3fc22d69ca 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -69,7 +69,6 @@