Error in Graphics.Drawing.Font


#1

I’m using Graphics.Drawing.Font. It works when I use the preset values for FontFamily like ‘monospace’ or ‘serif’. However when I try to specify a font family via ‘FontFamily “Times New Roman”’ or whatever, I get “Unknown data constructor FontFamily.”

I am importing it using the form FontFamily(…) and it doesn’t complain about the import.


#2

Importing via FontFamily(..) gives you all the exported constructors (but there are none! code)

You’re supposed to use customFont instead, which lets you pass in a String:

https://pursuit.purescript.org/packages/purscript-drawing/4.0.0/docs/Graphics.Drawing.Font#v:customFont


#3

FWIW, I think the compiler should warn when (..) does not result in any imports (it’s equivalent to an unused import).


#4

Thanks, it works. Not sure how I missed that.