Thread Tools Display Modes
03-13-17, 01:41 PM   #1
Ansi
An Aku'mai Servant
 
Ansi's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Changing font in rChat

http://www.wowinterface.com/downloads/info18319-rChat.html#comments

I can't figure it out... This isn't working:

Lua Code:
  1. cfg.editbox = {}
  2. cfg.editbox.font = {Fonts\\ARIALN.TTF, 14, "OUTLINE"}
  3. cfg.chat = {}
  4. cfg.chat.font = {Fonts\\ARIALN.TTF, 12, "OUTLINE"}

Just wanna change the font to the standard ARIALN.

Anyone?
__________________
twitter.com/ansirox
  Reply With Quote
03-13-17, 07:21 PM   #2
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 309
You're missing some quotes around the font.
__________________
AddOns: Tim @ WoWInterface
Battle Tag: Mysterio#11164
Current PC Setup: PCPartPicker List
  Reply With Quote
03-14-17, 04:16 AM   #3
Ansi
An Aku'mai Servant
 
Ansi's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Doesnt work with quotes either. Here's the entire beauty:


Lua Code:
  1. -- rChat: core
  2. -- zork, 2016
  3.  
  4. -----------------------------
  5. -- Variables
  6. -----------------------------
  7.  
  8. local A, L = ...
  9.  
  10. local DefaultSetItemRef = SetItemRef
  11.  
  12. local cfg = {}
  13. cfg.dropshadow = {}
  14. cfg.dropshadow.offset = {1,-1}
  15. cfg.dropshadow.color = {0,0,0,0.9}
  16. cfg.editbox = {}
  17. cfg.editbox.font = {"Fonts\\ARIALN.ttf"}, 12}
  18. cfg.chat = {}
  19. cfg.chat.font = {"Fonts\\ARIALN.ttf"}, 12}
  20.  
  21. -----------------------------
  22. -- Functions
  23. -----------------------------
  24.  
  25. --SkinChat
  26. local function SkinChat(self)
  27.   if not self then return end
  28.   local name = self:GetName()
  29.   --chat frame resizing
  30.   self:SetClampRectInsets(0, 0, 0, 0)
  31.   self:SetMaxResize(UIParent:GetWidth()/2, UIParent:GetHeight()/2)
  32.   self:SetMinResize(100, 50)
  33.   self:SetFont(unpack(cfg.chat.font))
  34.   self:SetShadowOffset(unpack(cfg.dropshadow.offset))
  35.   self:SetShadowColor(unpack(cfg.dropshadow.color))
  36.   --chat fading
  37.   self:SetFading(false)
  38.   --hide button frame
  39.   local bf = _G[name.."ButtonFrame"]
  40.   bf:HookScript("OnShow", bf.Hide)
  41.   bf:Hide()
  42.   --editbox
  43.   local eb = _G[name.."EditBox"]
  44.   eb:SetAltArrowKeyMode(false)
  45.   --textures
  46.   _G[name.."EditBoxLeft"]:Hide()
  47.   _G[name.."EditBoxMid"]:Hide()
  48.   _G[name.."EditBoxRight"]:Hide()
  49.   --reposition
  50.   eb:ClearAllPoints()
  51.   if name == "ChatFrame2" then
  52.     eb:SetPoint("BOTTOM",self,"TOP",0,22+24) --CombatLogQuickButtonFrame_Custom:GetHeight()
  53.   else
  54.     eb:SetPoint("BOTTOM",self,"TOP",0,22)
  55.   end
  56.   eb:SetPoint("LEFT",self,-5,0)
  57.   eb:SetPoint("RIGHT",self,10,0)
  58. end
  59.  
  60. --OpenTemporaryWindow
  61. local function OpenTemporaryWindow()
  62.   for _, name in next, CHAT_FRAMES do
  63.     local frame = _G[name]
  64.     if (frame.isTemporary) then
  65.       SkinChat(frame)
  66.     end
  67.   end
  68. end
  69.  
  70. --OnMOuseScroll
  71. local function OnMOuseScroll(self,dir)
  72.   if(dir > 0) then
  73.     if(IsShiftKeyDown()) then self:ScrollToTop() else self:ScrollUp() end
  74.   else
  75.     if(IsShiftKeyDown()) then self:ScrollToBottom() else self:ScrollDown() end
  76.   end
  77. end
  78.  
  79. --we replace the default setitemref and use it to parse links for alt invite and url copy
  80. function SetItemRef(link, ...)
  81.   local type, value = link:match("(%a+):(.+)")
  82.   if IsAltKeyDown() and type == "player" then
  83.     InviteUnit(value:match("([^:]+)"))
  84.   elseif (type == "url") then
  85.     local eb = LAST_ACTIVE_CHAT_EDIT_BOX or ChatFrame1EditBox
  86.     if not eb then return end
  87.     eb:SetText(value)
  88.     eb:SetFocus()
  89.     eb:HighlightText()
  90.     if not eb:IsShown() then eb:Show() end
  91.   else
  92.     return DefaultSetItemRef(link, ...)
  93.   end
  94. end
  95.  
  96. --AddMessage
  97. local function AddMessage(self, text, ...)
  98.   --channel replace (Trade and such)
  99.   text = text:gsub('|h%[(%d+)%. .-%]|h', '|h%1.|h')
  100.   --url search
  101.   text = text:gsub('([wWhH][wWtT][wWtT][%.pP]%S+[^%p%s])', '|cffffffff|Hurl:%1|h[%1]|h|r')
  102.   return self.DefaultAddMessage(self, text, ...)
  103. end
  104.  
  105. -----------------------------
  106. -- Stuff
  107. -----------------------------
  108.  
  109. --editbox font
  110. ChatFontNormal:SetFont(unpack(cfg.editbox.font))
  111. ChatFontNormal:SetShadowOffset(unpack(cfg.dropshadow.offset))
  112. ChatFontNormal:SetShadowColor(unpack(cfg.dropshadow.color))
  113.  
  114. --font size
  115. CHAT_FONT_HEIGHTS = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
  116.  
  117. --tabs
  118. CHAT_TAB_HIDE_DELAY = 1
  119. CHAT_FRAME_TAB_NORMAL_MOUSEOVER_ALPHA = 1
  120. CHAT_FRAME_TAB_NORMAL_NOMOUSE_ALPHA = 0
  121. CHAT_FRAME_TAB_SELECTED_MOUSEOVER_ALPHA = 1
  122. CHAT_FRAME_TAB_SELECTED_NOMOUSE_ALPHA = 0
  123. CHAT_FRAME_TAB_ALERTING_MOUSEOVER_ALPHA = 1
  124. CHAT_FRAME_TAB_ALERTING_NOMOUSE_ALPHA = 1
  125.  
  126. --channels
  127. CHAT_WHISPER_GET              = "<< %s "
  128. CHAT_WHISPER_INFORM_GET       = ">> %s "
  129. CHAT_BN_WHISPER_GET           = "<< %s "
  130. CHAT_BN_WHISPER_INFORM_GET    = ">> %s "
  131. CHAT_YELL_GET                 = "%s "
  132. CHAT_SAY_GET                  = "%s "
  133. CHAT_BATTLEGROUND_GET         = "|Hchannel:Battleground|hBG.|h %s: "
  134. CHAT_BATTLEGROUND_LEADER_GET  = "|Hchannel:Battleground|hBGL.|h %s: "
  135. CHAT_GUILD_GET                = "|Hchannel:Guild|hG.|h %s: "
  136. CHAT_OFFICER_GET              = "|Hchannel:Officer|hGO.|h %s: "
  137. CHAT_PARTY_GET                = "|Hchannel:Party|hP.|h %s: "
  138. CHAT_PARTY_LEADER_GET         = "|Hchannel:Party|hPL.|h %s: "
  139. CHAT_PARTY_GUIDE_GET          = "|Hchannel:Party|hPG.|h %s: "
  140. CHAT_RAID_GET                 = "|Hchannel:Raid|hR.|h %s: "
  141. CHAT_RAID_LEADER_GET          = "|Hchannel:Raid|hRL.|h %s: "
  142. CHAT_RAID_WARNING_GET         = "|Hchannel:RaidWarning|hRW.|h %s: "
  143. CHAT_INSTANCE_CHAT_GET        = "|Hchannel:Battleground|hI.|h %s: "
  144. CHAT_INSTANCE_CHAT_LEADER_GET = "|Hchannel:Battleground|hIL.|h %s: "
  145. --CHAT_MONSTER_PARTY_GET       = CHAT_PARTY_GET
  146. --CHAT_MONSTER_SAY_GET         = CHAT_SAY_GET
  147. --CHAT_MONSTER_WHISPER_GET     = CHAT_WHISPER_GET
  148. --CHAT_MONSTER_YELL_GET        = CHAT_YELL_GET
  149. CHAT_FLAG_AFK = "<AFK> "
  150. CHAT_FLAG_DND = "<DND> "
  151. CHAT_FLAG_GM = "<[GM]> "
  152.  
  153. --remove the annoying guild loot messages by replacing them with the original ones
  154. YOU_LOOT_MONEY_GUILD = YOU_LOOT_MONEY
  155. LOOT_MONEY_SPLIT_GUILD = LOOT_MONEY_SPLIT
  156.  
  157. --don't cut the toastframe
  158. BNToastFrame:SetClampedToScreen(true)
  159. BNToastFrame:SetClampRectInsets(-15,15,15,-15)
  160.  
  161. --hide the menu button
  162. ChatFrameMenuButton:HookScript("OnShow", ChatFrameMenuButton.Hide)
  163. ChatFrameMenuButton:Hide()
  164.  
  165. --hide the friend micro button
  166. local button = QuickJoinToastButton or FriendsMicroButton
  167. button:HookScript("OnShow", button.Hide)
  168. button:Hide()
  169.  
  170. --skin chat
  171. for i = 1, NUM_CHAT_WINDOWS do
  172.   local chatframe = _G["ChatFrame"..i]
  173.   SkinChat(chatframe)
  174.   --adjust channel display
  175.   if (i ~= 2) then
  176.     chatframe.DefaultAddMessage = chatframe.AddMessage
  177.     chatframe.AddMessage = AddMessage
  178.   end
  179. end
  180.  
  181. --scroll
  182. FloatingChatFrame_OnMouseScroll = OnMOuseScroll
  183.  
  184. --temporary chat windows
  185. hooksecurefunc("FCF_OpenTemporaryWindow", OpenTemporaryWindow)
  186. [color=#e5e5e5]--font size[/color]
  187. [color=#e5e5e5]CHAT_FONT_HEIGHTS = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}[/color]
  188.  
  189. [color=#e5e5e5]--tabs[/color]
  190. [color=#e5e5e5]CHAT_TAB_HIDE_DELAY = 1[/color]
  191. [color=#e5e5e5]CHAT_FRAME_TAB_NORMAL_MOUSEOVER_ALPHA = 1[/color]
  192. [color=#e5e5e5]CHAT_FRAME_TAB_NORMAL_NOMOUSE_ALPHA = 0[/color]
  193. [color=#e5e5e5]CHAT_FRAME_TAB_SELECTED_MOUSEOVER_ALPHA = 1[/color]
  194. [color=#e5e5e5]CHAT_FRAME_TAB_SELECTED_NOMOUSE_ALPHA = 0[/color]
  195. [color=#e5e5e5]CHAT_FRAME_TAB_ALERTING_MOUSEOVER_ALPHA = 1[/color]
  196. [color=#e5e5e5]CHAT_FRAME_TAB_ALERTING_NOMOUSE_ALPHA = 1[/color]
  197.  
  198. [color=#e5e5e5]--channels[/color]
  199. [color=#e5e5e5]CHAT_WHISPER_GET              = "<< %s "[/color]
  200. [color=#e5e5e5]CHAT_WHISPER_INFORM_GET       = ">> %s "[/color]
  201. [color=#e5e5e5]CHAT_BN_WHISPER_GET           = "<< %s "[/color]
  202. [color=#e5e5e5]CHAT_BN_WHISPER_INFORM_GET    = ">> %s "[/color]
  203. [color=#e5e5e5]CHAT_YELL_GET                 = "%s "[/color]
  204. [color=#e5e5e5]CHAT_SAY_GET                  = "%s "[/color]
  205. [color=#e5e5e5]CHAT_BATTLEGROUND_GET         = "|Hchannel:Battleground|hBG.|h %s: "[/color]
  206. [color=#e5e5e5]CHAT_BATTLEGROUND_LEADER_GET  = "|Hchannel:Battleground|hBGL.|h %s: "[/color]
  207. [color=#e5e5e5]CHAT_GUILD_GET                = "|Hchannel:Guild|hG.|h %s: "[/color]
  208. [color=#e5e5e5]CHAT_OFFICER_GET              = "|Hchannel:Officer|hGO.|h %s: "[/color]
  209. [color=#e5e5e5]CHAT_PARTY_GET                = "|Hchannel:Party|hP.|h %s: "[/color]
  210. [color=#e5e5e5]CHAT_PARTY_LEADER_GET         = "|Hchannel:Party|hPL.|h %s: "[/color]
  211. [color=#e5e5e5]CHAT_PARTY_GUIDE_GET          = "|Hchannel:Party|hPG.|h %s: "[/color]
  212. [color=#e5e5e5]CHAT_RAID_GET                 = "|Hchannel:Raid|hR.|h %s: "[/color]
  213. [color=#e5e5e5]CHAT_RAID_LEADER_GET          = "|Hchannel:Raid|hRL.|h %s: "[/color]
  214. [color=#e5e5e5]CHAT_RAID_WARNING_GET         = "|Hchannel:RaidWarning|hRW.|h %s: "[/color]
  215. [color=#e5e5e5]CHAT_INSTANCE_CHAT_GET        = "|Hchannel:Battleground|hI.|h %s: "[/color]
  216. [color=#e5e5e5]CHAT_INSTANCE_CHAT_LEADER_GET = "|Hchannel:Battleground|hIL.|h %s: "[/color]
  217. [color=#e5e5e5]--CHAT_MONSTER_PARTY_GET       = CHAT_PARTY_GET[/color]
  218. [color=#e5e5e5]--CHAT_MONSTER_SAY_GET         = CHAT_SAY_GET[/color]
  219. [color=#e5e5e5]--CHAT_MONSTER_WHISPER_GET     = CHAT_WHISPER_GET[/color]
  220. [color=#e5e5e5]--CHAT_MONSTER_YELL_GET        = CHAT_YELL_GET[/color]
  221. [color=#e5e5e5]CHAT_FLAG_AFK = "<AFK> "[/color]
  222. [color=#e5e5e5]CHAT_FLAG_DND = "<DND> "[/color]
  223. [color=#e5e5e5]CHAT_FLAG_GM = "<[GM]> "[/color]
  224.  
  225. [color=#e5e5e5]--remove the annoying guild loot messages by replacing them with the original ones[/color]
  226. [color=#e5e5e5]YOU_LOOT_MONEY_GUILD = YOU_LOOT_MONEY[/color]
  227. [color=#e5e5e5]LOOT_MONEY_SPLIT_GUILD = LOOT_MONEY_SPLIT[/color]
  228.  
  229. [color=#e5e5e5]--don't cut the toastframe[/color]
  230. [color=#e5e5e5]BNToastFrame:SetClampedToScreen(true)[/color]
  231. [color=#e5e5e5]BNToastFrame:SetClampRectInsets(-15,15,15,-15)[/color]
  232.  
  233. [color=#e5e5e5]--hide the menu button[/color]
  234. [color=#e5e5e5]ChatFrameMenuButton:HookScript("OnShow", ChatFrameMenuButton.Hide)[/color]
  235. [color=#e5e5e5]ChatFrameMenuButton:Hide()[/color]
  236.  
  237. [color=#e5e5e5]--hide the friend micro button[/color]
  238. [color=#e5e5e5]local button = QuickJoinToastButton or FriendsMicroButton[/color]
  239. [color=#e5e5e5]button:HookScript("OnShow", button.Hide)[/color]
  240. [color=#e5e5e5]button:Hide()[/color]
  241.  
  242. [color=#e5e5e5]--skin chat[/color]
  243. [color=#e5e5e5]for i = 1, NUM_CHAT_WINDOWS do[/color]
  244. [color=#e5e5e5]  local chatframe = _G["ChatFrame"..i][/color]
  245. [color=#e5e5e5]  SkinChat(chatframe)[/color]
  246. [color=#e5e5e5]  --adjust channel display[/color]
  247. [color=#e5e5e5]  if (i ~= 2) then[/color]
  248. [color=#e5e5e5]    chatframe.DefaultAddMessage = chatframe.AddMessage[/color]
  249. [color=#e5e5e5]    chatframe.AddMessage = AddMessage[/color]
  250. [color=#e5e5e5]  end[/color]
  251. [color=#e5e5e5]end[/color]
  252.  
  253. [color=#e5e5e5]--scroll[/color]
  254. [color=#e5e5e5]FloatingChatFrame_OnMouseScroll = OnMOuseScroll[/color]
  255.  
  256. [color=#e5e5e5]--temporary chat windows[/color]
  257. [color=#e5e5e5]hooksecurefunc("FCF_OpenTemporaryWindow", OpenTemporaryWindow)[/color]
__________________
twitter.com/ansirox
  Reply With Quote
03-14-17, 05:07 AM   #4
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by Ansi View Post
Doesnt work with quotes either. Here's the entire beauty:


Lua Code:
  1. -- rChat: core
  2. -- zork, 2016
  3.  
  4. -----------------------------
  5. -- Variables
  6. -----------------------------
  7.  
  8. local A, L = ...
  9.  
  10. local DefaultSetItemRef = SetItemRef
  11.  
  12. local cfg = {}
  13. cfg.dropshadow = {}
  14. cfg.dropshadow.offset = {1,-1}
  15. cfg.dropshadow.color = {0,0,0,0.9}
  16. cfg.editbox = {}
  17. cfg.editbox.font = {"Fonts\\ARIALN.ttf"}, 12}
  18. cfg.chat = {}
  19. cfg.chat.font = {"Fonts\\ARIALN.ttf"}, 12}
You are having extra '}' after "Fonts\\ARIALN.ttf".

That must be why.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Changing font in rChat


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off