Closed rajatsangrame closed 1 year ago
This is fixed. I used base64 font string and made sure the animation is rendered after the font is loaded.
fetch('./fonts/poppinsbase64.txt')
.then((response) => response.text())
.then((base64) => {
let url = "url(data:font/truetype;charset=utf-8;base64," + base64 + ") format('truetype')";
let molotFont = new FontFace('Poppins-Bold', url)
molotFont.load().then(function (loadedFace) {
console.log(document.fonts)
fetch('./data01.json')
.then((response) => response.json())
.then((json) => {
loadJsonData(json)
updateText()
});
}).catch(function (error) {
console.log(error)
});
});
I am using
updateDocumentData()
to modify the text dynamically. For the browser's default font, the text is rendering properly but after updating the text I am facing this issue. I am facing issue with every font and every browser.Default Font:
With Custom Font:
JSON Data
JS Code:**