HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: Majestyk on 2021-07-11 03:26:42

Title: Can I change the path of the fonts folder in a portable install?
Post by: Majestyk on 2021-07-11 03:26:42
I've converted Tedgo's DarkOne theme to a portable and I'm wondering if I can somehow have an internal fonts directory instead of using the default Windows Fonts Directory. It can be done with images but I can't figure out how to do it with fonts.

I tried this below but it doesn't work.
Quote
var configPath = fb.FoobarPath + "themes\\DarkOne_v4.0\\";
var fontPath = configPath + "Fonts\\";

var btp_font = gdi.Font(fontPath + "Roboto", 11, 0);
or
var btp_font = gdi.Font(fontPath + "Roboto.tff", 11, 0);


Any ideas? Thanks.
Title: Re: Can I change the path of the fonts folder in a portable install?
Post by: marc2k3 on 2021-07-11 06:36:01
No, that will never work. The gdi.Font function expects a font name only.

edit: it actually loads 2 fonts internally and I won't bore you with the details of how/why it does that but here's the documentation for one of the methods used...

https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createfontw