]> git.kianting.info Git - clo/blob - README.md
c4e93cccad002b1de5fab6acbab58f5f68567fbe
[clo] / README.md
1 # clo
2 - another personal draught of a typesetting language and engine.
3 - website: https://kianting.info/wiki/w/Project:Clo
4 - license: MIT
5 - issue tracking mailing list: `clo@kianting.info`
6
7 ## How to use
8 ```
9 cd /path/to/clo
10 node . [.clo FILE] --output-js=[.js FILE]
11 node [.js FILE]
12 ```
13
14 ## changing journal
15 - 20230904 建立 thenDo、matchRange的函數、refactor harfbuzzjs 以及libpdf 等測試界面
16 - 20230905-06: 建立 : `toSome`, initial of basic tokenizer (`tokenize`),
17 `matchAny`, `notDo`, `orDo`, `zeroOrMoreDo`, `zeroOrOnceDo`
18 - 20230905-07:強化`tokenize`, 加強功能,加`Token`界面。
19 - 20230907-08:強化`tokenize`
20 - 20230910 : add basic parser `CONST` rule, and add the grammar rule.
21 - 20230914-15: 追加一寡 tokenizer ê 功能。
22 - 20230918: 重新tuì下kàu頂起做parser. add rule
23 - 20230921-22:add rule, report issue
24 - 20230925-26: 試驗án-tsuánn解決[issue1](https://kianting.info/pipermail/clo_kianting.info/2023-September/000004.html), iáu-buē成功。
25 - 凡勢用?
26 ```
27 FuncApp ::= Single FuncAppAux | Single
28 FuncAppAUx ::= FunCallee FuncAppAUx
29 FuncCallee ::= "(" ")" | "(" ARGS ")"
30 ARGS = SINGLE "," ARGS | SINGLE
31 ```
32 - 20230928:basically fix `issue1`。其他ê物件猶著做。
33 - 20230929:add multi args parsing for `callee`.
34 - 20230930:tîng khí parser, using `js-token`.
35 - 20231006: tîng siá parser, using `ts-parsec`.
36 - 20231010: 初步完成tsit ê階段ê Parser`。
37 - 20231012: clo->js converter successfully (maybe.)
38 - 20231016:basic font guessing and `putText` function
39 - 20231023-24:fix .ttc bug.
40 - 20231026-27 : clo basic interface, preprocessor of stream of text,
41 add cjk-english splitter, etc.
42 - 20231029-30: hyphenating for english.
43 - 20231105-06: 利用fontkit算文字的對應px寬度 initially pushed.
44 - 20231109-10: Keng-kái oa̍h-chōa ián-sǹg-hoat.
45 - 20231113: the algorithm is basically fixed, and make a `bigFrame` to prepare for convert to boxes and positions.
46 - 20231115-16: grid and basic types laying.
47 - 231120 fix the line-breaking algorithm
48
49 ## 之後的做法
50 - 先做一個前處理註冊器,註冊下列的前處理
51 - 中英文間距
52 - 換行點
53 - 空白轉為 [glue]
54 - 前處理完成字串後,必須要:
55 - 算出字元的Box
56 - 利用 frame/box 資訊分行、分頁
57 - 然後算出每個Box的x, y, page
58 - 最後納入排版
59
60 ## 排版語法
61
62 使用lisp表示,但其實是陣列
63 ```lisp
64 (hglue 寬度 伸展值)
65 (vglue 高度 伸展值)
66 (bp 原始模式 斷行模式) ; breakpoint
67 (nl) ; newline
68 (em 數字)
69 (ex 數字)
70 (span {"font-family" : "Noto Sans" , "font-size" : 16 })
71 (vbox 高度 內容)
72 ```
73
74 ## How to generate documents
75 - `typedoc /path/to/index.js [/path/to/index2.js ...]`
76 the generated page will be stored in `/src`.