Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 03-20-2018, 06:12 AM   #1
Human being with feelings
Andi!'s Avatar
Join Date: Nov 2015
Location: Germany
Posts: 79
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:
- add (e.g. free google) ttf file to the resources, adjust resource.h etc.

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

- include font in the project, how described here:
- 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.

Andi! is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 02:42 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.