-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6a0922
commit c6b8405
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#set text( | ||
font: ("Liberation Sans", "Noto Sans CJK JP") | ||
) // Optional | ||
|
||
#import "@preview/rubby:0.8.0": get_ruby | ||
#let ruby = get_ruby() | ||
|
||
```typst | ||
#let ruby = get_ruby() // (1) Adds missing delimiter around every content/string | ||
// or | ||
#let ruby = get_ruby(auto_spacing: false) // (2) Logic from original project | ||
``` | ||
|
||
#ruby[ふりがな][振り仮名] | ||
|
||
#ruby[とう|きょう|こう|ぎょう|だい|がく][東|京|工|業|大|学] | ||
|
||
#ruby[とうきょうこうぎょうだいがく][東京工業大学] | ||
|
||
Next 2 lines look the same with (1) (default): | ||
|
||
#let ruby = get_ruby() | ||
|
||
#ruby[|きょうりょく|][|協力|] | ||
|
||
#ruby[きょうりょく][協力] | ||
|
||
But lines are being typeset differently if (2) is used: | ||
|
||
#let ruby = get_ruby(auto_spacing: false) | ||
|
||
#ruby[|きょうりょく|][|協力|] | ||
|
||
#ruby[きょうりょく][協力] // Page boundaries are not honored | ||
|
||
First 3 lines out of 4 look the same way with (1): | ||
|
||
#let ruby = get_ruby() | ||
|
||
#ruby[きゅう][九]#ruby[じゅう][十] | ||
|
||
#ruby[きゅう|][九|]#ruby[|じゅう][|十] | ||
|
||
#ruby[きゅう|じゅう][九|十] | ||
|
||
#ruby[きゅうじゅう][九十] | ||
|
||
Only 2nd and 3rd lines look the same way with (2): | ||
|
||
#let ruby = get_ruby(auto_spacing: false) | ||
|
||
#ruby[きゅう][九]#ruby[じゅう][十] | ||
|
||
#ruby[きゅう|][九|]#ruby[|じゅう][|十] | ||
|
||
#ruby[きゅう|じゅう][九|十] | ||
|
||
#ruby[きゅうじゅう][九十] |