Skip to content
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

Cairo::Image.cairo_image_surface_create_for_data() limits its use due to Blob parameter #21

Open
Xliff opened this issue Dec 19, 2018 · 2 comments

Comments

@Xliff
Copy link
Contributor

Xliff commented Dec 19, 2018

I've been trying to link Font::FreeType to Cairo for a few days and have run into a problem. It appears that use of the function in the subject is limited to Blob's. Unfortunately, I want to have cairo write direcly to a buffer that has already been allocated in C .

What would be the best way to link this to Cairo, via the above function, so that I don't have to have more than one buffer?

If this is not directly possible with the current implementation, can I attempt to correct the issue with a PR?

Thanks.

@timo
Copy link
Owner

timo commented Dec 19, 2018

I'd appreciate a PR that turns the function (and maybe any other function that currently takes Blob) into a multi with an additional candidate that accepts CArray. You could also investigate if it would work to just constrain it to, for example, Positional[int8] and if that makes it work immediately with my int8 \@foo, Buf[int8].new(1, 2, 3), Blob[int8].new(2, 3, 4), as well as a CArray

Thanks in Advance!

@dwarring
Copy link
Collaborator

@Xliff. No sure if it helps, but have you noticed the FreeType example in doc/examples, which shares the underlying native FreeType face object with Cario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants