-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.lua
74 lines (63 loc) · 2.26 KB
/
tests.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
-- Lua Globals --
-- luacheck: globals print
local lib = _G.LibStub("LibIconFonts-1.0")
function _G.IconFontTest()
print("IconFontTest")
local fa = lib:GetIconFont("FontAwesome-4.7")
fa.path = [[Interface\AddOns\RealUI_Skins\Media\fontawesome-webfont.ttf]]
local frame = _G.CreateFrame("Frame", nil, _G.UIParent, "BasicFrameTemplate")
frame:SetSize(925, 600)
frame:SetPoint("CENTER")
frame:EnableMouse(true)
frame:SetMovable(true)
frame:SetScript("OnMouseDown", function(self, button)
frame:StartMoving()
end)
frame:SetScript("OnMouseUp", function(self, button)
frame:StopMovingOrSizing()
end)
local line = frame:CreateTexture(nil, "ARTWORK")
line:SetTexture(1, 1, 1, 1)
line:SetHeight(1)
line:SetPoint("LEFT", 3, 0)
line:SetPoint("RIGHT", -3, 0)
local previous
local size = 16
for i = 1, 6 do
local textNormal = frame:CreateFontString(nil, "ARTWORK")
textNormal:SetFont([[Fonts\FRIZQT__.TTF]], size, "OUTLINE")
textNormal:SetText(size)
if not previous then
textNormal:SetPoint("BOTTOMLEFT", line, "TOPLEFT", 5, 5)
else
textNormal:SetPoint("BOTTOMLEFT", previous, "BOTTOMRIGHT", 5, 0)
end
local textIcons = frame:CreateFontString(nil, "ARTWORK")
textIcons:SetFont(fa.path, size, "OUTLINE")
textIcons:SetText(fa.microphone)
textIcons:SetPoint("TOP", textNormal, "BOTTOM", 0, -10)
previous = textNormal
size = size + size
end
end
function _G.FontSizeTest()
local frame = _G.CreateFrame("Frame", nil, _G.UIParent)
frame:SetAllPoints()
local tex = frame:CreateTexture()
tex:SetAllPoints()
tex:SetColorTexture(0, 0, 0)
local previous = frame
local size = 250
for i = 1, 7 do
local text = frame:CreateFontString(nil, "ARTWORK")
text:SetFont([[Fonts\ARIALN.TTF]], size, "")
text:SetText("M")
text:SetPoint("LEFT", frame, "RIGHT", previous:GetRight() + 5, 0)
local sizeText = frame:CreateFontString(nil, "ARTWORK")
sizeText:SetFont([[Fonts\ARIALN.TTF]], 32, "")
sizeText:SetText(size)
sizeText:SetPoint("TOP", text, "BOTTOM", 0, -10)
previous = text
size = size + 2
end
end