Added basic font size adjustment pref (needs better desc and additional work in prefs)

meow-7.2.2
Kadah_Coba 2011-08-21 18:00:44 -07:00
parent c0d9045764
commit b8cdfea2f0
8 changed files with 38 additions and 20 deletions

View File

@ -170,6 +170,7 @@ void init_llui()
gDirUtilp->getAppRODataDir(),
LLUI::getXUIPaths(),
"fonts.xml",
f.0,
false ); // don't create gl textures
LLFloaterView::Params fvparams;

View File

@ -799,7 +799,7 @@ const LLFontDescriptor& LLFontGL::getFontDesc() const
}
// static
void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::string& app_dir, const std::vector<std::string>& xui_paths, const std::string& fonts_file, bool create_gl_textures)
void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::string& app_dir, const std::vector<std::string>& xui_paths, const std::string& fonts_file, F32 size_mod, bool create_gl_textures)
{
sVertDPI = (F32)llfloor(screen_dpi * y_scale);
sHorizDPI = (F32)llfloor(screen_dpi * x_scale);
@ -810,7 +810,7 @@ void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::st
// Font registry init
if (!sFontRegistry)
{
sFontRegistry = new LLFontRegistry(xui_paths, create_gl_textures);
sFontRegistry = new LLFontRegistry(xui_paths, create_gl_textures, size_mod);
// Allow the user to pick the fonts
if (!sFontRegistry->parseFontInfo(fonts_file))
{

View File

@ -150,7 +150,7 @@ public:
const LLFontDescriptor& getFontDesc() const;
static void initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::string& app_dir, const std::vector<std::string>& xui_paths, const std::string& fonts_file, bool create_gl_textures = true);
static void initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::string& app_dir, const std::vector<std::string>& xui_paths, const std::string& fonts_file, F32 size_mod = 0, bool create_gl_textures = true);
// Load sans-serif, sans-serif-small, etc.
// Slow, requires multiple seconds to load fonts.

View File

@ -164,8 +164,8 @@ LLFontDescriptor LLFontDescriptor::normalize() const
}
LLFontRegistry::LLFontRegistry(const string_vec_t& xui_paths,
bool create_gl_textures)
: mCreateGLTextures(create_gl_textures)
bool create_gl_textures, F32 size_mod)
: mCreateGLTextures(create_gl_textures), mFontSizeMod(size_mod)
{
// Propagate this down from LLUICtrlFactory so LLRender doesn't
// need an upstream dependency on LLUI.
@ -320,7 +320,9 @@ bool LLFontRegistry::initFromXML(LLXMLNodePtr node)
if (child->getAttributeString("name",size_name) &&
child->getAttributeF32("size",size_value))
{
mFontSizes[size_name] = size_value;
// mFontSizes[size_name] = size_value;
// +/- defualt font sizes -KC
mFontSizes[size_name] = size_value + mFontSizeMod;
}
}

View File

@ -68,7 +68,7 @@ public:
// create_gl_textures - set to false for test apps with no OpenGL window,
// such as llui_libtest
LLFontRegistry(const string_vec_t& xui_paths,
bool create_gl_textures);
bool create_gl_textures, F32 size_mod);
~LLFontRegistry();
// Load standard font info from XML file(s).
@ -107,6 +107,8 @@ private:
string_vec_t mUltimateFallbackList;
string_vec_t mXUIPaths;
bool mCreateGLTextures;
// +/- defualt font sizes -KC
F32 mFontSizeMod;
};
#endif // LL_LLFONTREGISTRY_H

View File

@ -15094,5 +15094,16 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>fonts.xml</integer>
</map>
<key>PhoenixFontSizeAdjustment</key>
<map>
<key>Comment</key>
<string>Number of points to add to the defualt font sizes</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -1527,7 +1527,8 @@ LLViewerWindow::LLViewerWindow(
mDisplayScale.mV[VY],
gDirUtilp->getAppRODataDir(),
LLUI::getXUIPaths(),
gSavedSettings.getString("PhoenixFontSettingsFile"));
gSavedSettings.getString("PhoenixFontSettingsFile"),
gSavedSettings.getF32("PhoenixFontSizeAdjustment"));
// Create container for all sub-views
LLView::Params rvp;
@ -4579,7 +4580,8 @@ void LLViewerWindow::initFonts(F32 zoom_factor)
mDisplayScale.mV[VY] * zoom_factor,
gDirUtilp->getAppRODataDir(),
LLUI::getXUIPaths(),
gSavedSettings.getString("PhoenixFontSettingsFile"));
gSavedSettings.getString("PhoenixFontSettingsFile"),
gSavedSettings.getF32("PhoenixFontSizeAdjustment"));
// Force font reloads, which can be very slow
LLFontGL::loadDefaultFonts();
}

View File

@ -672,6 +672,7 @@
min_val="1"
max_val="1.75"
name="chat_line_spacing_slider" />
-->
<text
name="tooltip_textbox"
@ -683,35 +684,34 @@
follows="left|top"
type="string"
length="1">
Small Font Size:
Font Size Adjustment:
</text>
<spinner
name="chat_line_spacing_slider"
top_delta="-5"
left_pad="5"
height="18"
width="40"
width="50"
layout="topleft"
follows="left|top"
control_name="PhoenixFontSizeSmall"
increment="1"
decimal_digits="0"
initial_val="10"
min_val="6"
max_val="14" />
control_name="PhoenixFontSizeAdjustment"
increment=".1"
decimal_digits="1"
initial_val="0"
min_val="-1"
max_val="2" />
<text
name="tooltip_textbox"
top_delta="5"
left_pad="3"
height="16"
width="80"
width="335"
layout="topleft"
follows="left|top"
type="string"
length="1">
pt (defualt 10)
pt (defualt 0, larger values may not work well, requires restart)
</text>
-->
<!-- not a live preview
<text