diff --git a/src/args.jl b/src/args.jl index b2c5958b..a5a63ad5 100644 --- a/src/args.jl +++ b/src/args.jl @@ -764,7 +764,7 @@ function processGridArg!(d::KW, arg, letter) end end -processFontArgs!(d::KW, fontname::Symbol, args::Tuple) +function processFontArgs!(d::KW, fontname::Symbol, args::Tuple) fnt = font(args...) d[Symbol(fontname, :family)] = fnt.family d[Symbol(fontname, :size)] = fnt.pointsize diff --git a/src/utils.jl b/src/utils.jl index d19a2acb..b9da48d5 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -1007,3 +1007,43 @@ xmax(plt::Plot) = ignorenan_maximum([ignorenan_maximum(series.d[:x]) for series "Extrema of x-values in plot" ignorenan_extrema(plt::Plot) = (xmin(plt), xmax(plt)) + + +# --------------------------------------------------------------- +# get fonts from objects: + +titlefont(sp::Subplot) = font( + sp[:titlefontfamily], + sp[:titlefontsize], + sp[:titlefont], + sp[:titlefonthalign], + sp[:titlefontrotation], + sp[:titlefontcolor], +) + +legendfont(sp::Subplot) = font( + sp[:legendfontfamily], + sp[:legendfontsize], + sp[:legendfont], + sp[:legendfonthalign], + sp[:legendfontrotation], + sp[:legendfontcolor], +) + +tickfont(ax::Axis) = font( + ax[:tickfontfamily], + ax[:tickfontsize], + ax[:tickfont], + ax[:tickfonthalign], + ax[:tickfontrotation], + ax[:tickfontcolor], +) + +guidefont(ax::Axis) = font( + ax[:guidefontfamily], + ax[:guidefontsize], + ax[:guidefont], + ax[:guidefonthalign], + ax[:guidefontrotation], + ax[:guidefontcolor], +)