目标:中文斜体改楷体

This commit is contained in:
ArenaDruid 2025-02-04 16:44:10 +08:00
parent f4364025db
commit a11891b8ee
3 changed files with 39 additions and 0 deletions

View File

@ -77,6 +77,7 @@ const config: QuartzConfig = {
// *caption text*
// ```
Plugin.FigureCaptions(),
Plugin.ChineseItalic(),
// Adds image lightbox support
//Plugin.Lightbox(),
],

View File

@ -0,0 +1,37 @@
import { QuartzTransformerPlugin } from "../types"
export const ChineseItalic: QuartzTransformerPlugin = () => {
return {
name: "ChineseItalic",
externalResources() {
return {
css: [
{
// 内联 CSS 直接注入到页面
content: `
@font-face {
font-family: 'ChineseItalic';
font-style: italic;
src: local('楷体'),
local('Kaiti SC'),
local('STKaiti');
unicode-range: U+4E00-9FFF;
}
em, .cm-em, i {
font-family:
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'ChineseItalic',
sans-serif;
font-style: italic;
}
`,
},
],
}
},
}
}

View File

@ -13,3 +13,4 @@ export { HardLineBreaks } from "./linebreaks"
export { RoamFlavoredMarkdown } from "./roam"
export { FigureCaptions } from "./figcaptions"
export { Lightbox } from "./lightbox"
export { ChineseItalic } from "./chinese-italic"