Alright, here's the deal:
Consider you want to reduce app size therefore you are using a font which contains lots of pretty useful icons plus you are able to change all components color and accents to do cool graphical flexibilities, Like Microsoft "Segoe Fluent Icons". But how about a user with Windows 7 or earlier version of MS Windows operating system (Windows 10 have a similar alternative called "Segoe MDL2 Assets" but still not quite this one.) I looked up all over. What is the correct way to achieve such including-used-fonts-built-in thing in our vb.net winform projects?
What I've tried:
Which results "Access to path "C:\Windows\Fonts\SegoeIcons.ttf" is denied" exception.Code:Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Try System.IO.File.WriteAllBytes("c:\windows\fonts\SegoeIcons.ttf", My.Resources.SegoeIcons) Application.Restart() Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical) End Try End Sub




Reply With Quote
