Copy link to clipboard
Copied
Hi All,
I have a custom open type font and i wants to load this font when my custom plugin loaded so that it won't be available to other user when custom plugin is not there.
Is there a way to Embed a font file as a resource in indesign sdk project so that font is available when plugin gets loaded. or some other alternate approach using native system api that I can use inside plugin code to load/unload it.
Regards,
Alam
<Title renamed by MOD>
Copy link to clipboard
Copied
You mean for UI purpose?
You would've to unpack font, install it in the system and then uninstall. But as I'm not a plug-in developer - I've no idea if it's doable.
But if InDesign will crash - your font will stay...
Copy link to clipboard
Copied
yes I need to show that font in UI when plugin is loaded otherwise it should not be shown
Someone suggest me that I need to create a dll/framework with font resource and use that dll to install/uninstall font
Copy link to clipboard
Copied
Can't you use icons / graphic elements?
Copy link to clipboard
Copied
Something like these?
https://developer.apple.com/documentation/coretext/1499468-ctfontmanagerregisterfontsforurl
https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-addfontresourceexa
You'd eventually register your font before use by your widget draw, then unregister afterward so that it does not show in InDesign Font UI.
On the other hand if it works at all, it may cause a serious performance penalty whenever InDesign's font manager is reset. You'd also have to figure out how to associate the font with a UI font ID if you use that kind of widgets.
I'd stick to graphics as Robert suggested - e.g. try whether the SVG subset supported by widgets can embed a font (that would be woff rather than otf).
https://graphicdesign.stackexchange.com/questions/5162/how-do-i-embed-google-web-fonts-into-an-svg
Copy link to clipboard
Copied
I was more like using bitmap instead of text.
For me, custom font in UI means some specific, graphic elements - not for large blocks of text.
Copy link to clipboard
Copied
Yes we need to use system api to unpack font on plugin loading
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more