Integrating revFont

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller, LCMark

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 996
Joined: Thu Apr 11, 2013 11:27 am

Re: Integrating revFont

Post by LCMark » Thu Jan 09, 2014 11:42 am

@mickpitkin92: This was discussed earlier on in the thread and the syntax we settled on for the font loading mechanism was specific enough that such a feature could be added.

Both Mac and Windows do provide APIs to load fonts into the current application (not globally) from memory rather than files however the issue comes from the script interaction part. Using font files gives an obvious (and unique!) key to use to load/unload/enumerate what has been done - the filename. If you can load a font from a sequence of bytes (rather than a file) then a key is a little harder to come by - the 'obvious' thing to use is the font name that comes from the font encoded in the sequence of bytes but that then means the engine needs to leverage a library that can parse out this information from the memory block; also it doesn't work in the case of multiple fonts being encoded in one block (which I believe can happen with TrueType-Collection files).

So, anyway, it is something that could be added; but at the moment it didn't seem worth the potentially significant extra cost - especially as you can just spit the data out to disk as a temporary file and load that way.

That being said, the current syntax was chosen so that this feature could be extended in the future - we have 'font file' (start using font file, stop using font file, fontFilesInUse); the memory loading facility could use the same syntax but just drop the 'file' adjective.

Post Reply

Return to “Engine Contributors”