cad font fix

This commit is contained in:
ysj7705 committed 2026-07-21 19:42:45 +09:00
1 parent e18eab7a64
commit cbf05a9ee1
5 files changed
+681 -8

No files matched your search

+18 -2
View File
@@ -29,9 +29,11 @@ const WORKERS = {
const router = useRouter();
const fileInput = ref<HTMLInputElement | null>(null);
const localFile = ref<File>();
const pendingFile = ref<File>();
const filename = ref('CAD 도면');
const ready = ref(false);
const viewerCreated = ref(false);
const fontReady = ref(false);
const error = ref('');
const notice = ref('');
const theme = useSystemTheme();
@@ -51,7 +53,8 @@ settings.set('isShowToolbar', true);
function applyFiles(files: File[]) {
const file = files.find((item) => /\.(?:dxf|dwg)$/i.test(item.name));
if (!file) return;
localFile.value = file;
pendingFile.value = file;
if (fontReady.value) localFile.value = file;
filename.value = file.name;
error.value = '';
notice.value =
@@ -103,6 +106,19 @@ function onFileSelected(event: Event) {
void nextTick();
}
async function onViewerCreated() {
viewerCreated.value = true;
try {
await AcApDocManager.instance.loadFonts(['Noto Sans KR']);
} catch {
notice.value =
'대체 글꼴을 불러오지 못했습니다. 일부 CAD 문자가 표시되지 않을 수 있습니다.';
} finally {
fontReady.value = true;
if (pendingFile.value) localFile.value = pendingFile.value;
}
}
function onClose() {
void router.push({ name: 'home' });
}
@@ -140,7 +156,7 @@ function onClose() {
:progressive-rendering="true"
:fail-on-font-load-error="false"
locale="en"
@create="viewerCreated = true"
@create="onViewerCreated"
/>
<div v-if="ready && !localFile && viewerCreated" class="empty-state">
<strong>CAD 도면을 선택해 주세요.</strong>
+8 -3
View File
@@ -31,6 +31,11 @@ const thirdParty = [
license: 'MPL-2.0',
url: 'https://github.com/ThatOpen/engine_web-ifc',
},
{
name: 'Noto Sans KR',
license: 'SIL OFL 1.1',
url: 'https://github.com/notofonts/noto-cjk',
},
{ name: 'Express', license: 'MIT', url: 'https://github.com/expressjs/express' },
{ name: 'jsonwebtoken', license: 'MIT', url: 'https://github.com/auth0/node-jsonwebtoken' },
{ name: 'multer', license: 'MIT', url: 'https://github.com/expressjs/multer' },
@@ -98,9 +103,9 @@ const thirdParty = [
GPL-3.0-only로 배포됩니다.
</p>
<p class="muted">
CAD 폰트는 재배포 권리가 명확한 파일만 자체 호스팅해야 합니다. 본 배포본은
상용 AutoCAD 폰트를 포함하지 않으며, 누락된 글꼴은 대체 글꼴로 표시될 수
있습니다.
상용 AutoCAD 폰트는 포함하지 않습니다. 누락된 한글·라틴 글꼴은 SIL Open
Font License 1.1의 Noto Sans KR로 대체하며, 원본 글꼴과 글자 폭·형태가
다를 수 있습니다.
</p>
</section>