summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/generic/harftex/tests/test.tex
blob: ab5c45b0e6815606f611e38fd495d803006817f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
\pdfvariable suppressoptionalinfo \numexpr1+32+64+128+512\relax
\pdfvariable compresslevel 0
\pdfvariable objcompresslevel 0

\tracingstats=1
\tracingonline=1

\input harfload.sty

\def\btest{\begingroup}
\def\brtest{\btest\pardir TRT\textdir TRT}
\def\etest{\par\endgroup\vfill\eject}

\brtest
\font\testr="[amiri-regular.ttf]" at 10pt
\font\testb="[amiri-bold.ttf]" at 10pt
\testr
هذا كتاب صغير في بحث جديد، تنبّهنا له ونحن ننشر الطبعة الثانية من كتابنا الفلسفة
اللغوية لأنّ موضوعه تابع لموضوعنا. أو هي خطوة ثانية في تاريخ اللغة باعتبار
منشأها وتكونها ونموها. فالفلسفة اللغوية تبحث في كيف نطق الانسان الأول، وكيف
نشأت اللغة وتولّدت الألفاظ من حكاية الأصوات الخارجية، ك{\testb قصف الرعد}، وهبوب الرياح،
والقطع والكسر، وحكاية التف والنفخ والصفير ونحوها. ومن المقاطع الطبيعية التي
ينطق بها الانسان غريزيا كالتأوه، والزفير. وكيف تنوّعت تلك الأصوات لفظا ومعنى
بالنحت، والابدال، والقلب، حتى صارت ألفاظا مستقلة وتكوّنت الأفعال، والأسماء،
والحروف وصارت اللغة على نحو ما هي عليه.  وأما تاريخ اللغة فيتناول النظر في
ألفاظها وتراكيبها، بعد تمام تكونها، فيبحث فيما طرأ عليهما من التغيير والتجدد أو
الدثور، فيبين الألفاظ والتراكيب التي دثرت من اللغة بالاستعمال، وما قام مقامها
من الألفاظ الجديدة، والتراكيب الجديدة، بما تولّد فيها، أو اقتبسته من سواها، مع
بيان الأحوال التي قضت بدثور القديم وتولد الجديد، وأمثلة مما دثر، أو أهمل، أو
تولّد، أو دخل.

المحتوى الذي تصل إليه (في حالة عدم استخدام مواقع مؤمنة عن طريق بروتوكول نقل
النص التشعبي الآمن {\textdir TLT HTTPS}).
\etest

\def\arabictext{%
هذا كتاب صغير في بحث جديد، تنبّهنا له ونحن ننشر الطبعة الثانية من كتابنا الفلسفة
اللغوية لأنّ موضوعه تابع لموضوعنا. أو هي خطوة ثانية في تاريخ اللغة باعتبار
منشأها وتكونها ونموها. فالفلسفة اللغوية تبحث في كيف نطق الانسان الأول، وكيف
نشأت اللغة وتولّدت الألفاظ من حكاية الأصوات الخارجية، كقصف الرعد، وهبوب الرياح،
والقطع والكسر، وحكاية التف والنفخ والصفير ونحوها. ومن المقاطع الطبيعية التي
ينطق بها الانسان غريزيا كالتأوه، والزفير. وكيف تنوّعت تلك الأصوات لفظا ومعنى
بالنحت، والابدال، والقلب، حتى صارت ألفاظا مستقلة وتكوّنت الأفعال، والأسماء،
والحروف وصارت اللغة على نحو ما هي عليه.  وأما تاريخ اللغة فيتناول النظر في
ألفاظها وتراكيبها، بعد تمام تكونها، فيبحث فيما طرأ عليهما من التغيير والتجدد أو
الدثور، فيبين الألفاظ والتراكيب التي دثرت من اللغة بالاستعمال، وما قام مقامها
من الألفاظ الجديدة، والتراكيب الجديدة، بما تولّد فيها، أو اقتبسته من سواها، مع
بيان الأحوال التي قضت بدثور القديم وتولد الجديد، وأمثلة مما دثر، أو أهمل، أو
تولّد، أو دخل.%
}

\brtest
\font\test="[amiri-regular.ttf]" at 20pt\test
\baselineskip=2em
\arabictext
\etest

\brtest
\font\testh="[ArefRuqaa-Regular.ttf]" at 10pt
\font\testn="[ArefRuqaa-Bold.ttf]:mode=node;script=arab" at 10pt
\font\testb="[ArefRuqaa-Bold.ttf]:mode=base;script=arab" at 10pt
\tolerance 9999
\testh\arabictext\par
\testn\arabictext\par
\testb\arabictext\par
\etest

\brtest
\font\test="[NotoNastaliqUrdu-Regular.ttf]" at 14pt\test
\baselineskip=3em
\arabictext
\etest

\brtest
\font\testr="[amiri-regular.ttf]" at 20pt
\font\testc="[amiri-regular.ttf]:color=FF0000" at 20pt
\testr قلبي {\testc تلون كله} بلون الحب.
\etest

\brtest
\font\test="[amiri-quran-colored.ttf]" at 20pt\test
\baselineskip=2.6em
\parindent=0pt
\leftskip=0pt plus 1fil
\rightskip=0pt plus -1fil
\parfillskip=0pt plus 2fil
\def\aya#1{{\textdir TLT ^^^^06dd#1}}
^^^^fdfd~\aya{١}\par
ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَٰلَمِینَ~\aya{٢} ٱلرَّحۡمَٰنِ ٱلرَّحِیمِ~\aya{٣} مَٰلِكِ یَوۡمِ ٱلدِّینِ~\aya{٤} إِیَّاكَ نَعۡبُدُ وَإِیَّاكَ نَسۡتَعِینُ~\aya{٥} ٱهۡدِنَا ٱلصِّرَٰطَ ٱلۡمُسۡتَقِیمَ~\aya{٦} صِرَٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ~\aya{٧}\par
\etest

\btest
\font\testa="[BungeeColor1.ttf]:colr=true" at 50pt\testa
ABCDEFG\par
\font\testb="[BungeeColor1.ttf]:colr=2"    at 50pt\testb
ABCDEFG\par
\etest

\btest
\font\test="[NotoColorEmoji.ttf]" at 24pt\test
💙💚💛💜💝🖤🧡😀😇🧔🏽🦆
abc
💙\/💚
\etest

\btest
\font\test="[amiri-regular.ttf]" at 10pt\test
\TeX\ = τεχ in Greek

\directlua{
if luaotfload then
  local hb = require("harf")
  assert(    luaotfload.aux.font_has_glyph(font.current(), 0x0061)) % a
  assert(not luaotfload.aux.font_has_glyph(font.current(), 0x03C4)) % τ
  assert(not luaotfload.aux.font_has_glyph(font.current(), 0x0061 + hb.CH_GID_PREFIX)) % a pseudo char
  assert("a" == luaotfload.aux.name_of_slot(font.current(), 0x0061)) % a
  assert(nil == luaotfload.aux.name_of_slot(font.current(), 0x03C4)) % τ
  assert(68 + hb.CH_GID_PREFIX == luaotfload.aux.slot_of_name(font.current(), "a"))
  assert(nil == luaotfload.aux.slot_of_name(font.current(), "foo"))
end
}
\etest

\btest
\font\testr="[amiri-regular.ttf]" at 100pt
\font\testi="[amiri-slanted.ttf]" at 100pt
\testr ({\testi f\/})
\etest

\btest
\def\l#1#2{%
  \begingroup
  \font\test="[amiri-regular.ttf]:language=#1" at 10pt\test #2%
  \endgroup
}
\l{ARA}{٠١٢٣٤٥٦٧٨٩}\par
\l{FAR}{۰۱۲۳۴۵۶۷۸۹}\par
\l{URD}{۰۱۲۳۴۵۶۷۸۹}\par
\l{SND}{۰۱۲۳۴۵۶۷۸۹}\par
\l{KSH}{۰۱۲۳۴۵۶۷۸۹}\par
\etest

\btest
\font\test="[lmmono10-regular.otf]"\test
$\fam0 \textfont0\font https:$
\etest

\btest
% Test selecting shapers; when “ot” shaper is used, “kdot” feature will not
% work as it is a Graphite-only feature in Padauk font.
\font\test="[Padauk-Regular.ttf]:+kdot"                  at 30pt\test
က ဂ င တ ပ မ ယ လ ဢ ၵ ၸ \par
\font\test="[Padauk-Regular.ttf]:shaper=graphite2;+kdot" at 30pt\test
က ဂ င တ ပ မ ယ လ ဢ ၵ ၸ \par
\font\test="[Padauk-Regular.ttf]:shaper=ot;+kdot"        at 30pt\test
က ဂ င တ ပ မ ယ လ ဢ ၵ ၸ \par
\etest

\btest
\font\arab="[amiri-regular.ttf]:script=arab" at 10pt\arab
\font\latn="[amiri-regular.ttf]:script=latn" at 10pt\latn
\font\dflt="[amiri-regular.ttf]" at 10pt\dflt
\baselineskip=1.6em
\halign{#\qquad\hfill&(#)\hfill\cr
{\arab .A.} & {\tt Arab} script\cr
{\latn .ع.} & {\tt Latn} script\cr
{\arab ..}  & {\tt Arab} script\cr
{\dflt .A.} & No script in font options\cr
{\dflt .ع.} & No script in font options\cr
{\dflt ..}  & No script in font options\cr
}
\etest

\btest
\font\test="[amiri-regular.ttf]:mode=harf;letterspace=50" at 30pt\test
letter spaced
\etest

\btest
\font\test="[amiri-regular.ttf]:mode=harf;kernfactor=.5" at 30pt\test
letter spaced
\etest

\btest
\font\test="[amiri-regular.ttf]:mode=harf;slant=.3" at 30pt\test
Slanted text.
\etest

\btest
\font\test="[amiri-regular.ttf]:mode=harf;embolden=1.5" at 30pt\test
Emboldened text.
\etest

\btest
\font\test="[amiri-regular.ttf]:mode=harf;extend=2" at 30pt\test
Extended text.
\etest

\btest
\font\test="[amiri-regular.ttf]:mode=harf;squeeze=.5" at 30pt\test
Squeezed t^^^^0304e^^^^032ex^^^^0304t^^^^032e.
\etest

\btest
\font\test="[NotoSerifCJK-Regular.ttc]" at 10pt\test
\parindent=0pt
\noindent
\smallskip
offbeat office baffle coffee HAVANA\par
\smallskip
\begingroup
\rightskip=0pt plus1fil \pretolerance=-1 \hyphenpenalty=-10000
offbeat office baffle coffee HAVANA\par
\endgroup
\etest

\btest
\font\test="[lmroman10-regular.otf]" at 10pt\test
\parindent=0pt
\noindent
\smallskip
offbeat office baffle {\rm baffle} coffee HAVANA\par
\smallskip
\begingroup
\rightskip=0pt plus1fil \pretolerance=-1 \hyphenpenalty=-10000
offbeat office baffle {\rm baffle} coffee HAVANA\par
\endgroup
\etest

\btest
\font\lmten="[lmroman10-regular.otf]:+dlig" at 10pt
\font\lmtwelve="[lmroman12-regular.otf]" at 12pt
\font\lmtenb="[lmroman10-bold.otf]" at 10pt
\font\lmteni="[lmromanslant10-regular.otf]" at 10pt
\lmten
\hrule
\vskip 1in
\centerline{\lmtenb A SHORT STORY}
\vskip 6pt
\centerline{\lmteni by A. U. Thor}
\vskip .5cm
Once upon a time, in a distant {\lmtwelve galaxy called} Ööç, there lived a computer named
R.~J. Drofnats.

Mr.~Drofnats-----or ‘‘R. J.,’’ as he {\textdir TRT preferred} to be called-----was happiest when he
was at work typesetting beautiful documents.
\vskip 1in
\hrule
\etest

\btest
\font\test=cmr10 at 12pt
\test
\input story
\etest

\btest
Some text then inline math $E=mc^2$ then $\hbox{text inside inline math}$, then
display math $$E=mc^2\hbox{ with text inside}$$
\etest

\btest
\font\test="[lmsans12-regular.otf]" at 12pt\test
\protrudechars=2
\rpcode\font`\,=280
We thrive in information―thick worlds because of our
marvelous and everyday capacity to select, edit,
single out, structure, highlight, group, pair, merge,
harmonize, synthesize, focus, organize, condense,
reduce, boil down, choose, categorize, catalog, classify,
list, abstract, scan, look into, idealize, isolate,
discriminate, distinguish, screen, pigeonhole, pick over,
sort, integrate, blend, inspect, filter, lump, skip,
smooth, chunk, average, approximate, cluster, aggregate,
outline, summarize, itemize, review, dip into,
flip through, browse, glance into, leaf through, skim,
refine, enumerate, glean, synopsize, winnow the wheat
from the chaff and separate the sheep from the goats.
\etest

\btest
\font\test"[Free-HK-Kai_4700-v1.02.subset.ttf]"\test
骨窗次
\etest

\btest
\font\test="[URWGothicL-Book.subset.otf]:mode=harf"\test
åäöüñÅÄÖÜÑ
\etest

\btest
\font\test="[lmroman10-regular.otf]:+dlig" at 10pt\test
f-f f\-f f\discretionary{-}{-}{-}f
\etest

\btest
\font\test="[lmroman10-regular.otf]:+tlig;mode=harf" at 20pt\test
``!`'' `?`' f--f f---f f-f ,,f" <<f>>
\etest

\btest
\font\test="[FandolSong-Regular.otf]:mode=harf" at 20pt\test
\the\fontdimen5\font\quad\the\fontdimen8\font
\etest

\btest
\font\test="[emojione-mac.subset.ttf]:mode=harf" at 100pt\test
😄👌☃⛄
\etest

\bye