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