-
Notifications
You must be signed in to change notification settings - Fork 12
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
Testing glyph rendering capacity for CJK fonts #126
Comments
1024x1024 is not large enough to render a "worst case scenario".. You can load a lot of glyphs at z10, and 60degree tilt to load more tiles on the screen, then pan around a little bit. see mapbox/mapbox-gl-js#1923 (comment) "I have been testing around this location in Southern China: # 10.01/22.9452/113.1932 - set tilt to maximum to load as many tiles as possible, and scroll around. It does take a LOT of scrolling to get to 2048x2048, and even textures larger than that are considered safe for WebGL." |
ResultsThese two tests for character count rendering used Chinese Streets data on a sample map, only plotting road labels, pois, and place_labels. Tests are both passing possibly because the range of 700 or 1350 characters are not solely Chinese characters. The Noto CJK SC font contains all four languages characters: S Chinese, T Chinese, Japanese and Korean and the languages are mixed together in the Test 1Test 1 used generated bbox-test1.geojson with roughly 86 points testing about 700 characters. Test 2Test 2 used generated bbox-test2.geoson with roughly 139 points and 1350 characters. Next stepsInstead of grabbing the assumed range of Chinese characters, like I did with these tests... Test 1 was 385 to 1085 and Test 2 was 385 to 1735 .... @xrwang and I are looking to approach this differently and either find reliable way to only test Chinese characters, possibly using online sources for CJK table data. Then run the two tests again with only Chinese characters being rendered. Or, can we change the way gl makes that spritesheet of glyphs / the glyph atlas? Maybe it doesn't make sense to grab the /cc @yhahn |
echoing @amyleew's comment, we're finding the unicode ranges for cjk, and just SC (simplified chinese) are bit complicated. We want to figure out if, on GL / fontnik, when the font stack goes from pbf ---> sdf ---> texture, it can be selective aka we can have more control over which characters end up on the glyph texture. From tests / the way the table is arranged, https://en.wikipedia.org/wiki/List_of_CJK_Unified_Ideographs,_part_1_of_4 since the numerical sequence is by radical and not by frequency of use, we actually don't need entire ranges of characters from the font, only intermittent ones. Ie, instead of putting an entire range of characters, 0-6000 on the glyph texture, could the current set up work with putting 0-40, value 1000, value 1234, value 1568, etc ? |
“Frequency of use” may be a deceiving metric if it’s based on written-use, rather than use in place names. In Japan, at least, there are places that use very uncommon characters in their names. I couldn’t find a good list of rare-character names, but this list has some discussion of unusual place name readings and bit on the use of obsolete, non-jōyō kanji. |
Glyph atlasPer chat w/ @nickidlugash @xrwang, we're looking to examine the I was able to get a Next stepsTake these tests into Studio to visualize the glyph atlas and see:
|
@xrwang @friedbunny The only glyphs that should end up in the glyph atlas are those that will actually be needed to render labels - we may download many more glyph ranges because of the way we split glyph ranges into PBFs, but that's a separate problem from glyph atlas overflow, one I started exploring a while ago in mapbox/node-fontnik#36 The glyph "atlas" is just a 1024x1024 image, so the exact number of glyphs it fits may vary depending on the size of the glyph ( |
Yes, echoing everything @mikemorris said above... Also the actual atlas texture layout can depend on which tiles happen to load before which other tiles. (This happens asynchronously). |
Closed by #131 |
To test glyph texture size (currently
1024x1024
) to ensure it's large enough to render a kind of "worst case scenario" (that is still realistic) china mapview. We're simulating stress tests of displaying CJK characters.@xrwang and I worked on the inital rendering test which maxed out point and character density, and it failed, as expected. The second test case should reflect what could realistically represent the text diversity/density of a china map view.
Setup
china-test
branch of the GL test suite repo & npm link it into place with GL JSIn theory there should be a test that should push GL JS to its very limit of glyph atlas space. Then we'll want to see if native can pass the test (probably not, GL Native should behave exactly like GL JS) and work toward parity. (per @yhahn)
Background
Next steps
@mapbox/cartography-cats
The text was updated successfully, but these errors were encountered: