Wakamai-Fondue / wakamai-fondue-engine

The engine that powers Wakamai Fondue
Apache License 2.0
46 stars 9 forks source link

Add Specimen Skeleton char categories #24

Closed RoelN closed 3 years ago

RoelN commented 3 years ago

This code is copied over from the Specimen Skeleton project and only lightly patched so work in the WF engine. This code works, but it kinda dumb. There's a refactor issue in the Specimen Skeleton project, if that is done we should improve the code here as well.

Another small point of concern is that the GlyphData is over 5MB large! This is a pretty hefty download, so we need to be smart about loading this asset.

pascalw commented 3 years ago

@RoelN how is this supposed to work, in terms of we need to be smart about loading this asset? Currently the build is failing because Rollup out of the box doesn't support importing JSON files. We could fix that, but without any smarts, this would really negatively affect the engine size and WF site load time.

This easiest way to make this a bit better (though arguably not that smart :-P) is to lazy load the JSON data. This would require a loading indicator in the UI though, as it can probably take a couple 100 ms to download and parse this file (it's 450KB gzipped). For starters I think that's fine, let's see how well that performs and think about alternative solutions if it's really too slow.

Some other remarks:

RoelN commented 3 years ago

@pascalw As this file is only needed after the font is parsed, I think we can get away with lazy loading.

We can wait with generating a report until all the engine-related stuff like this has finished loading, and show one single "please wait, processing font..."-message. (As opposed to show an individual progress bar or something for this particular asset)

pascalw commented 3 years ago

@RoelN I noticed the glyphData is not yet lazy loaded. Do you expect me to implement this still or can this be postponed until after the beta?

RoelN commented 3 years ago

@pascalw Yes please 🙏 Especially regarding the Node/browser distinction!

pascalw commented 3 years ago

Discussed offline that we're going to merge this now as is. Lazy loading of the Fondue engine in it's entirety will be implemented soon. If need be we could implement lazy loading of the glyhpData in the engine later, but we'll see later if that's needed or not.