3939function fontsof (lang)
4040 union ((listfonts (l) for l in expandlangcode (lang)). .. )
4141end
42- function getfonts (lang)
42+ function getfontcandidates (lang)
43+ lang = StopWords. normcode (String (lang))
4344 if haskey (FontCandidates, lang)
4445 return FontCandidates[lang]
4546 else
@@ -50,6 +51,15 @@ function getfonts(lang)
5051 end
5152end
5253
54+ """
55+ setfontcandidates!(lang::AbstractString, str_set)
56+
57+ Customize font candidates for language `lang`
58+ """
59+ function setfontcandidates! (lang:: AbstractString , str_list)
60+ FontCandidates[StopWords. normcode (String (lang))] = str_list
61+ end
62+
5363Schemes_colorbrewer = filter (s -> occursin (" colorbrewer" , colorschemes[s]. category), collect (keys (colorschemes)))
5464Schemes_colorbrewer = filter (s -> (occursin (" Accent" , String (s))
5565 || occursin (" Dark" , String (s))
@@ -343,10 +353,10 @@ end
343353randomoutline () = rand ((0 , 0 , 0 , rand (2 : 10 )))
344354function randomfonts (lang= " " )
345355 if rand () < 0.8
346- fonts = rand (getfonts (lang))
356+ fonts = rand (getfontcandidates (lang))
347357 fonts = fonts * rand (WeightCandidates)
348358 else
349- fonts = rand (getfonts (lang), 2 + floor (Int, 2 randexp ()))
359+ fonts = rand (getfontcandidates (lang), 2 + floor (Int, 2 randexp ()))
350360 fonts = [f * rand (WeightCandidates) for f in fonts]
351361 rand () > 0.5 && (fonts = tuple (fonts... ))
352362 end
0 commit comments