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}"
;};