diff --git a/test/ignores.json b/test/ignores.json index f2be122166e..f571afc52c7 100644 --- a/test/ignores.json +++ b/test/ignores.json @@ -12,5 +12,17 @@ "render-tests/runtime-styling/image-update-pattern": "skip - https://github.com/mapbox/mapbox-gl-js/issues/4804", "render-tests/mixed-zoom/z10-z11": "current behavior conflicts with https://github.com/mapbox/mapbox-gl-js/pull/6803. can be fixed when https://github.com/mapbox/api-maps/issues/1480 is done", "render-tests/fill-extrusion-pattern/tile-buffer": "https://github.com/mapbox/mapbox-gl-js/issues/4403", - "render-tests/symbol-sort-key/text-ignore-placement": "skip - text drawn over icons" + "render-tests/symbol-sort-key/text-ignore-placement": "skip - text drawn over icons", + "render-tests/icon-text-fit/both-padding": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/icon-text-fit/both": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/icon-text-fit/height-padding": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/icon-text-fit/height": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/icon-text-fit/placement-line": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/icon-text-fit/width-padding": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/icon-text-fit/width": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/regressions/mapbox-gl-js#5631": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/text-variable-anchor/all-anchors-icon-text-fit": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/text-variable-anchor/icon-text-fit-collision-box": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit": "https://github.com/mapbox/mapbox-gl-js/issues/8583", + "render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit": "https://github.com/mapbox/mapbox-gl-js/issues/8583" } diff --git a/test/integration/render-tests/icon-text-fit/both-padding/expected.png b/test/integration/render-tests/icon-text-fit/both-padding/expected.png index 4cd6146da58..488099e3dbf 100644 Binary files a/test/integration/render-tests/icon-text-fit/both-padding/expected.png and b/test/integration/render-tests/icon-text-fit/both-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both/expected.png b/test/integration/render-tests/icon-text-fit/both/expected.png index d808e49081f..293d3854925 100644 Binary files a/test/integration/render-tests/icon-text-fit/both/expected.png and b/test/integration/render-tests/icon-text-fit/both/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/height-padding/expected.png b/test/integration/render-tests/icon-text-fit/height-padding/expected.png index 05668399f0d..1cc77cba5c2 100644 Binary files a/test/integration/render-tests/icon-text-fit/height-padding/expected.png and b/test/integration/render-tests/icon-text-fit/height-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/height/expected.png b/test/integration/render-tests/icon-text-fit/height/expected.png index 84b471b5b99..678eade07cd 100644 Binary files a/test/integration/render-tests/icon-text-fit/height/expected.png and b/test/integration/render-tests/icon-text-fit/height/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/placement-line/expected.png b/test/integration/render-tests/icon-text-fit/placement-line/expected.png index a971c9ed60a..8c0f2ba16f1 100644 Binary files a/test/integration/render-tests/icon-text-fit/placement-line/expected.png and b/test/integration/render-tests/icon-text-fit/placement-line/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/width-padding/expected.png b/test/integration/render-tests/icon-text-fit/width-padding/expected.png index 95bc9e07e5c..24d57024d2c 100644 Binary files a/test/integration/render-tests/icon-text-fit/width-padding/expected.png and b/test/integration/render-tests/icon-text-fit/width-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/width/expected.png b/test/integration/render-tests/icon-text-fit/width/expected.png index baba8e3d0fe..cd08e53a6d6 100644 Binary files a/test/integration/render-tests/icon-text-fit/width/expected.png and b/test/integration/render-tests/icon-text-fit/width/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5631/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#5631/expected.png index 351ff4a286f..54f96ca198f 100644 Binary files a/test/integration/render-tests/regressions/mapbox-gl-js#5631/expected.png and b/test/integration/render-tests/regressions/mapbox-gl-js#5631/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/expected.png new file mode 100644 index 00000000000..9ea2fb269d1 Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/style.json b/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/style.json new file mode 100644 index 00000000000..91c342c0363 --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/style.json @@ -0,0 +1,66 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256 + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 14, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/{z}-{x}-{y}.mvt" + ] + } + }, + "sprite": "local://sprites/sprite", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "top", + "type": "symbol", + "source": "mapbox", + "source-layer": "poi_label", + "filter": [ + "==", + "maki", + "restaurant" + ], + "layout": { + "icon-image": "motorway_lg_6", + "icon-text-fit": "both", + "icon-text-fit-padding": [5, 5, 5, 5], + "text-field": "Test Test Test", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-max-width": 5, + "text-justify": "auto", + "text-variable-anchor": [ + "center", + "top", + "bottom", + "left", + "right", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ] + } + }] +} diff --git a/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/expected.png b/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/expected.png new file mode 100644 index 00000000000..8e76c3e2536 Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/style.json b/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/style.json new file mode 100644 index 00000000000..08b27c445ce --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/style.json @@ -0,0 +1,68 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128, + "collisionDebug": true + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "image": "motorway_lg_4" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 0, + -10 + ] + } + }, + { + "type": "Feature", + "properties": { + "image": "motorway_lg_6" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 0, + 10 + ] + } + } + ] + } + } + }, + "sprite": "local://sprites/sprite", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "geojson", + "layout": { + "icon-image": ["get", "image"], + "icon-text-fit": "both", + "icon-text-fit-padding": [8, 8, 8, 8], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-justify": "auto", + "text-variable-anchor" : ["top-left", "bottom-right"], + "text-radial-offset": 0.5, + "text-field": ["get", "image"] + } + } + ] +} diff --git a/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/expected.png b/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/expected.png new file mode 100644 index 00000000000..46897a3970a Binary files /dev/null and b/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/expected.png differ diff --git a/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/style.json b/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/style.json new file mode 100644 index 00000000000..718556c6b58 --- /dev/null +++ b/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/style.json @@ -0,0 +1,85 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "name_jp": "マップLineボックス" + }, + "geometry": { + "type": "Point", + "coordinates": [ 0, 14 ] + } + }, + { + "type": "Feature", + "properties": { + "name_jp": "マップボNewックス" + }, + "geometry": { + "type": "Point", + "coordinates": [ 0, 14 ] + } + }, + { + "type": "Feature", + "properties": { + "name_jp": "マップボックス" + }, + "geometry": { + "type": "Point", + "coordinates": [ 0, 14 ] + } + }, + { + "type": "Feature", + "properties": { + "name_jp": "マップボNewックス" + }, + "geometry": { + "type": "Point", + "coordinates": [ 0, -32 ] + } + } + ] + } + } + }, + "sprite": "local://sprites/sprite", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "icon-image": "motorway_lg_6", + "icon-text-fit": "both", + "icon-text-fit-padding": [5, 5, 5, 5], + "text-field": "{name_jp}", + "text-writing-mode": ["vertical", "horizontal"], + "text-radial-offset": 3, + "text-variable-anchor": ["center", "left", "right", "bottom"], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-size": 10, + "text-max-width": 8 + } + } + ] +} diff --git a/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/expected.png b/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/expected.png new file mode 100644 index 00000000000..e043607d2aa Binary files /dev/null and b/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/expected.png differ diff --git a/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/style.json b/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/style.json new file mode 100644 index 00000000000..6721685d90e --- /dev/null +++ b/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/style.json @@ -0,0 +1,62 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "name_jp": "マップボックス\nabc123\na1ボックス" + }, + "geometry": { + "type": "Point", + "coordinates": [ 0, 15 ] + } + }, + { + "type": "Feature", + "properties": { + "name_jp": "aマップボックス\nボックスabc123" + }, + "geometry": { + "type": "Point", + "coordinates": [ 0, -30 ] + } + } + ] + } + } + }, + "sprite": "local://sprites/sprite", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "icon-image": "motorway_lg_6", + "icon-text-fit-padding": [7, 7, 7, 7], + "icon-text-fit": "both", + "text-field": "{name_jp}", + "text-writing-mode": ["vertical", "horizontal"], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-size": 10 + } + } + ] +}