change font

This commit is contained in:
Youmu Liu
2026-09-04 16:08:38 +08:00
parent ac9628d2b7
commit 9dc8732614
8 changed files with 1203 additions and 1368 deletions
+2
View File
@@ -0,0 +1,2 @@
# Generated document exports
/NITLOAD-STANDARD-NITRAC/export/
+1 -1
View File
@@ -1,6 +1,6 @@
{
"chat.tools.terminal.autoApprove": {
"/^typst compile --root \"\\.\" \"NITLOAD-STANDARD-NITRAC\\\\NITRAC-doc-1b\\.typ\" \"NITLOAD-STANDARD-NITRAC\\\\NITRAC-doc-1b-preview\\.pdf\"$/": {
"/^typst compile --root \"\\.\" \"NITLOAD-STANDARD-NITRAC\\\\NITRAC-doc-1b\\.typ\" \"NITLOAD-STANDARD-NITRAC\\\\export\\\\NITRAC-doc-1b-preview\\.pdf\"$/": {
"approve": true,
"matchCommandLine": true
}
File diff suppressed because it is too large Load Diff
Binary file not shown.
+2 -62
View File
@@ -1,68 +1,8 @@
#import "../NLI-doc-template.typ": cover, conf
#import "NITRAC-doc-template.typ": nitrac-cover, conf
#let mark-unit = 1.2cm
#let mark-blue = rgb("#4FC3F7")
#let mark-font = "SimHei"
// 大号 ITRAC:横向填满标识右侧至页面右缘,纵向精确拉伸至 6 格高。
// 顶部对齐,第 7 行(三角形收尾行)保持留白。
#let nitrac-mark = context {
let mark-x = 3.3 * mark-unit
let mark-width = 21cm - mark-x - 0.3 * mark-unit
let mark-height = 6 * mark-unit
let i-left-indent = 0.1 * mark-unit
let i-right-indent = 0.15 * mark-unit
let i-width = 1.2 * mark-unit - i-left-indent - i-right-indent
let trac-width = mark-width - 1.2 * mark-unit
let trac-offset = 1.2 * mark-unit
let probe-size = 100pt
let i = text(font: mark-font, weight: "bold", size: probe-size, fill: mark-blue)[I]
let trac = text(font: mark-font, weight: "bold", size: probe-size, fill: mark-blue)[TRAC]
let i-size = probe-size * (i-width / measure(i).width)
let trac-size = probe-size * (trac-width / measure(trac).width)
let i-mark = text(
font: mark-font,
weight: "bold",
size: i-size,
fill: mark-blue,
stroke: (paint: mark-blue, thickness: 1pt),
)[I]
let trac-mark = text(
font: mark-font,
weight: "bold",
size: trac-size,
fill: mark-blue,
)[TRAC]
let i-stretch-y = mark-height / measure(i-mark).height * 100%
let trac-stretch-y = mark-height / measure(trac-mark).height * 100%
place(
top + left,
dx: mark-x,
dy: 0pt,
box(
width: mark-width,
height: mark-height,
inset: 0pt,
scale(x: 100%, y: 100%, reflow: false, {
place(top + left, dx: i-left-indent, dy: 0pt, box(
width: i-width,
height: mark-height,
align(center + horizon, scale(x: 300%, y: i-stretch-y, reflow: false, i-mark)),
))
place(top + left, dx: trac-offset, dy: 0pt, box(
width: trac-width,
height: mark-height,
align(center + horizon, scale(x: 100%, y: trac-stretch-y, reflow: false, trac-mark)),
))
}),
),
)
}
#cover(
#nitrac-cover(
title: "确定性自动化 实时与集成",
title-en: "Deterministic Automation Real-time and Integration",
logo: nitrac-mark,
number: "NITRAC-DOC-1",
author: "Nitload Industry",
classification: "MID[中秘]SEC",
+2 -62
View File
@@ -1,68 +1,8 @@
#import "../NLI-doc-template.typ": cover, conf
#import "NITRAC-doc-template.typ": nitrac-cover, conf
#let mark-unit = 1.2cm
#let mark-blue = rgb("#4FC3F7")
#let mark-font = "SimHei"
// 大号 ITRAC:横向填满标识右侧至页面右缘,纵向精确拉伸至 6 格高。
// 顶部对齐,第 7 行(三角形收尾行)保持留白。
#let nitrac-mark = context {
let mark-x = 3.3 * mark-unit
let mark-width = 21cm - mark-x - 0.3 * mark-unit
let mark-height = 6 * mark-unit
let i-left-indent = 0.1 * mark-unit
let i-right-indent = 0.15 * mark-unit
let i-width = 1.2 * mark-unit - i-left-indent - i-right-indent
let trac-width = mark-width - 1.2 * mark-unit
let trac-offset = 1.2 * mark-unit
let probe-size = 100pt
let i = text(font: mark-font, weight: "bold", size: probe-size, fill: mark-blue)[I]
let trac = text(font: mark-font, weight: "bold", size: probe-size, fill: mark-blue)[TRAC]
let i-size = probe-size * (i-width / measure(i).width)
let trac-size = probe-size * (trac-width / measure(trac).width)
let i-mark = text(
font: mark-font,
weight: "bold",
size: i-size,
fill: mark-blue,
stroke: (paint: mark-blue, thickness: 1pt),
)[I]
let trac-mark = text(
font: mark-font,
weight: "bold",
size: trac-size,
fill: mark-blue,
)[TRAC]
let i-stretch-y = mark-height / measure(i-mark).height * 100%
let trac-stretch-y = mark-height / measure(trac-mark).height * 100%
place(
top + left,
dx: mark-x,
dy: 0pt,
box(
width: mark-width,
height: mark-height,
inset: 0pt,
scale(x: 100%, y: 100%, reflow: false, {
place(top + left, dx: i-left-indent, dy: 0pt, box(
width: i-width,
height: mark-height,
align(center + horizon, scale(x: 300%, y: i-stretch-y, reflow: false, i-mark)),
))
place(top + left, dx: trac-offset, dy: 0pt, box(
width: trac-width,
height: mark-height,
align(center + horizon, scale(x: 100%, y: trac-stretch-y, reflow: false, trac-mark)),
))
}),
),
)
}
#cover(
#nitrac-cover(
title: "确定性自动化 实时与集成",
title-en: "Deterministic Automation Real-time and Integration",
logo: nitrac-mark,
number: "NITRAC-DOC-1",
author: "Nitload Industry",
classification: "MID[中秘]SEC",
@@ -0,0 +1,44 @@
// NITRAC document-group template.
// Provides the standardized mark, cover wrapper, and body configuration.
#import "../NLI-doc-template.typ": cover, conf as base-conf
#let conf = base-conf
#let mark-unit = 1.2cm
#let mark-blue = rgb("#4FC3F7")
#let mark-font = "Bahnschrift"
// Standard NITRAC mark. The top offset is intentionally configurable here
// because the mark is positioned independently from the cover grid.
#let nitrac-mark = context {
let mark-x = 3.3 * mark-unit
let mark-width = 21cm - mark-x - 0.3 * mark-unit
let mark-height = 6 * mark-unit
let mark-padding = 1 * mark-unit
let mark-safe-height = mark-height - 0 * mark-padding
let probe-size = 100pt
let mark = text(
font: mark-font,
weight: "bold",
size: probe-size,
fill: mark-blue,
)[ITRAC]
let mark-size = probe-size * (mark-width / measure(mark).width)
let mark-text = text(font: mark-font, weight: "bold", size: mark-size, fill: mark-blue)[ITRAC]
let mark-stretch-y = mark-safe-height / measure(mark-text).height * 100%
place(
top + left,
dx: mark-x,
dy: mark-padding,
box(
width: mark-width,
height: mark-safe-height,
inset: 0pt,
scale(x: 100%, y: 100%, reflow: false, {
align(center + horizon, scale(x: 100%, y: mark-stretch-y, reflow: false, mark-text))
}),
),
)
}
#let nitrac-cover(..args) = cover(logo: nitrac-mark, ..args)
+25 -24
View File
@@ -1,16 +1,18 @@
// ============================================================
// A4 文档模板
// 封面:页边距 0,中文黑体 / 英文 Source Code Pro
// 正文:上下 3.5cm,左右 2cm,中文宋体 / 英文 Times New Roman
// 代码块:Source Code Pro
// 封面:页边距 0,标题与图案 Bahnschrift / 信息 Source Code Pro
// 正文:上下 3.5cm,左右 2cm,中文 Source Han Sans SC / 英文 IBM Plex Sans
// 代码块:IBM Plex Mono
// ============================================================
// ---- 字体配置(可按需修改)----
#let cover-cjk = "SimHei" // 封面中文:黑体
#let cover-latin = "Source Code Pro" // 封面英文
#let body-cjk = "SimSun" // 正文中文:宋体
#let body-latin = "Times New Roman" // 正文英文:新罗马
#let mono-font = "Source Code Pro" // 代码块
#let cover-cjk = "SimHei" // 封面中文回退:黑体
#let cover-latin = "Source Code Pro" // 文档信息与签名:Source Code Pro
#let cover-title-cjk = "SimHei" // 封面中文标题
#let cover-title-latin = "Bahnschrift" // 封面英文标题
#let body-cjk = "Source Han Sans SC" // 正文中文
#let body-latin = "IBM Plex Sans" // 正文英文
#let mono-font = "IBM Plex Mono" // 代码块
// ---- 封面网格系统 ----
// 坐标系:左上角为原点,x 向右、y 向下;坐标记为 (x, y) 即 (列, 行)。
@@ -41,7 +43,7 @@
// 在单位格内居中放置一个字母
#let glyph(x, y, ch, color) = cell(x, y, box(
width: unit, height: unit, inset: 0pt,
align(center + horizon, text(font: cover-cjk, size: glyph-size, weight: "medium", fill: color)[#ch]),
align(center + horizon, text(font: cover-title-latin, size: glyph-size, weight: "medium", fill: color)[#ch]),
))
// ---- 封面 ----
@@ -102,10 +104,10 @@
let cn-dy = 0.2 * unit
let is-narrow = c => str.to-unicode(c.codepoints().first()) < 0x2E80
// 西文开头时使用更明确的 0.2 格左边距,与西文标题和信息区形成视觉对齐。
let title-start-pad = if cs.len() > 0 and is-narrow(cs.first()) { 0.2 * unit } else { cn-dx }
let title-width = 21cm - unit - title-start-pad
let en-left-pad = 0.2 * unit
let en-box-width = 21cm - unit
let title-start-pad = 0pt
let title-width = 21cm - 2 * unit
let en-left-pad = 0pt
let en-box-width = 21cm - 2 * unit
// 分段:连续西文合为一段,其余每字一段
let segs = ()
let run = ""
@@ -125,7 +127,7 @@
for seg in segs {
let latin = is-narrow(seg.first())
let segment = text(
font: if latin { (cover-latin, cover-cjk) } else { (cover-cjk, cover-latin) },
font: if latin { cover-title-latin } else { cover-title-cjk },
size: glyph-size,
fill: black,
)[#seg]
@@ -152,7 +154,7 @@
let en-rows = 0
let en-gap = if cn-rows > 0 and title-en != none { 0.25 * unit } else { 0pt }
if title-en != none {
let en1 = text(font: (cover-latin, cover-cjk), size: glyph-size, fill: black)[#title-en]
let en1 = text(font: cover-title-latin, size: glyph-size, fill: black)[#title-en]
let lh = measure(en1).height
let pad = (unit - lh) / 2
let inner = {
@@ -181,12 +183,12 @@
let part-lines = ()
if part-title-text != none {
part-lines.push(text(
font: (cover-cjk, cover-latin), size: 18pt, fill: black,
font: cover-title-cjk, size: 18pt, fill: black,
)[#part-title-text])
}
if part-title-en != none {
let part-en = text(
font: (cover-latin, cover-cjk), size: 18pt, fill: black,
font: cover-title-latin, size: 18pt, fill: black,
)[#part-title-en]
let part-en-inner = {
set par(leading: 0.3em)
@@ -199,13 +201,13 @@
}
if part-lines.len() == 0 and part-info != none {
part-lines.push(text(
font: (cover-cjk, cover-latin), size: 18pt, fill: black,
font: cover-title-cjk, size: 18pt, fill: black,
)[#part-info])
}
let part-value = stack(dir: ttb, spacing: 0.35 * unit, ..part-lines)
box(
width: 10.5cm - unit,
inset: (left: 0.25 * unit, right: 0.25 * unit),
inset: (left: 0.1 * unit, right: 0.25 * unit),
align(left + top, part-value),
)
} else { none }
@@ -233,7 +235,7 @@
let cells = ()
for (label, value) in metadata {
cells.push(text(
font: (cover-cjk, cover-latin), size: 12pt,
font: (cover-latin, cover-cjk), size: 12pt,
weight: "medium", fill: luma(48%),
)[#label])
cells.push(text(
@@ -328,11 +330,10 @@
// 无序列表整体缩进一个正文字符;圆点与正文仍使用 Typst 默认间距。
set list(indent: 1em)
// 标题字体:中文黑体,英文 Source Code Pro
show heading: set text(font: (cover-latin, cover-cjk))
// 正文标题与正文使用同一套中西文字体。
show heading: set text(font: (body-latin, body-cjk))
// 代码块与行内代码:西文使用 Source Code Pro,中文显式回退到正文宋体。
// 避免 Source Code Pro 缺少中文字形时由系统选择到隶书等不合适字体。
// 代码块与行内代码:西文使用 IBM Plex Mono,中文回退到正文中文字体。
show raw: set text(font: (mono-font, body-cjk))
// 块级代码:细边框、浅色背景与自动行号;行内代码不受影响。