I'm using Diagrams library to generate some text with a custom font. Looking at the documentation for Text it is not clear how can one specify particular .ttf font file? I tried using different .ttf files like in the example below, but no one worked.
discountText :: Maybe Int -> Diagram B
discountText discount =
case discount of
Nothing -> mempty
Just value ->
text (show value ++ " %") # font "Roboto-Light.ttf" # fontSize 90
Another alternative seems to be SVGFonts, but I would like to achieve this without another library. So how do you guys set custom fonts in Diagrams?
UPD: I find the answer given below very explanatory. To solve the problem I actually ended up using SVGFonts which adds extra step of converting .ttf into .svg, but does the job.