Skip to content

Commit e11dc53

Browse files
authored
hamnosys-includer:1.0.0 (#3068)
1 parent 932d03e commit e11dc53

File tree

8 files changed

+970
-0
lines changed

8 files changed

+970
-0
lines changed

packages/preview/hamnosys-includer/1.0.0/LICENSE

Lines changed: 417 additions & 0 deletions
Large diffs are not rendered by default.

packages/preview/hamnosys-includer/1.0.0/LPPL.typ

Lines changed: 163 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# HamNoSys (Hamburg Notation System)
2+
3+
HamNoSys is a system for the phonetic transcription of signed languages. The HamNoSysUnicode font uses the Unicode Private Use Area for the HamNoSys symbols.
4+
5+
The font (and the symbol names) are taken from the TeX package [_hamnosys_](https://ctan.org/pkg/hamnosys?lang=en), maintained by Thomas Hanke & Marc Schulder. You will first need to download the TeX package and find the HamNoSysUnicode font.
6+
7+
If you're working locally, install the font (or pass its location to Typst with the `--font-path` argument). If you're using the [Typst web service](https://typst.app), you just need to include the font among your uploaded files. Without the font, this package is useless.
8+
9+
Second, include the line
10+
11+
```Typst
12+
#import "@preview/hamnosys-includer:1.0.0": ham, hamnosys, hamnosys-text
13+
```
14+
15+
in your document.
16+
17+
## Direct Entry
18+
19+
You can enter the symbols directly into your Typst document. There's no way to actually type most of them, as they're mostly in the Unicode Private Use Area, but this is handy if you want to copy and paste from elsewhere. If you do this, you should wrap them in the `#hamnosys-text` function.
20+
21+
This is demonstrated in [`README.pdf`](https://github.com/TestTimothy/Typst-HamNoSys/blob/main/docs/README.pdf).
22+
23+
If you don't use the function, it might work anyway, but you may have some other font which uses the same Unicode code points for other purposes. (And some of the symbols, such as `hamquery` and `hamexclaim`, are not in the Private Use Area, and are certainly defined by other fonts.) Using `#hamnosys-text` ensures that the HamNoSysUnicode font is used, which is what you want.
24+
25+
## Entry by Symbol Name
26+
27+
If you're typing yourself, it's much easier to use the names of the symbols. There are two ways to do this.
28+
29+
### Use the `#hamnosys` function
30+
31+
```Typst
32+
You can sign "Hamburg" as #hamnosys("hamceeall,hamthumbopenmod,hamfingerstraightmod,
33+
hamextfingerul,hampalmdl,hamforehead,hamlrat,hamclose,hamparbegin,
34+
hammover,hamreplace,hampinchall,hamfingerstraightmod,hamparend")
35+
```
36+
37+
In the input string, symbol names should be separated with commas. You may optionally additionally use whitespace. All symbol names begin with `ham`, and you can leave that off, so the above could just as easily be given as
38+
39+
```Typst
40+
You can sign "Hamburg" as #hamnosys("ceeall, thumbopenmod, fingerstraightmod,
41+
extfingerul, palmdl, forehead, lrat, close, parbegin, mover, replace, pinchall, fingerstraightmod, parend")
42+
```
43+
44+
### Use the `#ham` variable
45+
46+
For shorter blocks of text, it may be easier to use a variable rather than a function call. So instead of `#hamnosys("close")`, you can write `#ham.close`, which is less typing.
47+
48+
### Symbol Names
49+
50+
HamNoSys symbol names occasionally include digits. The TeX package changed these to words, so for example `hampinch12open` was changed to `hampinchonetwoopen`, because that's necessary in TeX. For this Typst package, both sets of names work.
51+
40.5 KB
Binary file not shown.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#set page(margin: (top: 1.5cm))
2+
#show raw: set text(font: ("HamNoSysUnicode", "DejaVu Sans Mono"))
3+
4+
#import "hamnosys.typ": ham, hamnosys, hamnosys-text
5+
6+
= HamNoSys (Hamburg Notation System)
7+
8+
HamNoSys is a system for the phonetic transcription of signed languages. The HamNoSysUnicode font uses the Unicode Private Use Area for the HamNoSys symbols.
9+
10+
The font (and the symbol names) are taken from the TeX package #link("https://ctan.org/pkg/hamnosys?lang=en")[_hamnosys_], maintained by Thomas Hanke & Marc Schulder. You will first need to download the TeX package and find the HamNoSysUnicode font.
11+
12+
If you're working locally, install the font (or pass its location to Typst with the `--font-path` argument). If you're using the #link("https://typst.app")[Typst web service], you just need to include the font among your uploaded files. Without the font, this package is useless.
13+
14+
Second, include the line
15+
16+
```Typst
17+
#import "hamnosys.typ": ham, hamnosys, hamnosys-text
18+
```
19+
20+
in your document.
21+
22+
== Direct Entry
23+
24+
You can enter the symbols directly into your Typst document. There's no way to actually type most of them, as they're mostly in the Unicode Private Use Area, but this is handy if you want to copy and paste from elsewhere. If you do this, you should wrap them in the `#hamnosys-text` function.
25+
26+
This input:
27+
```Typst
28+
#hamnosys-text("")
29+
```
30+
31+
Gives this output: \
32+
#hamnosys-text("")
33+
34+
If you don't use the function, it might work anyway, but you may have some other font which uses the same Unicode code points for other purposes. (And some of the symbols, such as `hamquery` and `hamexclaim`, are not in the Private Use Area, and are certainly defined by other fonts.) Using `#hamnosys-text` ensures that the HamNoSysUnicode font is used, which is what you want.
35+
36+
== Entry by Symbol Name
37+
38+
If you're typing yourself, it's much easier to use the names of the symbols. There are two ways to do this.
39+
40+
=== Use the `#hamnosys` function
41+
42+
This input:
43+
```Typst
44+
You can sign "Hamburg" as #hamnosys("hamceeall,hamthumbopenmod,hamfingerstraightmod,
45+
hamextfingerul,hampalmdl,hamforehead,hamlrat,hamclose,hamparbegin,
46+
hammover,hamreplace,hampinchall,hamfingerstraightmod,hamparend")
47+
```
48+
49+
Gives this output: \
50+
You can sign "Hamburg" as #hamnosys("hamceeall,hamthumbopenmod,hamfingerstraightmod,
51+
hamextfingerul,hampalmdl,hamforehead,hamlrat,hamclose,hamparbegin,
52+
hammover,hamreplace,hampinchall,hamfingerstraightmod,hamparend")
53+
54+
In the input string, symbol names should be separated with commas. You may optionally additionally use whitespace. All symbol names begin with `ham`, and you can leave that off, so the above could just as easily be given as
55+
56+
```Typst
57+
You can sign "Hamburg" as #hamnosys("ceeall, thumbopenmod, fingerstraightmod,
58+
extfingerul, palmdl, forehead, lrat, close, parbegin, mover, replace, pinchall, fingerstraightmod, parend")
59+
```
60+
61+
=== Use the `#ham` variable
62+
63+
For shorter blocks of text, it may be easier to use a variable rather than a function call. So instead of `#hamnosys("close")`, you can write `#ham.close`, which is less typing.
64+
65+
=== Symbol Names
66+
67+
HamNoSys symbol names occasionally include digits. The TeX package changed these to words, so for example `hampinch12open` was changed to `hampinchonetwoopen`, because that's necessary in TeX. For this Typst package, both sets of names work.
68+
69+
= Licence
70+
71+
Since the TeX package which inspired this (and, importantly, the font which this also uses) are under the LPPL, I suppose it's necessary that this is too, though that does feel a bit odd for a Typst package.
72+
73+
#sym.copyright Timothy Green, 2025.
74+
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
{
2+
"hamfist": 57344,
3+
"hamflathand": 57345,
4+
"hamfingertwo": 57346,
5+
"hamfinger2": 57346,
6+
"hamfingertwothree": 57347,
7+
"hamfinger23": 57347,
8+
"hamfingertwothreespread": 57348,
9+
"hamfinger23spread": 57348,
10+
"hamfingertwothreefourfive": 57349,
11+
"hamfinger2345": 57349,
12+
"hampinchonetwo": 57350,
13+
"hampinch12": 57350,
14+
"hampinchall": 57351,
15+
"hampinchonetwoopen": 57352,
16+
"hampinch12open": 57352,
17+
"hamceeonetwo": 57353,
18+
"hamcee12": 57353,
19+
"hamceeall": 57354,
20+
"hamceeopen": 57355,
21+
"hamthumboutmod": 57356,
22+
"hamthumbacrossmod": 57357,
23+
"hamthumbopenmod": 57358,
24+
"hamfingerstraightmod": 57360,
25+
"hamfingerbendmod": 57361,
26+
"hamfingerhookmod": 57362,
27+
"hamdoublebent": 57363,
28+
"hamdoublehooked": 57364,
29+
"hamextfingeru": 57376,
30+
"hamextfingerur": 57377,
31+
"hamextfingerr": 57378,
32+
"hamextfingerdr": 57379,
33+
"hamextfingerd": 57380,
34+
"hamextfingerdl": 57381,
35+
"hamextfingerl": 57382,
36+
"hamextfingerul": 57383,
37+
"hamextfingerol": 57384,
38+
"hamextfingero": 57385,
39+
"hamextfingeror": 57386,
40+
"hamextfingeril": 57387,
41+
"hamextfingeri": 57388,
42+
"hamextfingerir": 57389,
43+
"hamextfingerui": 57390,
44+
"hamextfingerdi": 57391,
45+
"hamextfingerdo": 57392,
46+
"hamextfingeruo": 57393,
47+
"hampalmu": 57400,
48+
"hampalmur": 57401,
49+
"hampalmr": 57402,
50+
"hampalmdr": 57403,
51+
"hampalmd": 57404,
52+
"hampalmdl": 57405,
53+
"hampalml": 57406,
54+
"hampalmul": 57407,
55+
"hamhead": 57408,
56+
"hamheadtop": 57409,
57+
"hamforehead": 57410,
58+
"hameyebrows": 57411,
59+
"hameyes": 57412,
60+
"hamnose": 57413,
61+
"hamnostrils": 57414,
62+
"hamear": 57415,
63+
"hamearlobe": 57416,
64+
"hamcheek": 57417,
65+
"hamlips": 57418,
66+
"hamtongue": 57419,
67+
"hamteeth": 57420,
68+
"hamchin": 57421,
69+
"hamunderchin": 57422,
70+
"hamneck": 57423,
71+
"hamshouldertop": 57424,
72+
"hamshoulders": 57425,
73+
"hamchest": 57426,
74+
"hamstomach": 57427,
75+
"hambelowstomach": 57428,
76+
"hamneutralspace": 57439,
77+
"hamupperarm": 57440,
78+
"hamelbow": 57441,
79+
"hamelbowinside": 57442,
80+
"hamlowerarm": 57443,
81+
"hamwristback": 57444,
82+
"hamwristpulse": 57445,
83+
"hamthumbball": 57446,
84+
"hampalm": 57447,
85+
"hamhandback": 57448,
86+
"hamthumbside": 57449,
87+
"hampinkyside": 57450,
88+
"hamthumb": 57456,
89+
"hamindexfinger": 57457,
90+
"hammiddlefinger": 57458,
91+
"hamringfinger": 57459,
92+
"hampinky": 57460,
93+
"hamfingertip": 57461,
94+
"hamfingernail": 57462,
95+
"hamfingerpad": 57463,
96+
"hamfingermidjoint": 57464,
97+
"hamfingerbase": 57465,
98+
"hamfingerside": 57466,
99+
"hamlrbeside": 57432,
100+
"hamlrat": 57433,
101+
"hamcoreftag": 57434,
102+
"hamcorefref": 57435,
103+
"hammoveu": 57472,
104+
"hammoveur": 57473,
105+
"hammover": 57474,
106+
"hammovedr": 57475,
107+
"hammoved": 57476,
108+
"hammovedl": 57477,
109+
"hammovel": 57478,
110+
"hammoveul": 57479,
111+
"hammoveol": 57480,
112+
"hammoveo": 57481,
113+
"hammoveor": 57482,
114+
"hammoveil": 57483,
115+
"hammovei": 57484,
116+
"hammoveir": 57485,
117+
"hammoveui": 57486,
118+
"hammovedi": 57487,
119+
"hammovedo": 57488,
120+
"hammoveuo": 57489,
121+
"hamcircleo": 57490,
122+
"hamcirclei": 57491,
123+
"hamcircled": 57492,
124+
"hamcircleu": 57493,
125+
"hamcirclel": 57494,
126+
"hamcircler": 57495,
127+
"hamcircleul": 57496,
128+
"hamcircledr": 57497,
129+
"hamcircleur": 57498,
130+
"hamcircledl": 57499,
131+
"hamcircleol": 57500,
132+
"hamcircleir": 57501,
133+
"hamcircleor": 57502,
134+
"hamcircleil": 57503,
135+
"hamcircleui": 57504,
136+
"hamcircledo": 57505,
137+
"hamcircleuo": 57506,
138+
"hamcircledi": 57507,
139+
"hamfingerplay": 57508,
140+
"hamnodding": 57509,
141+
"hamswinging": 57510,
142+
"hamtwisting": 57511,
143+
"hamstircw": 57512,
144+
"hamstirccw": 57513,
145+
"hamreplace": 57514,
146+
"hamnomotion": 57519,
147+
"hamclocku": 57520,
148+
"hamclockul": 57521,
149+
"hamclockl": 57522,
150+
"hamclockdl": 57523,
151+
"hamclockd": 57524,
152+
"hamclockdr": 57525,
153+
"hamclockr": 57526,
154+
"hamclockur": 57527,
155+
"hamclockfull": 57528,
156+
"hamarcl": 57529,
157+
"hamarcu": 57530,
158+
"hamarcr": 57531,
159+
"hamarcd": 57532,
160+
"hamwavy": 57533,
161+
"hamzigzag": 57534,
162+
"hamellipseh": 57536,
163+
"hamellipseur": 57537,
164+
"hamellipsev": 57538,
165+
"hamellipseul": 57539,
166+
"hamincreasing": 57540,
167+
"hamdecreasing": 57541,
168+
"hamfast": 57544,
169+
"hamslow": 57545,
170+
"hamtense": 57546,
171+
"hamrest": 57547,
172+
"hamhalt": 57548,
173+
"hamclose": 57552,
174+
"hamtouch": 57553,
175+
"haminterlock": 57554,
176+
"hamcross": 57555,
177+
"hamarmextended": 57556,
178+
"hambehind": 57557,
179+
"hambrushing": 57558,
180+
"hamsmallmod": 57542,
181+
"hamlargemod": 57543,
182+
"hamrepeatfromstart": 57560,
183+
"hamrepeatfromstartseveral": 57561,
184+
"hamrepeatcontinue": 57562,
185+
"hamrepeatcontinueseveral": 57563,
186+
"hamrepeatreverse": 57564,
187+
"hamalternatingmotion": 57565,
188+
"hamseqbegin": 57568,
189+
"hamseqend": 57569,
190+
"hamparbegin": 57570,
191+
"hamparend": 57571,
192+
"hamfusionbegin": 57572,
193+
"hamfusionend": 57573,
194+
"hambetween": 57574,
195+
"hamplus": 57575,
196+
"hamsymmpar": 57576,
197+
"hamsymmlr": 57577,
198+
"hamnondominant": 57578,
199+
"hamnonipsi": 57579,
200+
"hametc": 57580,
201+
"hamorirelative": 57581,
202+
"hammime": 57584,
203+
"hamversionfourzero": 57585,
204+
"hamversion40": 57585,
205+
"hamspace": 32,
206+
"hamexclaim": 33,
207+
"hamcomma": 44,
208+
"hamfullstop": 46,
209+
"hamquery": 63,
210+
"hamaltbegin": 123,
211+
"hammetaalt": 124,
212+
"hamaltend": 125,
213+
"hamwristtopulse": 57468,
214+
"hamwristtoback": 57469,
215+
"hamwristtothumb": 57470,
216+
"hamwristtopinky": 57471,
217+
"hammovecross": 57517,
218+
"hammoveX": 57518
219+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#let hamnosys-translations = json("hamnosys.json")
2+
3+
#let hamnosys(it) = {
4+
set text(font: "HamNoSysUnicode")
5+
let s = it.split(",");
6+
for sym in s {
7+
sym = sym.trim()
8+
if (sym != "") {
9+
let start = sym.slice(0, 3)
10+
if (start != "ham") {
11+
sym = "ham" + sym
12+
}
13+
str.from-unicode(hamnosys-translations.at(sym))
14+
}
15+
}
16+
}
17+
18+
#let hamnosys-text(it) = {
19+
set text(font: "HamNoSysUnicode")
20+
it
21+
}
22+
23+
#let ham = (:)
24+
#for (n, u) in hamnosys-translations {
25+
let nn = n.slice(3)
26+
// This is perhaps not the most efficient way to do it: we already have the Unicode
27+
// code point available, and we're passing to the hamnosys() function which has
28+
// to look it up again. But it makes the code simpler. Also, this loop happens
29+
// only once, on document initiation.
30+
let output = hamnosys(n)
31+
ham.insert(n, output)
32+
ham.insert(nn, output)
33+
}
34+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "hamnosys-includer"
3+
version = "1.0.0"
4+
entrypoint = "hamnosys.typ"
5+
authors = ["Timothy Green"]
6+
license = "LPPL-1.3c"
7+
description = "For using HamNoSys in Typst"
8+
keywords = ["HamNoSys", "Deaf", "Sign Language", "linguistics"]
9+
categories = ["text", "languages"]
10+
disciplines = ["linguistics"]
11+
exclude = ["docs", "LPPL.typ"]
12+
repository = "https://github.com/TestTimothy/Typst-HamNoSys"

0 commit comments

Comments
 (0)