diff --git a/src/components.jl b/src/components.jl index 895f82bc..952a13dc 100644 --- a/src/components.jl +++ b/src/components.jl @@ -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