DONG GOI bo font Noto theo app: khong thoa hiep font he thong o bat ky tang nao
Build Windows portable / build (push) Canceled after 0s

User yeu cau: khach hang khong co font chuan san — phan mem phai tu chuan bi
font, khong duoc thay bang font "gan giong". Truoc do font nhung cua PDF da
dung cho o sua (build 35), nhung con 3 khe ho roi ve font he thong: font
khong nhung trong PDF, font CFF khong va duoc, va KY TU MOI GO VAO khong co
trong subset (subset chi chua glyph da dung).

- scripts/fetch-fonts.ps1: tai 10 file Noto hinted static (Sans/Serif/Mono,
  du Regular/Bold/Italic/BoldItalic, phu tieng Viet, ~6.7MB) + OFL license
  vao fonts/ (gitignore; CI cache theo hash script).
- CI: fetch fonts + dong fonts/ vao zip portable (canh exe).
- Tauri: main() dat FOFREEXIT_FONTS_PATH (fonts/ canh exe, dev thi goc
  workspace); command app_font_data(kind) tra base64 (whitelist 10 kind).
- UI: FontFace "ff-app-{sans|serif|mono}" dang ky theo weight/style, dung
  GIUA stack: font nhung cua PDF -> Noto dong goi -> stack he thong (luoi
  cuoi). Phan loai serif/sans/mono tu cssFontStack. Nap truoc cung font
  nhung khi vao trang sua.
- Engine find_font_bytes (duong ghi file/reflow can font coverage): uu tien
  tuyet doi fonts/ dong goi qua env — ket qua LUU ra giong nhau tren moi may
  (truoc: lay Arial/Segoe cua Windows, may khach thieu font la khac ket qua).

E2E ke tiep (build 36): go ky tu ngoai subset trong o sua -> 100% glyph phai
tu font custom (nhung/dong goi), 0 glyph he thong.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-10 12:12:26 +07:00
co-authored by Claude Fable 5
parent f6c1bc2070
commit f10cb7df2b
6 changed files with 174 additions and 6 deletions
+14
View File
@@ -41,6 +41,18 @@ jobs:
shell: pwsh
run: powershell -ExecutionPolicy Bypass -File scripts/fetch-qpdf.ps1
# Bộ font Noto đóng gói theo app (phủ tiếng Việt) — hiển thị/ghi file
# giống nhau trên mọi máy khách, không phụ thuộc font hệ điều hành.
- name: Cache bundled fonts
uses: actions/cache@v4
with:
path: fonts
key: noto-fonts-${{ hashFiles('scripts/fetch-fonts.ps1') }}
- name: Fetch bundled fonts (Noto)
shell: pwsh
run: powershell -ExecutionPolicy Bypass -File scripts/fetch-fonts.ps1
# Test OCR cần tesseract thật (eng + vie). Chocolatey có sẵn trên runner.
- name: Install Tesseract OCR (eng + vie)
shell: pwsh
@@ -75,6 +87,8 @@ jobs:
Copy-Item "qpdf/bin/*.exe" "$dist/"
Copy-Item "qpdf/bin/*.dll" "$dist/"
Copy-Item "scripts/portable-readme.txt" "$dist/DOC-doc-truoc-khi-chay.txt"
New-Item -ItemType Directory -Force -Path "$dist/fonts" | Out-Null
Copy-Item "fonts/*" "$dist/fonts/"
Compress-Archive -Path "$dist/*" -DestinationPath "FoFreeXit-portable-win64.zip" -Force
- name: Upload artifact