39
39
function fontsof (lang)
40
40
union ((listfonts (l) for l in expandlangcode (lang)). .. )
41
41
end
42
- function getfonts (lang)
42
+ function getfontcandidates (lang)
43
+ lang = StopWords. normcode (String (lang))
43
44
if haskey (FontCandidates, lang)
44
45
return FontCandidates[lang]
45
46
else
@@ -50,6 +51,15 @@ function getfonts(lang)
50
51
end
51
52
end
52
53
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
+
53
63
Schemes_colorbrewer = filter (s -> occursin (" colorbrewer" , colorschemes[s]. category), collect (keys (colorschemes)))
54
64
Schemes_colorbrewer = filter (s -> (occursin (" Accent" , String (s))
55
65
|| occursin (" Dark" , String (s))
@@ -343,10 +353,10 @@ end
343
353
randomoutline () = rand ((0 , 0 , 0 , rand (2 : 10 )))
344
354
function randomfonts (lang= " " )
345
355
if rand () < 0.8
346
- fonts = rand (getfonts (lang))
356
+ fonts = rand (getfontcandidates (lang))
347
357
fonts = fonts * rand (WeightCandidates)
348
358
else
349
- fonts = rand (getfonts (lang), 2 + floor (Int, 2 randexp ()))
359
+ fonts = rand (getfontcandidates (lang), 2 + floor (Int, 2 randexp ()))
350
360
fonts = [f * rand (WeightCandidates) for f in fonts]
351
361
rand () > 0.5 && (fonts = tuple (fonts... ))
352
362
end
0 commit comments