How to use multiple custom fonts #1752
-
Hi all, I have multiple .otf files that I want to use to add text to an image. I load the custom font by embedding it as a resource, writing it to a temp path. This does NOT work if I use it like this:
It will just use the default font.
Now everything I draw is using the custom font that I loaded (which also means that the issue is not with loading the font). So my issue is: since using .NET 8 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Can you create a small project on GitHub that demonstrates this issue so I can give you a better answer? |
Beta Was this translation helpful? Give feedback.
The problem in your case is that your temporary file doesn't contain a
.ttf
or.otf
extension so ImageMagick thinks it's a really weird font name and tries to load that font. There is probably a slightly different check in the read settings that allows these kind of font names. To solve this for your situation you can do this instead: