Skip to content

Commit accb7b7

Browse files
committed
handle array font family, weight, style & variant in gl-scatter3d
1 parent 593717b commit accb7b7

File tree

5 files changed

+34
-9
lines changed

5 files changed

+34
-9
lines changed

stackgl_modules/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22083,6 +22083,32 @@ function get_glyphData(glyphs, index, font, pixelRatio) {
2208322083
visible = false
2208422084
}
2208522085

22086+
if(!font) font = {}
22087+
22088+
var family = font.family
22089+
if(Array.isArray(family)) family = family[index]
22090+
if(!family) family = "normal"
22091+
22092+
var weight = font.weight
22093+
if(Array.isArray(weight)) weight = weight[index]
22094+
if(!weight) weight = "normal"
22095+
22096+
var style = font.style
22097+
if(Array.isArray(style)) style = style[index]
22098+
if(!style) style = "normal"
22099+
22100+
var variant = font.variant
22101+
if(Array.isArray(variant)) variant = variant[index]
22102+
if(!variant) variant = "normal"
22103+
22104+
var glyph = getGlyph(str, {
22105+
family: family,
22106+
weight: weight,
22107+
style: style,
22108+
variant: variant,
22109+
}, pixelRatio)
22110+
22111+
2208622112
var glyph = getGlyph(str, font, pixelRatio)
2208722113

2208822114
return { mesh:glyph[0],

stackgl_modules/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stackgl_modules/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"gl-plot2d": "github:gl-vis/gl-plot2d#ac02a12ec9fa5283a79c042b900dfd0707c43891",
2323
"gl-plot3d": "^2.4.7",
2424
"gl-pointcloud2d": "^1.0.3",
25-
"gl-scatter3d": "github:gl-vis/gl-scatter3d#0019ba0197eb2196cedc288a25d1180facd54af6",
25+
"gl-scatter3d": "github:gl-vis/gl-scatter3d#9504c1bff7d9cfed8a85866cbc5e47cb32bdfb9a",
2626
"gl-select-box": "^1.0.4",
2727
"gl-shader": "4.3.1",
2828
"gl-spikes2d": "^1.0.2",
-1.17 KB
Loading

test/image/mocks/zz-gl3d_font-variant-scatter.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"textfont": {
1717
"family": "Inter",
1818
"size": 16,
19-
"variant": "unicase",
20-
"_variant": [
19+
"variant": [
2120
"normal",
2221
"unicase",
2322
"small-caps",

0 commit comments

Comments
 (0)