scalefontsize/scalefontsizes; closes #560

This commit is contained in:
Thomas Breloff 2016-11-02 10:20:33 -04:00
parent 5ef7126a3a
commit dfb89ef7f5

View File

@ -226,7 +226,7 @@ end
# -----------------------------------------------------------------------
immutable Font
type Font
family::AbstractString
pointsize::Int
halign::Symbol
@ -283,6 +283,17 @@ function font(args...)
Font(family, pointsize, halign, valign, rotation, color)
end
function scalefontsize(k::Symbol, factor::Number)
f = default(k)
f.pointsize = round(Int, factor * f.pointsize)
default(k, f)
end
function scalefontsizes(factor::Number)
for k in (:titlefont, :guidefont, :tickfont, :legendfont)
scalefontsize(k, factor)
end
end
"Wrap a string with font info"
immutable PlotText
str::AbstractString