glyphr-studio / Glyphr-Studio-1

Now deprecated, Glyphr Studio v1 served us well from 2010 to 2023.
https://www.glyphrstudio.com
1.07k stars 94 forks source link

Increase loading speed for CJK block #343

Closed NightFurySL2001 closed 1 year ago

NightFurySL2001 commented 1 year ago

Is it possible to only show the characters in a font instead of loading the full range of block by default for CJK Unified Ideographs and Extension A? The sheer size of the block makes the website unresponsive for a while.

mattlag commented 1 year ago

Ooo - you are right, 20k code points is probably way to many to load at once:

image

Looks like Hangul Syllables may also be a contender to split up with 11k code points:

image

@NightFurySL2001 do you have an opinion about where the breakpoints should be? I could do arbitrary ranges of, say, 1000 (or maybe 1312 so it's divisible by 16) - I can do a bit more investigation, but i'm not familiar with the meanings of the characters in this range, so if there is some logical way to split up the range into chunks, let me know.

I'll look into this - thanks!

mattlag commented 1 year ago

After some quick experiments, I'm thinking of splitting long ranges into chunks of 0x1000 or 4096 characters each.

NightFurySL2001 commented 1 year ago

You could try breaking it in terms of the kRSUnicode property, but it would give ranges with length 500 to 5000 and anything in between. Breaking it every 0x1000 is a good choice for me if it can increase the loading speed. (Or maybe 0x400 trade-off with more blocks in range)

It would be better if it's possible to edit characters from outside BMP as they might be used in Chinese too.

There is a more logical way to break up Hangul Syllables, but I need to find the material for the length of it.

mattlag commented 1 year ago

For sure the smaller ranges load faster - in my tests they are working pretty well. I like the generic size because I'm also going to split up some of the other large ranges, not just the CJK ones. I'm probably going to ship this update in a few days.

I'm investigating code points above BMP for Glyphr Studio v2 which is currently being developed. As it stands, Glyphr Studio v1 assumes BMP is the limit, and it would be a pretty big change to update it all (mainly code points are hard coded at 4 hex digits, which BMP+ starts to use 5). Since I'm basically writing Glyphr Studio v2 from scratch, I'm not making it a hard limit... but I also have to do some investigation to see how well OpenType.js supports BMP+. Anyway, stay tuned for more on that with Glyphr Studio v2.

mattlag commented 1 year ago

FYI I just shipped 1.13.18 which included the fix for enabling smaller ranges by default. You can create custom ranges that are as small as you want... and adding/removing ranges does not delete glyphs, it only affects what options are available in the Glyph Chooser panel. So removing large ranges and adding back smaller ones won't affect any glyphs you may already have designed.