-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better C interface #20
Comments
If you mean the parts decoding SFNT and CFF table, then that's a lot of code; there's not much point reimplementing that in this module. Maybe FreeType allows loading those? |
@behdad I just care about the subroutinizer algorithm. I have already a decoder and an encoder, all parts (like - the charstring INDEX) are avaliable. There is even an IL for charstrings. |
I haven't looked at the code in a long time. Can you summarize what changes you like to see? |
@behdad A simple interface, pretty like the existing extern "C" uint32_t* compreff(unsigned char* dataStream, int numRounds, unsigned& outputLength); However, instead of returning a “result” which is needed to decode, provide a more “direct” output like this: typedef struct {
uint32_t length;
uint8_t data;
} CFFIndex;
typedef struct {
CFFIndex *charStrings;
CFFIndex *globalSubroutines;
uint32_t NumOfLocalSubroutines;
CFFIndex **localSubroutines;
} ComprefforResult;
extern "C" ComprefforResult *compreff(const CFFIndex *inputCharStrings, const whatever *fdSelect, uint32_t fdCount, uint32_t rounds); In the returned |
I see. Yes, I think we can do something like that. |
@behdad I’d like your C interface’s input and output plain enough. That is, can be used directly when building a CFF font. |
Sure that's possible but comes at a theoretical cost. Not important for most fonts though, I agree. |
@behdad I think that trade-off is acceptable. |
The current C interface lacks some import parts, we still need Python to deal with it.
The text was updated successfully, but these errors were encountered: