How to extract font name and attributes.
On 06/06/2014 at 01:40, xxxxxxxx wrote:
Objects Osplinetext and 1019268 (MOText) use font. Font in Cinema UI is defined by Name and Bold/Italic flags.
Due to c4d_parameter_ids.h font is located in: PRIM_TEXT_FONT
But sometimes this parameter is not present - for instance Airbag.c4d from your samples.
In rest cases type of this parameter is DA_MISSINGPLUG. pluginid - FONTCHOOSER_DATA
Minor problem: it is not possible to extract this data and get this type. GetType - always returns NULL, DMissingPlugin is not accessible. But I can modify headers and check this data - so not a big problem.
Major problem: How to decode this binary block? (Name is visible in debugger and can be extracted, but it can be wrong way)
So question :
Do you have description of FONTCHOOSER_DATA format or do you have methods for decoding or am I doing something completely wrong? I just need font name and these Bold/Italic attributes.
In case if block is not present, which font should be used? Segoe UI ?
On 17/06/2014 at 06:22, xxxxxxxx wrote:
the FontData custom data type is not supported by the current Melange SDK 6.0
Basically the font data is stored and saved as BaseContainer. So if you save the data block and read only this block with HyperFile::ReadContainer() you should be able to get the data when using the Font Data ressource IDs. But I cannot guarantee that this will work and I do not recommend to use it.
On 17/06/2014 at 07:02, xxxxxxxx wrote:
So, looks like my direct access to memory is not that crazy...
Can you please provide some info regarding BaseContainer format?
If you can't, just give me some hint. Is it chunk based (code + size) or some sort of binary encoding ?
On 19/06/2014 at 01:11, xxxxxxxx wrote:
To get the BaseContainer from your data block you have to use the HyperFile::ReadContainer() somehow. It's the only way.
Like the help says "The BaseContainer is a collection of individal vaules. Each value has its own ID and type...". The chunk sizes depend on id/type and there are a lot of different types (GeData). But if you are really want to try this skip from start uchar + int32 + int32 + int32 then read all the data like this:
header (uchar) + id (int32) + data (size depends on type)