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

add local fonts loader #17

Closed
wants to merge 6 commits into from

Conversation

jonlepage
Copy link

@jonlepage jonlepage commented Jan 5, 2020

Allow local fonts loading, cool feature

image

Work fine but plz wait, need add more stuff like base64 to sessionStorage and clear for reset custom fonts cache.
Maybe finish this tonight or tomorrow.

this will useful for me and i think some people also request this
#14 (comment)

Allow local fonts loading
primary ans base stuff.
Easly test fonts, custom fonts with most popular language with special charactere.
Using free translate.yandex API.
@jonlepage
Copy link
Author

textstyle extend tool

@bigtimebuddy
Copy link
Contributor

bigtimebuddy commented Jan 6, 2020

This is awesome!

My only feedback is that: would you mind encapsulating the translation and font stuff into separate components? You're overloading the main TextStyleEditor class.

After this is merged, I'm going to upgrade to React, TypeScript, Bootstrap 4, and a more current toolchain. mithril is no longer serving us well if we are going to start making this tool more complex.

@jonlepage
Copy link
Author

sure, am noob with this kind of environment project but i studying how you do from the other pr, i will try my best to refactoring this more clean soon as possible.
I also want to refactoring de loader to get multi files instead of single files.

then there will remain a small detail which is piss me off since the beginning, is these colors selector window, my first attempt fail, but I think I understand better the architecture of the project now, i will try again the implementation of http://jscolor.com/
Tell me if is fine or you prefer use another kind of api ?

@bigtimebuddy
Copy link
Contributor

I’m also happy to clean this up, if that’s easier.

As far as the color selector, moving to React will be helpful as there are more components in that ecosystem. Hold off on that for now, I can tackle it in the next iteration.

@jonlepage
Copy link
Author

ok thank it almost done.
i just found a bug, i will need fix this.
image
I trying import a big fonts (10mo) localStorage seem have limit.
from what i reading, it seem have limitation
https://johnresig.com/blog/dom-storage/

i didn't know that
so Il will also need create a hashing logic.

@jonlepage
Copy link
Author

jonlepage commented Jan 6, 2020

ho ok forget me
https://demo.agektmr.com/storage/
i just try fill the localstorage with this tool and it seem 9Mo for global limit

Am curious if we can up the limit of this from browser ?
or i will avoid save big fonts

@jonlepage
Copy link
Author

Done, I tried to do the best I could to do as you did for the other pr, but I didn't get there, I was get errors on errors and very difficult to debug without correct environment.
So I cheated to make it functional by separate module.

everything works well and tested, but I think you will need make a clean pass, because I can not do better with my programming knowledge.
sorry for this, but all work fine from my test despite my weird approach.

@bigtimebuddy
Copy link
Contributor

Great work thanks

@jonlepage
Copy link
Author

jonlepage commented Jan 6, 2020

With regard to the translate tool, I am not a linguistic expert.
But the idea was just to provide a fast character convertor that contain special characters for test fonts, so I don't know them all.
I just take random language i know from most popular steam language.
image
But you can maybe refactoring this as you like , add more or less, if you know more popular languages with special characters...

@bigtimebuddy bigtimebuddy mentioned this pull request Jan 13, 2020
@bigtimebuddy
Copy link
Contributor

Closing this and replacing with #20, will do a follow-up with translation afterwards. Fonts seems more important to get in right away.

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