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

setFont via JS API #21

Open
amizer12 opened this issue Jun 2, 2021 · 6 comments
Open

setFont via JS API #21

amizer12 opened this issue Jun 2, 2021 · 6 comments

Comments

@amizer12
Copy link

amizer12 commented Jun 2, 2021

Hi,
Can you let me know how to properly send to the ffi function the font name when using this library via JS API ?
When i simply use
ILI9341.setFont(&FreeMonoBold9pt7b);
It doesnt work and throws a parse error, when i try to pass it as string or anything else it also fails.
Any pointers ?

@pimvanpelt
Copy link
Collaborator

pimvanpelt commented Jun 3, 2021 via email

@amizer12
Copy link
Author

amizer12 commented Jun 3, 2021

Thanks for your reply - i found the way to do it looking through some other issues in here - will post and update to README.md file to cover this as i`m sure a lot of people will have issues with it as well.

@rojer
Copy link
Contributor

rojer commented Jun 3, 2021

@amizer12 see here for how to work with fonts from js - https://github.com/mongoose-os-apps/example-m5stack-js/blob/master/fs/init.js#L72

@rojer
Copy link
Contributor

rojer commented Jun 3, 2021

this uses a function in C - https://github.com/mongoose-os-apps/example-m5stack-js/blob/master/src/main.c#L26

i guess we could upstream it here for reuse

@rojer
Copy link
Contributor

rojer commented Jun 3, 2021

Thanks for your reply - i found the way to do it looking through some other issues in here - will post and update to README.md file to cover this as i`m sure a lot of people will have issues with it as well.

yes, please!

@amizer12
Copy link
Author

amizer12 commented Jun 3, 2021

@rojer that was exactly what ive found and is working - ill add this to the readme tomorrow, will also do some more tests on how to add even more cusotm fonts in there

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