-
-
Notifications
You must be signed in to change notification settings - Fork 715
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
Label in many tiles are not rendered when using fonts of browser #3302
Comments
Can you inline only the relevant part of the style in the reproduction? Going over the entire style might prove problematic. |
Is it okay? |
I guess the problem is related to occur in following codes (actor.send('getGlyphs' ): maplibre-gl-js/src/source/worker_tile.ts Line 151 in 381b1de
I should understand "life of tile"... |
I've just rewritten this whole area as part of a major refactoring I did. |
Okay, I'll try it. |
Yes, I've seen some weird stuff in this code, also in the caching code I refactored in that same class, but I'm not familiar enough with all this logic there... |
I reached two:
|
the function _doesCharSupportLocalGlyph(id: number): boolean {
/* eslint-disable new-cap */
return !!this.localIdeographFontFamily &&
(id < 256 || // Basic Latin
unicodeBlockLookup['CJK Unified Ideographs'](id) || //19968 - 40959
unicodeBlockLookup['Hangul Syllables'](id) || // 44032 - 55215
unicodeBlockLookup['Hiragana'](id) || // 12352 - 12447
unicodeBlockLookup['Katakana'](id) || // 12448 - 12543
unicodeBlockLookup['CJK Symbols and Punctuation'](id)); // 12288 - 12351
/* eslint-enable new-cap */
} I added It is unclear for me why these codes consider only CJK text. These don't take into accont even Basic Latin. At least, the range should depends on a font, not hard-coded. |
You might want to wait until your .ttf font is loaded before you create the maplibregl instance. |
Thanks eyeryone, I can understand the behavior. https://github.com/wipfli/about-text-rendering-in-maplibre This is very nice document for me! Then, the problem seems to be in that once a font specified in style doesn't exist in local and server, rendering entire a tile not only labels would be stopped. |
maplibre-gl-js version: v3.5.2
browser: Google Chrome Version 118.0.5993.117 (Official Build) (arm64)
Steps to Trigger Behavior
Link to Demonstration
https://jsbin.com/ragetuhoba/edit?html,output
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: