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

[boxclk] - v0.03 update - New custom font library. Allows short or long month #2833

Merged
merged 16 commits into from
Jun 22, 2023

Conversation

stweedo
Copy link
Contributor

@stweedo stweedo commented Jun 21, 2023

No description provided.

@stweedo stweedo changed the title [boxclk] - Update screenshots and README to include example configs [boxclk] - v0.03 update - Allows month to be shown short or long Jun 21, 2023
@stweedo stweedo changed the title [boxclk] - v0.03 update - Allows month to be shown short or long [boxclk] - v0.03 update - New custom font library. Allows short or long month Jun 22, 2023
@stweedo
Copy link
Contributor Author

stweedo commented Jun 22, 2023

I seem to have broken the remove function in setUI with my new font module. It works to enter the launcher and then comes back to the clock, but at that point the module is no longer loaded and i get "unloadCustomBoxClkFonts" is not defined.

Is it possible to use an exported function from a module in the remove argument of setUI a second time after using it once the first time and coming back?

@stweedo
Copy link
Contributor Author

stweedo commented Jun 22, 2023

The thought process for creating the font module was to store all the custom fonts there along with a function that intelligently loads only the ones that will be used in order to keep RAM usage down (only loading the fonts needed) and keep the main app light and slim without loading up or containing unused fonts. Is something like this doable?

I realize now it still would have loaded all of the fonts from "lib.js" into RAM with the way I had it. When I initially tried to selectively export the fonts, it was telling me setCustomFont (what the Graphics.prototype returns) is undefined within my module. So then I went with the method shown in the reverted commit.

@gfwilliams
Copy link
Member

Yes, unfortunately putting all the fonts in one module would be just as slow (if not more!) than putting them in the app.

If you had a separate library for each font that'd be better - however in the cutting edge builds I've added support for loading font files direct from storage (using Pebble's PBF font format) so really, that'd be the way to go.

@gfwilliams gfwilliams merged commit a344a0f into espruino:master Jun 22, 2023
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

Successfully merging this pull request may close these issues.

2 participants