A personal draught of a typesetting engine.
Find a file
2023-11-10 01:09:44 +08:00
.vscode initial commit 2023-09-04 21:29:23 +08:00
3rdparty/harfbuzzjs initial commit 2023-09-04 21:29:23 +08:00
docs english breakline, and generate try to count the text size 2023-10-30 02:18:29 +08:00
src add line-breaking algorithm initially 2023-11-10 01:09:44 +08:00
tests english breakline, and generate try to count the text size 2023-10-30 02:18:29 +08:00
.eslintrc.json initial commit 2023-09-04 21:29:23 +08:00
.gitignore english breakline, and generate try to count the text size 2023-10-30 02:18:29 +08:00
a.clo fix lacking semicolon; for import 2023-10-12 00:41:36 +08:00
a.js fix lacking semicolon; for import 2023-10-12 00:41:36 +08:00
b.clo add line-breaking algorithm initially 2023-11-10 01:09:44 +08:00
b.js add convert to font px 2023-11-06 00:59:25 +08:00
LICENSE add license 2023-09-04 22:12:27 +08:00
package-lock.json add convert to font px 2023-11-06 00:59:25 +08:00
package.json add convert to font px 2023-11-06 00:59:25 +08:00
README.md add line-breaking algorithm initially 2023-11-10 01:09:44 +08:00
tsconfig.json initial commit 2023-09-04 21:29:23 +08:00
tslint.json initial commit 2023-09-04 21:29:23 +08:00

clo

changing journal

  • 20230904 建立 thenDo、matchRange的函數、refactor harfbuzzjs 以及libpdf 等測試界面
  • 20230905-06: 建立 : toSome, initial of basic tokenizer (tokenize), matchAny, notDo, orDo, zeroOrMoreDo, zeroOrOnceDo
  • 20230905-07:強化tokenize, 加強功能,加Token界面。
  • 20230907-08:強化tokenize
  • 20230910 : add basic parser CONST rule, and add the grammar rule.
  • 20230914-15: 追加一寡 tokenizer ê 功能。
  • 20230918: 重新tuì下kàu頂起做parser. add rule
  • 20230921-22:add rule, report issue
  • 20230925-26: 試驗án-tsuánn解決issue1, iáu-buē成功。
    • 凡勢用?
    FuncApp ::= Single FuncAppAux | Single
    FuncAppAUx ::= FunCallee FuncAppAUx
    FuncCallee ::= "(" ")" | "(" ARGS ")"
    ARGS = SINGLE "," ARGS | SINGLE
    
  • 20230928basically fix issue1。其他ê物件猶著做。
  • 20230929add multi args parsing for callee.
  • 20230930tîng khí parser, using js-token.
  • 20231006: tîng siá parser, using ts-parsec.
  • 20231010: 初步完成tsit ê階段ê Parser`。
  • 20231012: clo->js converter successfully (maybe.)
  • 20231016basic font guessing and putText function
  • 20231023-24:fix .ttc bug.
  • 20231026-27 : clo basic interface, preprocessor of stream of text, add cjk-english splitter, etc.
  • 20231029-30: hyphenating for english.
  • 20231105-06: 利用fontkit算文字的對應px寬度 initially pushed.
  • 20231109-10: Keng-kái oa̍h-chōa ián-sǹg-hoat.

之後的做法

  • 先做一個前處理註冊器,註冊下列的前處理
    • 中英文間距
    • 換行點
    • 空白轉為 [glue]
  • 前處理完成字串後,必須要:
    • 算出字元的Box
    • 利用 frame/box 資訊分行、分頁
    • 然後算出每個Box的x, y, page
    • 最後納入排版

排版語法

使用lisp表示但其實是陣列

  (hglue 寬度 伸展值)
  (vglue 高度 伸展值)
  (bp 原始模式 斷行模式) ; breakpoint
  (nl) ; newline
  (em 數字)
  (ex 數字)
  (span {"font-family" : "Noto Sans" , "font-size" : 16 })
  (vbox 高度 內容)

How to generate documents

  • typedoc /path/to/index.js [/path/to/index2.js ...] the generated page will be stored in /src.