Quantcast

Use LSM-3.0 to make the font stuff easier to deal with.

Ackis [11-06-08 - 16:19]
Use LSM-3.0 to make the font stuff easier to deal with.
Filename
.pkgmeta
ARLFrame.lua
AckisRecipeList.lua
AckisRecipeList.toc
diff --git a/.pkgmeta b/.pkgmeta
index 5364493..64ac58f 100644
--- a/.pkgmeta
+++ b/.pkgmeta
@@ -27,4 +27,5 @@ externals:
 	libs/LibBabble-Faction-3.0: svn://svn.wowace.com/wow/libbabble-faction-3-0/mainline/trunk
 	libs/LibBabble-Boss-3.0: svn://svn.wowace.com/wow/libbabble-boss-3-0/mainline/trunk
 	libs/LibBabble-Zone-3.0: svn://svn.wowace.com/wow/libbabble-zone-3-0/mainline/trunk
-	libs/LibAboutPanel: svn://svn.curseforge.net/wow/libaboutpanel/mainline/trunk
\ No newline at end of file
+	libs/LibAboutPanel: svn://svn.curseforge.net/wow/libaboutpanel/mainline/trunk
+	libs/LibSharedMedia-3.0: svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/tags/2
diff --git a/ARLFrame.lua b/ARLFrame.lua
index 4672add..8e01d33 100644
--- a/ARLFrame.lua
+++ b/ARLFrame.lua
@@ -34,17 +34,35 @@ local sortedRecipeIndex = {}
 local DisplayStrings = {}
 local myFaction = ""

--- Constants for use within this file
-local locale = GetLocale()
-local narrowFont = "Fonts\\ARIALN.TTF"
-local normalFont = "Fonts\\FRIZQT__.TTF"
+local narrowFont = nil
+local normalFont = nil

--- Fix for font issues on koKR
+-- Fallback in case the user doesn't have LSM-3.0 installed
+if (not LibStub:GetLibrary("LibSharedMedia-3.0", true)) then

-if (locale == "koKR") or (locale == "zhTW") or (locale == "zhCN") then
+	local locale = GetLocale()

-	narrowFont = "Fonts\\2002.TTF"
-	normalFont = "Fonts\\2002.TTF"
+	-- Fix for font issues on koKR
+
+	if (locale == "koKR") then
+
+		narrowFont = "Fonts\\2002.TTF"
+		normalFont = "Fonts\\2002.TTF"
+
+	else
+
+		narrowFont = "Fonts\\ARIALN.TTF"
+		normalFont = "Fonts\\FRIZQT__.TTF"
+
+	end
+
+else
+
+	-- Register LSM 3.0
+	local LSM3 = LibStub("LibSharedMedia-3.0")
+
+	narrowFont = LSM3:Fetch(LSM3.MediaType.FONT, "Arial Narrow")
+	normalFont = LSM3:Fetch(LSM3.MediaType.FONT, "Friz Quadrata TT")

 end

diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua
index a839dd3..977c02c 100644
--- a/AckisRecipeList.lua
+++ b/AckisRecipeList.lua
@@ -1208,6 +1208,8 @@ end
 -- Input: Recipe Array, Skill level for current profession, name of current profession, and current profession Specialty
 -- Output: Number of recipes that are filtered

+-- http://ace.pastey.net/100849
+
 function addon:UpdateFilters(RecipeDB, AllSpecialtiesTable, playerData)

 	local playerProfessionLevel = playerData.playerProfessionLevel
diff --git a/AckisRecipeList.toc b/AckisRecipeList.toc
index 73de39b..0ce691f 100644
--- a/AckisRecipeList.toc
+++ b/AckisRecipeList.toc
@@ -30,7 +30,7 @@
 ## X-Feedback: http://wow.curse.com/downloads/wow-addons/details/arl.aspx

 ## Dependencies:
-## OptionalDeps: Ace3, LibStub, CallbackHandler-1.0, LibAboutPanel, LibBabble-Zone-3.0, LibBabble-Faction-3.0, LibBabble-Boss-3.0, Skillet, ATSW, Manufac
+## OptionalDeps: Ace3, LibStub, CallbackHandler-1.0, LibAboutPanel, LibBabble-Zone-3.0, LibBabble-Faction-3.0, LibBabble-Boss-3.0, LibSharedMedia-3.0, Skillet, ATSW, Manufac
 ## DefaultState: Enabled
 ## LoadOnDemand: 0