From b41717bc60cf72aef2257c6573201bd74210c428 Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Fri, 22 Oct 2010 17:20:34 -0500
Subject: Added FontSizeMultiplier and FontSizeRounding settings.

Gives more control over font sizes, addresses font being smaller
than some users desire.
---
 linden/indra/llrender/llfontregistry.cpp       | 10 +++++++++-
 linden/indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/linden/indra/llrender/llfontregistry.cpp b/linden/indra/llrender/llfontregistry.cpp
index 9792a91..c5923cd 100644
--- a/linden/indra/llrender/llfontregistry.cpp
+++ b/linden/indra/llrender/llfontregistry.cpp
@@ -442,7 +442,15 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
 		std::string font_path = local_path + *file_name_it;
 		BOOL is_fallback = !is_first_found;
 		F32 size_mult = (is_fallback ? 1 : match_desc->getSizeMult());
-		F32 size = (F32)llround(point_size * size_mult);
+		if (gSavedSettings.getF32("FontSizeMultiplier") > 0)
+		{
+			size_mult *= gSavedSettings.getF32("FontSizeMultiplier");
+		}
+		F32 size = (F32)(point_size * size_mult);
+		if (gSavedSettings.getBOOL("FontSizeRounding"))
+		{
+			size = (F32)llround(size);
+		}
 		if (!fontp->loadFace(font_path, size,
 							 LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback))
 		{
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 8c280d4..7b37bb6 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -396,6 +396,28 @@
     <key>Value</key>
     <string>DroidSans</string>
   </map>
+  <key>FontSizeMultiplier</key>
+  <map>
+    <key>Comment</key>
+    <string>Multiply all font sizes by this amount. Requires viewer restart.</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>F32</string>
+    <key>Value</key>
+    <string>1.0</string>
+  </map>
+  <key>FontSizeRounding</key>
+  <map>
+    <key>Comment</key>
+    <string>Round all font sizes to integer values, to potentially reduce font blurriness. The rounding occurs after FontSizeMultiplier is applied. Requires viewer restart.</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
   <key>GoAction</key>
   <map>
     <key>Comment</key>
-- 
cgit v1.1