c# - How to change the Windows font folder? -


so this question covers nicely how current font path, if want change path?

for example, currently

system.environment.getfolderpath(system.environment.specialfolder.fonts);

would contain

c:\windows\fonts

but if purposes of project want point

d:\resources\fonts

is there way can that? or way tell windows not use environment path , instead use path want?

you don't need change system settings. can load fonts whichever folder like. example:

var pfc = new privatefontcollection(); pfc.addfontfile(fontfile);  var fontfamily = new fontfamily(pfc.families.first().name,pfc);  richtextbox1.font = new font(fontfamily, 20f, fontstyle.bold); richtextbox1.text = "test"; 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -