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

throw error mismatched image size , when text-field is chinese #718

Closed
laofan1ku opened this issue Dec 16, 2021 · 11 comments
Closed

throw error mismatched image size , when text-field is chinese #718

laofan1ku opened this issue Dec 16, 2021 · 11 comments

Comments

@laofan1ku
Copy link

maplibre-gl-js version:2.0.0-pre.6

browser:chrome

Steps to Trigger Behavior

  1. when symbol layer > layout> text-field is chinese
  2. throw error "mismatched image size"

maplibre-gl-unminified.txt
testhtml.txt

@laofan1ku
Copy link
Author

laofan1ku commented Dec 16, 2021

plese Change the suffix with .js and .html

@smellman
Copy link
Contributor

I get same error with Japanese text-field.

https://codepen.io/smellman/pen/dyVwjYm

@smellman
Copy link
Contributor

It raise from here.
https://github.com/maplibre/maplibre-gl-js/blob/main/src/util/image.ts#L24

We provides English style and Japanese style.
English style: https://tile.openstreetmap.jp/styles/maptiler-basic-en/style.json
Japanese style: https://tile.openstreetmap.jp/styles/maptiler-basic-ja/style.json
English style run well but Japanese style can't run in v2 release.

@smellman
Copy link
Contributor

I fixed it with localIdeographFontFamily: null to disable local font.

@smellman
Copy link
Contributor

maybe fix this issue by PR 775

@Nikkolast88
Copy link

me too !

@laofan1ku
Copy link
Author

我也是!
The above method can solve this problem

@HarelM
Copy link
Member

HarelM commented Jan 27, 2022

The above linked PR should solve this I assume, but we need someone to create a test to make sure this is actually solving the issue and making sure it won't break in the future.
Can any of you write a test? even here in this thread and I'll copy it to the relevant place in the tests.
Here are some instruction we wrote to help with writing tests:
https://github.com/maplibre/maplibre-gl-js/tree/main/test#writing-unit-tests

@HarelM
Copy link
Member

HarelM commented Jan 29, 2022

I've updated the tests to use tinySDF so I think the tests part is covered.
But when I surf to https://codepen.io/smellman/pen/dyVwjYm I don't see any console warning or errors.
What am I missing?

@HarelM
Copy link
Member

HarelM commented Jan 29, 2022

See #917

@HarelM
Copy link
Member

HarelM commented Feb 4, 2022

Closed by #917 I believe.

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

No branches or pull requests

4 participants