I'm trying to add the font "Myriad Condensed Web" to an addon, how is this done? If needed, the addon is Stuf Unit Frames. I want to use Myriad Condensed Web with the unit frames.
Go into the Stuf folder, open core.lua and look for this..
Below it add this..Code:-- LibSharedMedia-3.0 register media files local smed = LibStub("LibSharedMedia-3.0") smed:Register("statusbar", "Flat Smooth", "Interface\\AddOns\\Stuf\\media\\flatsmooth.tga") smed:Register("statusbar", "Curved Bar", "Interface\\AddOns\\Stuf\\media\\curvedbar.tga") smed:Register("statusbar", "Steel", "Interface\\AddOns\\Stuf\\media\\Steel.tga") smed:Register("font", "Franklin Gothic Medium", "Interface\\AddOns\\Stuf\\media\\font1.ttf") smed:Register("border", "Square Outline", "Interface\\AddOns\\Stuf\\media\\squareline.tga")
Code:smed:Register("font", "Myriad Condensed Web", "PATH\\TO\\YOUR\\FONT.ttf")
Of course change PATH\\TO\\YOUR\\FONT.ttf to the path of the font you desire.
The default menu for units and what not is handled by Blizzard but you can override it and set it up how you want. If the questioning is about that menu then you'll need to direct your attention to core.lua.
At line 67 you will find this
"PlayerFrame" is the name of the parent the dropdown menu will be anchored to.Code:player = "PlayerFrame", target = "TargetFrame", pet = "PetFrame", focus = "FocusFrame", party1 = "PartyMemberFrame1", party2 = "PartyMemberFrame2", party3 = "PartyMemberFrame3", party4 = "PartyMemberFrame4", }
Doing a search for 'dropdown' you will find this function on line 1291
To fiddle around with positioning you will want to alter BOTTOMLEFT/TOPLEFT, these are the anchors. All valid anchors would be BOTTOMLEFT/TOPLEFT/TOP/LEFT/RIGHT/CENTER/BOTTOMRIGHT/TOPRIGHT. The number 60 is the x-axis offset and the 0 is the y-axis offset. Adjust all of them to change the positioning for all the menus.Code:local function MainPostClick(this, a1) if a1 == "RightButton" and UIDROPDOWNMENU_OPEN_MENU == _G[dropdown[this.unit].."DropDown"] and DropDownList1:IsShown() then DropDownList1:ClearAllPoints() if (this:GetBottom() * (this.dbf.scale or 1)) < (GetScreenHeight() * 0.45) then DropDownList1:SetPoint("BOTTOMLEFT", this, "TOPLEFT", 60, 0 ) else DropDownList1:SetPoint("TOPLEFT", this, "BOTTOMLEFT", 60, 0 ) end end end
Small problem: Got the dropdown for the playerframe working but now, for the target frame, this happens:
If the tooltip is short (like the tooltip for a monster), it becomes short.I changed the coords to 60, -280, changed all anchors to BOTTOMLEFT.
If you set the anchor to the bottomleft, your x and y values are telling to then move right 60 pixels and down 280 from the bottomleft. That could be the issue.
Last edited by bOOURNS; 2013-01-28 at 12:11 AM.
Well in your screenshot you can clearly see that the menu is 60 pixels to the right and 280 pixels down from the bottomleft anchor point that you've set. So obviously you need to change those numbers accordingly to where you want it to be from the bottomleft. I can't tell you exact numbers, that's for you to deside because I don't know where exactly you want it.
If I understand it correctly, you basically want the topleft of the menu to touch the bottomleft of the unit frame:
I added some fancy colouring that should somewhat explain the way the SetPoint() function works with anchoring.Code:DropDownList1:SetPoint("TOPLEFT", this, "BOTTOMLEFT", 0, 0 )
The fonts didn't end up working and I got an LUA error. Here is what I added to core.lua as the second poster instructed, did I do it wrong?
turned into:Code:smed:Register("font", "Myriad Condensed Web", "PATH\\TO\\YOUR\\FONT.ttf")
If you're wondering, the web and the condensed is flipped because that's how the name is spelled on my PC.Code:smed:Register("font", "Myriad Web Condensed", "C:\\Windows\\Fonts\\myriadwebcondensed.ttf")