BlazorExtensions / Canvas

HTML5 Canvas API implementation for Microsoft Blazor
MIT License
614 stars 146 forks source link

Is there any way to use custom fonts? such as AwesomeIcons #98

Closed voland closed 3 years ago

voland commented 3 years ago

Is there any way to use custom fonts? such as Awesome-icons to paste them in specific color.

using: await _outputCanvasContext.SetFontAsync("Font Awesome 5 Free");

just doesn't work, in razor file which contains BECanvas font awesome is recognised, and pasting icons is possible.

voland commented 3 years ago

Sorry i have to answer my question. I forgot to add apostrophe around name of font, like this await _outputCanvasContext.SetFontAsync(" 'Font Awesome 5 Free' ");

What confused me was that i had not to use apostrophe using Courier New font, and I don't know why.

Thaina commented 3 years ago

Maybe because common string would consider font family, while apostrophe for font file?