Thread Tools Display Modes
06-07-10, 05:23 PM   #1
Pseudopod
A Deviate Faerie Dragon
Join Date: Apr 2008
Posts: 16
Question Make the font size smaller (oChat)

I'm basically using oChat though I've modified it with bits and pieces I've tried to find from other similar [alphabet]Chat "lightweight chat mods".

I tried to add

Code:
  for i = 1, NUM_CHAT_WINDOWS do
    local cf = _G["ChatFrame" .. i];
    
cf:SetFont("Interface\\AddOns\\SharedMedia_MyMedia\\font\\pf_tempesta_seven_condensed.ttf", 8, "OUTLINE");
which works for changing the font and adding the outline BUT it won't resize the font no matter what I choose for the size. I can't even make it bigger. It just sticks with what I've chosen from the blizzard's own chat font size selector.

What can be done to fix this?
  Reply With Quote
06-07-10, 08:35 PM   #2
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Try to add:

SetFont(ChatFontNormal, fontChat , sizeChat, "OUTLINE")
SetFont(ChatFontSmall , fontChat , sizeChat, "OUTLINE")
__________________

  Reply With Quote
06-08-10, 02:27 AM   #3
Pseudopod
A Deviate Faerie Dragon
Join Date: Apr 2008
Posts: 16
Originally Posted by sacrife View Post
cf:SetFont(ChatFontNormal, fontChat , sizeChat, "OUTLINE")
cf:SetFont(ChatFontSmall , fontChat , sizeChat, "OUTLINE")
The correct usage is ChatFrame1:SetFont("font", fontHeight [, flags]). I.e. that only gives an error. Maybe I'm putting it to the wrong place or something. This is the whole part (lines 49-68):
Code:
for i=1, NUM_CHAT_WINDOWS do
	local cf = _G["ChatFrame"..i]
	cf:EnableMouseWheel(true)

		cf:SetFont("Interface\\AddOns\\SharedMedia_MyMedia\\font\\pf_tempesta_seven_condensed.ttf", 8, "OUTLINE");

	cf:SetFading(false)
	cf:SetScript("OnMouseWheel", scroll)
 
	for k, button in pairs(buttons) do
		button = _G["ChatFrame"..i..button]
		button:Hide()
		button.Show = dummy
	end
 
	if(not blacklist[cf]) then
		origs[cf] = cf.AddMessage
		cf.AddMessage = AddMessage
	end
end
Here's the whole code (well, not quite, but I cut off some unrelated stuff I just added): http://pastebin.com/WaucNMiE

Last edited by Pseudopod : 06-08-10 at 02:53 AM.
  Reply With Quote
06-08-10, 05:31 AM   #4
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
You are misunderstanding me. My code replaces the default chat font and its properties. Not adds one.
__________________

  Reply With Quote
06-08-10, 10:25 AM   #5
Pseudopod
A Deviate Faerie Dragon
Join Date: Apr 2008
Posts: 16
Originally Posted by sacrife View Post
You are misunderstanding me. My code replaces the default chat font and its properties. Not adds one.
Sure, but where should I add it and what else? "Error: attempt to call global 'SetFont' (a nil value)" is the only thing i can achieve, no matter where the location inside the chat.lua.
  Reply With Quote
06-08-10, 09:01 PM   #6
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Add this at the bottom:

Code:
local function SetFont(obj, font, size, style, alpha, r, g, b, sr, sg, sb, sox, soy)
	obj:SetFont(font, size, style)
	if sr and sg and sb then obj:SetShadowColor(sr, sg, sb) end
	if sox and soy then obj:SetShadowOffset(sox, soy) end
	if r and g and b then obj:SetTextColor(r, g, b) end
	if alpha then obj:SetAlpha(r) end
end


local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function()

SetFont(ChatFontNormal, fontChat	, sizeChat, nil);
SetFont(ChatFontSmall	, fontChat	, sizeChat, "OUTLINE");
STANDARD_TEXT_FONT = fontChat;

end)
__________________

  Reply With Quote
06-09-10, 07:08 AM   #7
Pseudopod
A Deviate Faerie Dragon
Join Date: Apr 2008
Posts: 16
Originally Posted by sacrife View Post
Add this at the bottom:
That "only" set the font for chat frame & edit box, yet only edit box had the correct font size.

Though finally now the channel font matches the font of typed text in the edit box, which is really good. :P

After I noticed that some other addon had managed to set the font size of my other chat windows to 9, I thought out of the addon sandbox and edited my WTF\...\chat-cache.txt. I guess that's one way to do it... On one hand it would be nice to know how to change it inside an addon, on the other hand, it's not as critical anymore.

Thanks for the help so far

Last edited by Pseudopod : 06-09-10 at 07:40 AM.
  Reply With Quote
06-09-10, 08:49 AM   #8
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Yeah my code is based on your current font settings.
Can't really explain why. But it's best at size 12 (ingame) and size 11 in lua :P
__________________

  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Make the font size smaller (oChat)


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