jessekrubin / pbfont

pbf-font(s)
Other
2 stars 2 forks source link

Issue combining fonts, start must be between 0 and 255; given Infinity #91

Closed acalcutt closed 2 months ago

acalcutt commented 2 months ago

We are seeing this issue in tileserver-gl, I have created this issue there https://github.com/maptiler/tileserver-gl/issues/1367 with information on the issue

When combining two fonts that exists, we are getting nothing returned and and error "start must be between 0 and 255; given Infinity".

@prashis looked into this and found an error at https://github.com/jessekrubin/pbfont/blob/main/src/index.ts#L80 See his information at https://github.com/maptiler/tileserver-gl/issues/1367#issuecomment-2308472841

jessekrubin commented 2 months ago

Do you have a set of test files?

jessekrubin commented 2 months ago

Temp fix is in 0.2.1. should be fixed.

acalcutt commented 2 months ago

0.2.1 seems to fix the issue for me.

Here is a demo config and style and fonts for tileserver-gl that has this issue https://wifidb.net/demo/issues/test_dark_matter.zip

Tilesever-gl can use this like

git clone https://github.com/maptiler/tileserver-gl.git
cd tileserver-gl
npm i
node . -c /path/to/test_dark_matter/config.json

You could then see the issue by going to http://127.0.0.1:8080/fonts/Metropolis%20Regular,Noto%20Sans%20Regular/5120-5375.pbf

Before the change it just returned {} image

But after the change it returns a pbf like expected

In my dark matter demo, if you use the raster version (under styles) you can see before the change it fails to load big regions image and also gives this error image

In vector view you can also see the fonts failing to load, which is how i found this issue to begin with image

jessekrubin commented 2 months ago

Adding a test might be nice. can you recreate the bug and possibly PR in the minimal test files required to recreate the bug? otherwise can just call/close it

jessekrubin commented 2 months ago

@acalcutt Ty!

jessekrubin commented 2 months ago

Added uno test! #96