Forums > Dev

How to clone a t_jfont?

June 25, 2012 | 1:05 pm

Dear List,

is there a way to clone a font that already exists? Apparently, jfont_reference will only give a reference to an already existing font, which doesn’t help, since the newly created reference will react to modifications done to the original font (like size changes etc). jfont_create also won’t help, since there’s no way to figure out the slant and weight of a font (at least there’s no method that I knew). My idea so far has been to simple memcpy the struct, but I’m not sure that’s the best way to go, as the structure of a t_jfont is not documented, therefore it might happen that it contains some references that won’t make much sense after a simple memcpy. Do you have any suggestions?

Thanks,
Ádám


July 5, 2012 | 3:08 pm

Hi Ádám,

Yes, looks like you are correct that the current set of jfont functions exported are a bit thin. I’ve created a ticket to expand on this capability in the future. Not ideal but perhaps you can work around by tracking any modifications to the original font yourself since if you create a font you are the only one that will modify it after that.

Rob


Viewing 2 posts - 1 through 2 (of 2 total)