Closed RoelN closed 4 years ago
You shouldn't be creating base64 data, Font
operates on the plain data. If the problem is the getFontCSSFormat
function not having that information then your solution of supplying the filename in addition to the data is a good solution.
Although let's not convert to Base64: it ends up inside of a binary DataView
anyway, so base64 would just grow the memory by 1/3rd, and then undo that again.
we added this =D
What would be the preferred way to "upload" a font through drag/drop or a file input?
I saw this issue, which implies there is a mechanism in the new Font.js. But passing a base64 file trips up the filetype recognition.
Is there a cleaner way?
(Also, would file/font type detection be more thorough, e.g. by ignoring extension and checking on byte level?)