View Single Post
Old 03-20-2018, 06:12 AM   #1
Andi!
Human being with feelings
 
Andi!'s Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 82
Default Embedded custom fonts without Cairo

Hi there,

I'm wrapping my head around the idea to implement a simple custom (ttf) font inclusion baked directly into the plug-in resources (instead of installing the fonts to the system). I know, there is the Cairo stuff, it's great. But on the other hand it seems a little bit oversized to me. Maybe there is already some kind of other implementation ?

What we could do:
Global:
- add (e.g. free google) ttf file to the resources, adjust resource.h etc.

Windows:
- call FindResource
- Load/Lock/SizeofResource
- call AddFontMemResourceEx
-> IPlug CreateFont should find the font now

OS X:
- include font in the project, how described here: https://www.cocoanetics.com/2013/03/...th-dtcoretext/
- or load the file manually how it is done with Bitmaps in LoadImgFromResourceOSX
-> Swells CreateFont emulation could find the font via the existing CTFontCreateWithName
- ???

I'm totally unsure about the OS X part. Before giving it a try, I would like to ask you all, if somebody already tried something similar and if such an implementaion would make sense ? Maybe I missed a thread about it. It's clear that such a simple implementation doesn't support outlined text and many other things.

Cheers
Andi! is offline   Reply With Quote