서명 생성 시 폰트가 일부 글자에만 적용되는 문제 수정

This commit is contained in:
dohyeons 2025-12-22 17:42:35 +09:00
parent 5f26e998e3
commit 99c0960325
1 changed files with 16 additions and 0 deletions

View File

@ -109,6 +109,22 @@ export function SignatureGenerator({ onSignatureSelect }: SignatureGeneratorProp
});
}
// 사용자가 입력한 텍스트로 각 폰트의 글리프를 미리 로드
const preloadCanvas = document.createElement("canvas");
preloadCanvas.width = 500;
preloadCanvas.height = 200;
const preloadCtx = preloadCanvas.getContext("2d");
if (preloadCtx) {
for (const font of fonts) {
preloadCtx.font = `${font.weight} 124px ${font.style}`;
preloadCtx.fillText(name, 0, 100);
}
}
// 글리프 로드 대기 (중요: 첫 렌더링 후 폰트가 완전히 로드되도록)
await new Promise((resolve) => setTimeout(resolve, 300));
const newSignatures: string[] = [];
// 동기적으로 하나씩 생성