You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to add diffrent fontFamily Conditionally but not able to add it this is my code can you tell me what is the issue
const handleCanvas = async (canvas: any, fontFamily: string) => {
const FONT_SIZE = 200;
if (canvas) {
canvas.width = 1000;
canvas.height =200;
const ctx = canvas.getContext('2d');
ctx.textAlign = 'center';
ctx.textBaseline = 'top';
// ctx.font = ${FONT_SIZE}px "${font}"
ctx.font = ${FONT_SIZE}px "${fontFamily}";
I am trying to add diffrent fontFamily Conditionally but not able to add it this is my code can you tell me what is the issue
const handleCanvas = async (canvas: any, fontFamily: string) => {
const FONT_SIZE = 200;
if (canvas) {
canvas.width = 1000;
canvas.height =200;
const ctx = canvas.getContext('2d');
ctx.textAlign = 'center';
ctx.textBaseline = 'top';
// ctx.font =
${FONT_SIZE}px "${font}"
ctx.font =
${FONT_SIZE}px "${fontFamily}"
;};
The text was updated successfully, but these errors were encountered: