style: 使用本地字体库

This commit is contained in:
baiqi 2024-07-05 14:43:25 +08:00 committed by Craftsman
parent a8e397654d
commit de8a216ef0
11 changed files with 15 additions and 6 deletions

View File

@ -7,6 +7,15 @@
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
@font-face {
font-family: AlibabaPuHuiTi;
src: url('../font/AlibabaPuHuiTi-3-55-Regular.woff') format('woff'),
url('../font/AlibabaPuHuiTi-3-55-Regular.ttf') format('truetype'),
url('../font/AlibabaPuHuiTi-3-55-Regular.eot') format('eot'),
url('../font/AlibabaPuHuiTi-3-55-Regular.otf') format('opentype'),
url('../font/AlibabaPuHuiTi-3-55-Regular.woff2') format('woff2');
}
* { * {
@apply box-border; @apply box-border;
} }
@ -15,6 +24,7 @@ body {
@apply m-0 h-full w-full p-0; @apply m-0 h-full w-full p-0;
font-size: 14px; font-size: 14px;
font-family: 'PingFang SC', AlibabaPuHuiTi !important;
color: var(--color-text-1); color: var(--color-text-1);
background-color: var(--color-bg-1); background-color: var(--color-bg-1);
line-height: 22px; line-height: 22px;

View File

@ -76,7 +76,7 @@
.menu-item { .menu-item {
height: 38px; height: 38px;
line-height: 38px; line-height: 38px;
font-family: 'PingFang SC'; font-family: 'PingFang SC', AlibabaPuHuiTi;
} }
} }
} }

View File

@ -60,7 +60,7 @@ function getSVGInfo(minder: any) {
$svg[index].setAttribute('width', renderBox.width + 1); $svg[index].setAttribute('width', renderBox.width + 1);
$svg[index].setAttribute('height', renderBox.height + 1); $svg[index].setAttribute('height', renderBox.height + 1);
$svg[index].setAttribute('style', 'font-family: Arial, "Microsoft Yahei","Heiti SC";'); $svg[index].setAttribute('style', 'font-family: "PingFang SC",AlibabaPuHuiTi;');
const div = document.createElement('div'); const div = document.createElement('div');
div.appendChild($svg[index]); div.appendChild($svg[index]);

View File

@ -41,7 +41,7 @@ function exportSVG(minder: any) {
$svg[index].setAttribute('height', height + padding * 2 || 0); $svg[index].setAttribute('height', height + padding * 2 || 0);
$svg[index].setAttribute( $svg[index].setAttribute(
'style', 'style',
`font-family: Arial, "Microsoft Yahei", "Heiti SC"; background: ${minder.getStyle('background')}` `font-family: 'PingFang SC',AlibabaPuHuiTi; background: ${minder.getStyle('background')}`
); );
$svg[index].setAttribute( $svg[index].setAttribute(

View File

@ -38,8 +38,7 @@ div.minder-editor-container {
right: 0; right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
font-family: Arial, 'PingFang SC', 'Helvetica Neue', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', font-family: 'PingFang SC', AlibabaPuHuiTi;
sans-serif;
} }
.minder-editor { .minder-editor {
@apply absolute bottom-0 left-0 right-0; @apply absolute bottom-0 left-0 right-0;

View File

@ -134,7 +134,7 @@
.menu-item { .menu-item {
height: 38px; height: 38px;
line-height: 38px; line-height: 38px;
font-family: 'PingFang SC'; font-family: 'PingFang SC', AlibabaPuHuiTi;
} }
} }
} }