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

Feature: Typography support for Skia #371

Closed
11 of 12 tasks
tushar5526 opened this issue Aug 6, 2022 · 5 comments
Closed
11 of 12 tasks

Feature: Typography support for Skia #371

tushar5526 opened this issue Aug 6, 2022 · 5 comments

Comments

@tushar5526
Copy link
Member

tushar5526 commented Aug 6, 2022

Attributes

Loading & Displaying

@tushar5526
Copy link
Member Author

tushar5526 commented Aug 6, 2022

Hey @ziyaointl, should we implement preload for p5py. Preload docs link

Called directly before setup(), the preload() function is used to handle asynchronous loading of external files in a blocking way. If a preload function is defined, setup() will wait until any load calls within have finished

It seems preload waits for the asynchronous functions to finish and then proceeds with setup and draw.

We can just load stuff before the setup in our python sketches so it seems there is no specific need for a preload function IMO.

// load fonts, images etc here

def setup()...

def draw().... 

Handling async loading calls might go a bit off for the project's scope. The priority seems low as well so we can keep it for future releases.

Thoughts?

@ziyaointl
Copy link
Member

I think it's ok to implement preload for completeness - it's easy to implement (I don't think we need to do anything extra for async calls) and does not incur much of a performance cost, but I agree that it could be deferred to future releases.

@tushar5526
Copy link
Member Author

tushar5526 commented Aug 7, 2022

I have made implementing preload a good first issue for folks in the community. It would not affect loadFont and other APIs so someone else could contribute to it parallely.

This was referenced Aug 7, 2022
@tushar5526
Copy link
Member Author

tushar5526 commented Aug 8, 2022

Turns out preload is needed because load_font will depend upon the current renderer and we have to wait till run() is called and p5.renderer is assigned. So, I have implemented it.

@tushar5526
Copy link
Member Author

Closing this issue.

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

No branches or pull requests

2 participants