jillana
December 10, 2021, 11:17am
1
Good Morning all ,
I have a problem when i try to fit the text in a div when this one is bigger than the div, i use a function is call Fittowidht.
The problem i think is the font is not loaded at the beginning so i use another function is:
And here is the real problem , when i go throw the web is working perfectly
but when i build for sending to casparcg this method is not working at all and i dont know how to fixed
any idea what is going on ??
Thanks
If you comment out these console.log
lines, while you play it in Caspar, do they show up in the console or the log file? In other words: Are you sure, that document.fonts.ready.then
fires in Caspar?
jillana
December 10, 2021, 11:46am
4
sorry i mean is fire in caspar but still not working
1 Like
Probably a timing issue. FitText is running before the text has been inserted into the DOM from the update() call.
jillana
December 10, 2021, 2:27pm
6
hreinnbeck:
FitTe
And how i can fix that i use this
link rel=âpreloadâ href=â./fonts/PierSans-Black.otfâ as=âfontâ crossorigin=âanonymousâ
in web is working but in caspar dont, how can i preload a font in caspar ???
Andrea
December 10, 2021, 7:01pm
8
I would suggest to put a
setTimeout()
to reload the function a bit later, so you can understand if it is a timing problem.
bencius
December 12, 2021, 10:36pm
9
Check if Chromium versions are the same with CasparCG and Web browser, sometimes there is an issue when something works on web but not Caspar.
jillana
December 13, 2021, 7:34am
10
how can i check the Chromium version on casparcg ??
thanks for the asnwer
jillana
December 13, 2021, 7:45am
11
Andrea:
setTimeout()
play() {
// Caspar PLAY directive
setTimeout(() => {
fitToWidth(â.ftwâ);
}, 500);
},
Thank you its work