@@ -664,55 +664,57 @@ Load all faces declared in the Faces.toml file `tomlfile`.
664
664
"""
665
665
loaduserfaces! (tomlfile:: String ) = loaduserfaces! (Base. parsed_toml (tomlfile))
666
666
667
- function Base. convert (:: Type{Face} , spec:: Dict )
667
+ function Base. convert (:: Type{Face} , spec:: Dict{String,Any} )
668
668
Face (if haskey (spec, " font" ) && spec[" font" ] isa String
669
- spec[" font" ] end ,
669
+ spec[" font" ]:: String
670
+ end ,
670
671
if haskey (spec, " height" ) && (spec[" height" ] isa Int || spec[" height" ] isa Float64)
671
- spec[" height" ]
672
+ spec[" height" ]:: Union{Int,Float64}
672
673
end ,
673
674
if haskey (spec, " weight" ) && spec[" weight" ] isa String
674
- Symbol (spec[" weight" ])
675
+ Symbol (spec[" weight" ]:: String )
675
676
elseif haskey (spec, " bold" ) && spec[" bold" ] isa Bool
676
- ifelse (spec[" bold" ], :bold , :normal )
677
+ ifelse (spec[" bold" ]:: Bool , :bold , :normal )
677
678
end ,
678
679
if haskey (spec, " slant" ) && spec[" slant" ] isa String
679
- Symbol (spec[" slant" ])
680
+ Symbol (spec[" slant" ]:: String )
680
681
elseif haskey (spec, " italic" ) && spec[" italic" ] isa Bool
681
- ifelse (spec[" italic" ], :italic , :normal )
682
+ ifelse (spec[" italic" ]:: Bool , :italic , :normal )
682
683
end ,
683
684
if haskey (spec, " foreground" ) && spec[" foreground" ] isa String
684
- tryparse (SimpleColor, spec[" foreground" ])
685
+ tryparse (SimpleColor, spec[" foreground" ]:: String )
685
686
elseif haskey (spec, " fg" ) && spec[" fg" ] isa String
686
- tryparse (SimpleColor, spec[" fg" ])
687
+ tryparse (SimpleColor, spec[" fg" ]:: String )
687
688
end ,
688
689
if haskey (spec, " background" ) && spec[" background" ] isa String
689
- tryparse (SimpleColor, spec[" background" ])
690
+ tryparse (SimpleColor, spec[" background" ]:: String )
690
691
elseif haskey (spec, " bg" ) && spec[" bg" ] isa String
691
- tryparse (SimpleColor, spec[" bg" ])
692
+ tryparse (SimpleColor, spec[" bg" ]:: String )
692
693
end ,
693
694
if ! haskey (spec, " underline" )
694
695
elseif spec[" underline" ] isa Bool
695
- spec[" underline" ]
696
+ spec[" underline" ]:: Bool
696
697
elseif spec[" underline" ] isa String
697
- tryparse (SimpleColor, spec[" underline" ])
698
- elseif spec[" underline" ] isa Vector && length (spec[" underline" ]) == 2
699
- color = tryparse (SimpleColor, spec[" underline" ][1 ])
700
- (color, Symbol (spec[" underline" ][2 ]))
698
+ tryparse (SimpleColor, spec[" underline" ]:: String )
699
+ elseif spec[" underline" ] isa Vector{String} && length (spec[" underline" ]:: Vector{String} ) == 2
700
+ color_str, style_str = (spec[" underline" ]:: Vector{String} )
701
+ color = tryparse (SimpleColor, color_str)
702
+ (color, Symbol (style_str))
701
703
end ,
702
704
if ! haskey (spec, " strikethrough" )
703
705
elseif spec[" strikethrough" ] isa Bool
704
- spec[" strikethrough" ]
706
+ spec[" strikethrough" ]:: Bool
705
707
elseif spec[" strikethrough" ] isa String
706
- tryparse (SimpleColor, spec[" strikethrough" ])
708
+ tryparse (SimpleColor, spec[" strikethrough" ]:: String )
707
709
end ,
708
710
if haskey (spec, " inverse" ) && spec[" inverse" ] isa Bool
709
- spec[" inverse" ] end ,
711
+ spec[" inverse" ]:: Bool end ,
710
712
if ! haskey (spec, " inherit" )
711
713
Symbol[]
712
714
elseif spec[" inherit" ] isa String
713
- [Symbol (spec[" inherit" ])]
715
+ [Symbol (spec[" inherit" ]:: String )]
714
716
elseif spec[" inherit" ] isa Vector{String}
715
- Symbol .(spec[" inherit" ])
717
+ Symbol .(spec[" inherit" ]:: Vector{String} )
716
718
else
717
719
Symbol[]
718
720
end )
0 commit comments