Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
})
.onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(applicationCharset, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
textStyleGui
.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps
})
.onChange((value: string) => {
textRenderStyle.fontVariant = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(applicationCharset, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
const textLayoutGui = gui.addFolder("TextLayout");
textLayoutGui.add(textLayoutStyle, "lineWidth", 1.0, window.innerWidth, 1.0);
textLayoutGui.add(textLayoutStyle, "maxLines", 0.0, 128, 1.0);
textLayoutGui.add(textLayoutStyle, "tracking", -3.0, 3.0, 0.1);
textLayoutGui.add(textLayoutStyle, "leading", -3.0, 3.0, 0.1);
.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
})
.onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
textRenderStyleGui
.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps
})
.onChange((value: string) => {
textRenderStyle.fontVariant = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
const textLayoutGui = gui.addFolder("TextLayout");
textLayoutGui.add(textLayoutStyle, "lineWidth", 1.0, window.innerWidth, 1.0);
textLayoutGui.add(textLayoutStyle, "maxLines", 0.0, 128, 1.0);
textLayoutGui.add(textLayoutStyle, "tracking", -3.0, 3.0, 0.1);
textLayoutGui.add(textLayoutStyle, "leading", -3.0, 3.0, 0.1);
});
});
gui.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
}).onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
gui.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps
}).onChange((value: string) => {
textRenderStyle.fontVariant = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
}
});
});
gui.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
}).onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
gui.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps
}).onChange((value: string) => {
textRenderStyle.fontVariant = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
}
.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
})
.onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
textRenderStyleGui
.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps
})
.onChange((value: string) => {
textRenderStyle.fontVariant = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
const textLayoutGui = gui.addFolder("TextLayout");
textLayoutGui.add(textLayoutStyle, "lineWidth", 1.0, window.innerWidth, 1.0);
textLayoutGui.add(textLayoutStyle, "maxLines", 0.0, 128, 1.0);
textLayoutGui.add(textLayoutStyle, "tracking", -3.0, 3.0, 0.1);
textLayoutGui.add(textLayoutStyle, "leading", -3.0, 3.0, 0.1);