NEW!
CSHTML5 has now become OpenSilver!
We are happy to announce that CSHTML5 has been significantly improved and rebranded
to 'OpenSilver', which stands for 'Open-source reimplementation of Silverlight'. It is fully backward compatible and it can be downloaded from
OpenSilver.net. Upgrading from
CSHTML5 to OpenSilver is very easy.
Read the FAQ
Note: this feature requires v1.1 or newer
In a CSHTML5 application you can use 3 types of fonts:
Here is how to use custom fonts in a CSHTML5 application:
1. Add a ".ttf" or ".woff" font file to your CSHTML5 project. (You can download such a file from online fonts galleries such as DaFont.com or Google Fonts)
2. Set its "Build Action" to "Content". (To do so, select the font file in the Solution Explorer, press F4, and change the "Build Action" property)
3. Reference the font in your XAML using one of the two following syntaxes:
<TextBlock FontFamily="ms-appx:///AssemblyName/Folder/MyFontFileName.ttf" Text="Hello World"/>
or
<TextBlock FontFamily="/AssemblyName;component/Folder/MyFontFileName.ttf" Text="Hello World"/>
For any question, please post a message on the forums or contact us at support@cshtml5.com