From b4e79df30dd7c33f0a4fa734fd1e89cc677a9597 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 30 Oct 2024 14:00:30 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B5=B5=EC=9D=80=20=EA=B8=B0=EC=9A=B8?= =?UTF-8?q?=EC=9E=84=EA=BC=B4=20=EC=84=A0=ED=83=9D=20=EC=8B=9C=20=EB=B0=98?= =?UTF-8?q?=EC=98=81=20=EC=95=88=EB=90=98=EB=8A=94=20=ED=98=84=EC=83=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/common/useFont.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/hooks/common/useFont.js b/src/hooks/common/useFont.js index 28c78f14..595ec74c 100644 --- a/src/hooks/common/useFont.js +++ b/src/hooks/common/useFont.js @@ -1,6 +1,6 @@ import { useRecoilValue } from 'recoil' import { canvasState } from '@/store/canvasAtom' -import { fontSelector, globalFontAtom } from '@/store/fontAtom' +import { fontSelector } from '@/store/fontAtom' import { useEffect } from 'react' export function useFont() { @@ -17,7 +17,8 @@ export function useFont() { textObjs.forEach((obj) => { obj.set({ fontFamily: commonText.fontFamily.value, - fontWeight: commonText.fontWeight.value, + fontWeight: lengthText.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', + fontStyle: lengthText.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal', fontSize: commonText.fontSize.value, fill: commonText.fontColor.value, }) @@ -32,7 +33,8 @@ export function useFont() { textObjs.forEach((obj) => { obj.set({ fontFamily: dimensionLineText.fontFamily.value, - fontWeight: dimensionLineText.fontWeight.value, + fontWeight: lengthText.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', + fontStyle: lengthText.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal', fontSize: dimensionLineText.fontSize.value, fill: dimensionLineText.fontColor.value, }) @@ -47,7 +49,8 @@ export function useFont() { textObjs.forEach((obj) => { obj.set({ fontFamily: flowText.fontFamily.value, - fontWeight: flowText.fontWeight.value, + fontWeight: lengthText.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', + fontStyle: lengthText.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal', fontSize: flowText.fontSize.value, fill: flowText.fontColor.value, }) @@ -62,7 +65,8 @@ export function useFont() { textObjs.forEach((obj) => { obj.set({ fontFamily: lengthText.fontFamily.value, - fontWeight: lengthText.fontWeight.value, + fontWeight: lengthText.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', + fontStyle: lengthText.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal', fontSize: lengthText.fontSize.value, fill: lengthText.fontColor.value, })