Debian Codegraph @

texmf-dist/tex/xelatex/fontwrap/fontwrap.sty

raw
1 % ----------------------------------------------------------------------------
2 %
3 % fontwrap inserts fonts into your XeLaTeX text based on which unicode blocks
4 % characters belong to. For instance, something like:
5 %
6 % "This is English with 日本語 interspersed"
7 %
8 % will be turned into become:
9 %
10 % "\fontspec{\unicodeblockLatinFont}This is English with \fontspec{\unicodeblockJapaneseFont}日本語\fontspec{\unicodeblockLatinFont} interspersed"
11 %
12 % This is something that most word processors can do already, and it was sort
13 % silly that LaTeX didn't have a general scheme for this. After all, LaTeX should
14 % be better than word processors! ^_^
15 %
16 % That said, you can bind different fonts to different unicode blocks (the best
17 % font for Japanese, for instance, is definitely not the best font for Chinese,
18 % both of which are probably pretty poor English fonts... for instance),
19 % Any unicode block that you didn't bind yourself will use the defaults:
20 %
21 % \langfonddefaultfont for anything not CJK
22 % \langfonddefaultCJKfont for anything CJK (including the separate japanese and korean blocks)
23 %
24 % June 2008, Mike Kamermans, % nihongoresources.com (C)
25 % ----------------------------------------------------------------------------
26
27 \ProvidesPackage{fontwrap}
28
29 % enables use of system fonts
30 \usepackage{fontspec}
31
32 % enables full support for unicode text
33 \usepackage{xunicode}
34
35 % fixes some older command behaviour to current - see http://www.ctan.org/tex-archive/help/Catalogue/entries/xltxtra.html
36 \usepackage{xltxtra}
37
38 % also get some external Perl logic going
39 \usepackage{perltex}
40
41
42 % ----------------------------------------------------------------------------
43 %
44 % The actually interesting method. This parses the input and inserts \fontspec
45 % commands where necessary.
46 %
47 % ----------------------------------------------------------------------------
48
49 % default font - a fairly complete unicode font
50 \newcommand{\fontwrapdefaultfont}{Bitstream Cyberbit}
51
52 % default font for CJK languages - another pretty complete unicode font
53 \newcommand{\fontwrapdefaultCJKfont}{Code2000}
54
55 % ---------------------------------------------------------
56 % Font bindings. Font bindings for 158 unicode blocks...
57 % ---------------------------------------------------------
58
59 \newcommand{\unicodeblockBasicLatinFont}{\fontwrapdefaultfont}
60
61 \newcommand{\unicodeblockHiraganaFont}{\fontwrapdefaultCJKfont}
62
63 \newcommand{\unicodeblockCJKUnifiedIdeographsFont}{\fontwrapdefaultCJKfont}
64
65 \newcommand{\unicodeblockKatakanaFont}{\fontwrapdefaultCJKfont}
66
67 \newcommand{\unicodeblockAegeanNumbersFont}{\fontwrapdefaultfont}
68
69 \newcommand{\unicodeblockAlphabeticPresentationFormsFont}{\fontwrapdefaultfont}
70
71 \newcommand{\unicodeblockAncientGreekMusicalNotationFont}{\fontwrapdefaultfont}
72
73 \newcommand{\unicodeblockAncientGreekNumbersFont}{\fontwrapdefaultfont}
74
75 \newcommand{\unicodeblockArabicFont}{\fontwrapdefaultfont}
76
77 \newcommand{\unicodeblockArabicPresentationFormsAFont}{\fontwrapdefaultfont}
78
79 \newcommand{\unicodeblockArabicPresentationFormsBFont}{\fontwrapdefaultfont}
80
81 \newcommand{\unicodeblockArabicSupplementFont}{\fontwrapdefaultfont}
82
83 \newcommand{\unicodeblockArmenianFont}{\fontwrapdefaultfont}
84
85 \newcommand{\unicodeblockArrowsFont}{\fontwrapdefaultfont}
86
87 \newcommand{\unicodeblockBalineseFont}{\fontwrapdefaultfont}
88
89 \newcommand{\unicodeblockBengaliFont}{\fontwrapdefaultfont}
90
91 \newcommand{\unicodeblockBlockElementsFont}{\fontwrapdefaultfont}
92
93 \newcommand{\unicodeblockBopomofoFont}{\fontwrapdefaultCJKfont}
94
95 \newcommand{\unicodeblockBopomofoExtendedFont}{\fontwrapdefaultCJKfont}
96
97 \newcommand{\unicodeblockBoxDrawingFont}{\fontwrapdefaultfont}
98
99 \newcommand{\unicodeblockBraillePatternsFont}{\fontwrapdefaultfont}
100
101 \newcommand{\unicodeblockBugineseFont}{\fontwrapdefaultfont}
102
103 \newcommand{\unicodeblockBuhidFont}{\fontwrapdefaultfont}
104
105 \newcommand{\unicodeblockByzantineMusicalSymbolsFont}{\fontwrapdefaultfont}
106
107 \newcommand{\unicodeblockCherokeeFont}{\fontwrapdefaultfont}
108
109 \newcommand{\unicodeblockCJKCompatibilityFont}{\fontwrapdefaultCJKfont}
110
111 \newcommand{\unicodeblockCJKCompatibilityFormsFont}{\fontwrapdefaultCJKfont}
112
113 \newcommand{\unicodeblockCJKCompatibilityIdeographsFont}{\fontwrapdefaultCJKfont}
114
115 \newcommand{\unicodeblockCJKCompatibilityIdeographsSupplementFont}{\fontwrapdefaultCJKfont}
116
117 \newcommand{\unicodeblockCJKRadicalsSupplementFont}{\fontwrapdefaultCJKfont}
118
119 \newcommand{\unicodeblockCJKStrokesFont}{\fontwrapdefaultCJKfont}
120
121 \newcommand{\unicodeblockCJKSymbolsandPunctuationFont}{\fontwrapdefaultCJKfont}
122
123 \newcommand{\unicodeblockCJKUnifiedIdeographsExtensionAFont}{\fontwrapdefaultCJKfont}
124
125 \newcommand{\unicodeblockCJKUnifiedIdeographsExtensionBFont}{\fontwrapdefaultCJKfont}
126
127 \newcommand{\unicodeblockCombiningDiacriticalMarksFont}{\fontwrapdefaultfont}
128
129 \newcommand{\unicodeblockCombiningDiacriticalMarksforSymbolsFont}{\fontwrapdefaultfont}
130
131 \newcommand{\unicodeblockCombiningDiacriticalMarksSupplementFont}{\fontwrapdefaultfont}
132
133 \newcommand{\unicodeblockCombiningHalfMarksFont}{\fontwrapdefaultfont}
134
135 \newcommand{\unicodeblockControlPicturesFont}{\fontwrapdefaultfont}
136
137 \newcommand{\unicodeblockCopticFont}{\fontwrapdefaultfont}
138
139 \newcommand{\unicodeblockCountingRodNumeralsFont}{\fontwrapdefaultfont}
140
141 \newcommand{\unicodeblockCuneiformFont}{\fontwrapdefaultfont}
142
143 \newcommand{\unicodeblockCuneiformNumbersandPunctuationFont}{\fontwrapdefaultfont}
144
145 \newcommand{\unicodeblockCurrencySymbolsFont}{\fontwrapdefaultfont}
146
147 \newcommand{\unicodeblockCypriotSyllabaryFont}{\fontwrapdefaultfont}
148
149 \newcommand{\unicodeblockCyrillicFont}{\fontwrapdefaultfont}
150
151 \newcommand{\unicodeblockCyrillicExtendedAFont}{\fontwrapdefaultfont}
152
153 \newcommand{\unicodeblockCyrillicExtendedBFont}{\fontwrapdefaultfont}
154
155 \newcommand{\unicodeblockCyrillicSupplementFont}{\fontwrapdefaultfont}
156
157 \newcommand{\unicodeblockDeseretFont}{\fontwrapdefaultfont}
158
159 \newcommand{\unicodeblockDevanagariFont}{\fontwrapdefaultfont}
160
161 \newcommand{\unicodeblockDingbatsFont}{\fontwrapdefaultfont}
162
163 \newcommand{\unicodeblockDominoTilesFont}{\fontwrapdefaultfont}
164
165 \newcommand{\unicodeblockEnclosedAlphanumericsFont}{\fontwrapdefaultfont}
166
167 \newcommand{\unicodeblockEnclosedCJKLettersandMonthsFont}{\fontwrapdefaultCJKfont}
168
169 \newcommand{\unicodeblockEthiopicFont}{\fontwrapdefaultfont}
170
171 \newcommand{\unicodeblockEthiopicExtendedFont}{\fontwrapdefaultfont}
172
173 \newcommand{\unicodeblockEthiopicSupplementFont}{\fontwrapdefaultfont}
174
175 \newcommand{\unicodeblockGeneralPunctuationFont}{\fontwrapdefaultfont}
176
177 \newcommand{\unicodeblockGeometricShapesFont}{\fontwrapdefaultfont}
178
179 \newcommand{\unicodeblockGeorgianFont}{\fontwrapdefaultfont}
180
181 \newcommand{\unicodeblockGeorgianSupplementFont}{\fontwrapdefaultfont}
182
183 \newcommand{\unicodeblockGlagoliticFont}{\fontwrapdefaultfont}
184
185 \newcommand{\unicodeblockGothicFont}{\fontwrapdefaultfont}
186
187 \newcommand{\unicodeblockGreekandCopticFont}{\fontwrapdefaultfont}
188
189 \newcommand{\unicodeblockGreekExtendedFont}{\fontwrapdefaultfont}
190
191 \newcommand{\unicodeblockGujaratiFont}{\fontwrapdefaultfont}
192
193 \newcommand{\unicodeblockGurmukhiFont}{\fontwrapdefaultfont}
194
195 \newcommand{\unicodeblockHalfwidthandFullwidthFormsFont}{\fontwrapdefaultCJKfont}
196
197 \newcommand{\unicodeblockHangulCompatibilityJamoFont}{\fontwrapdefaultCJKfont}
198
199 \newcommand{\unicodeblockHangulJamoFont}{\fontwrapdefaultCJKfont}
200
201 \newcommand{\unicodeblockHangulSyllablesFont}{\fontwrapdefaultCJKfont}
202
203 \newcommand{\unicodeblockHanunooFont}{\fontwrapdefaultfont}
204
205 \newcommand{\unicodeblockHebrewFont}{\fontwrapdefaultfont}
206
207 \newcommand{\unicodeblockHighPrivateUseSurrogatesFont}{\fontwrapdefaultfont}
208
209 \newcommand{\unicodeblockHighSurrogatesFont}{\fontwrapdefaultfont}
210
211 \newcommand{\unicodeblockIdeographicDescriptionCharactersFont}{\fontwrapdefaultCJKfont}
212
213 \newcommand{\unicodeblockIPAExtensionsFont}{\fontwrapdefaultfont}
214
215 \newcommand{\unicodeblockKanbunFont}{\fontwrapdefaultCJKfont}
216
217 \newcommand{\unicodeblockKangxiRadicalsFont}{\fontwrapdefaultCJKfont}
218
219 \newcommand{\unicodeblockKannadaFont}{\fontwrapdefaultfont}
220
221 \newcommand{\unicodeblockKatakanaPhoneticExtensionsFont}{\fontwrapdefaultfont}
222
223 \newcommand{\unicodeblockKharoshthiFont}{\fontwrapdefaultfont}
224
225 \newcommand{\unicodeblockKhmerFont}{\fontwrapdefaultfont}
226
227 \newcommand{\unicodeblockKhmerSymbolsFont}{\fontwrapdefaultfont}
228
229 \newcommand{\unicodeblockLaoFont}{\fontwrapdefaultfont}
230
231 \newcommand{\unicodeblockLatinExtendedAdditionalFont}{\fontwrapdefaultfont}
232
233 \newcommand{\unicodeblockLatinExtendedAFont}{\fontwrapdefaultfont}
234
235 \newcommand{\unicodeblockLatinExtendedBFont}{\fontwrapdefaultfont}
236
237 \newcommand{\unicodeblockLatinExtendedCFont}{\fontwrapdefaultfont}
238
239 \newcommand{\unicodeblockLatinExtendedDFont}{\fontwrapdefaultfont}
240
241 % in keeping with uniformity, technically this should be unicodeblockLatin1SupplementFont, but numbers are not allowed in macro names...
242 \newcommand{\unicodeblockLatinSupplementFont}{\fontwrapdefaultfont}
243
244 \newcommand{\unicodeblockLetterlikeSymbolsFont}{\fontwrapdefaultfont}
245
246 \newcommand{\unicodeblockLimbuFont}{\fontwrapdefaultfont}
247
248 \newcommand{\unicodeblockLinearBIdeogramsFont}{\fontwrapdefaultfont}
249
250 \newcommand{\unicodeblockLinearBSyllabaryFont}{\fontwrapdefaultfont}
251
252 \newcommand{\unicodeblockLowSurrogatesFont}{\fontwrapdefaultfont}
253
254 \newcommand{\unicodeblockMahjongTilesFont}{\fontwrapdefaultfont}
255
256 \newcommand{\unicodeblockMalayalamFont}{\fontwrapdefaultfont}
257
258 \newcommand{\unicodeblockMathematicalAlphanumericSymbolsFont}{\fontwrapdefaultfont}
259
260 \newcommand{\unicodeblockMathematicalOperatorsFont}{\fontwrapdefaultfont}
261
262 \newcommand{\unicodeblockMiscellaneousMathematicalSymbolsAFont}{\fontwrapdefaultfont}
263
264 \newcommand{\unicodeblockMiscellaneousMathematicalSymbolsBFont}{\fontwrapdefaultfont}
265
266 \newcommand{\unicodeblockMiscellaneousSymbolsFont}{\fontwrapdefaultfont}
267
268 \newcommand{\unicodeblockMiscellaneousSymbolsandArrowsFont}{\fontwrapdefaultfont}
269
270 \newcommand{\unicodeblockMiscellaneousTechnicalFont}{\fontwrapdefaultfont}
271
272 \newcommand{\unicodeblockModifierToneLettersFont}{\fontwrapdefaultfont}
273
274 \newcommand{\unicodeblockMongolianFont}{\fontwrapdefaultfont}
275
276 \newcommand{\unicodeblockMusicalSymbolsFont}{\fontwrapdefaultfont}
277
278 \newcommand{\unicodeblockMyanmarFont}{\fontwrapdefaultfont}
279
280 \newcommand{\unicodeblockNewTaiLueFont}{\fontwrapdefaultfont}
281
282 \newcommand{\unicodeblockNKoFont}{\fontwrapdefaultfont}
283
284 \newcommand{\unicodeblockNumberFormsFont}{\fontwrapdefaultfont}
285
286 \newcommand{\unicodeblockOghamFont}{\fontwrapdefaultfont}
287
288 \newcommand{\unicodeblockOldItalicFont}{\fontwrapdefaultfont}
289
290 \newcommand{\unicodeblockOldPersianFont}{\fontwrapdefaultfont}
291
292 \newcommand{\unicodeblockOpticalCharacterRecognitionFont}{\fontwrapdefaultfont}
293
294 \newcommand{\unicodeblockOriyaFont}{\fontwrapdefaultfont}
295
296 \newcommand{\unicodeblockOsmanyaFont}{\fontwrapdefaultfont}
297
298 % because hyphens are also not allowed in macros, "Phags-pa" has been turned into the less correct PhagsPa
299 \newcommand{\unicodeblockPhagsPaFont}{\fontwrapdefaultfont}
300
301 \newcommand{\unicodeblockPhoenicianFont}{\fontwrapdefaultfont}
302
303 \newcommand{\unicodeblockPhoneticExtensionsFont}{\fontwrapdefaultfont}
304
305 \newcommand{\unicodeblockPhoneticExtensionsSupplementFont}{\fontwrapdefaultfont}
306
307 \newcommand{\unicodeblockPrivateUseAreaFont}{\fontwrapdefaultfont}
308
309 \newcommand{\unicodeblockRunicFont}{\fontwrapdefaultfont}
310
311 \newcommand{\unicodeblockShavianFont}{\fontwrapdefaultfont}
312
313 \newcommand{\unicodeblockSinhalaFont}{\fontwrapdefaultfont}
314
315 \newcommand{\unicodeblockSmallFormVariantsFont}{\fontwrapdefaultfont}
316
317 \newcommand{\unicodeblockSpacingModifierLettersFont}{\fontwrapdefaultfont}
318
319 \newcommand{\unicodeblockSpecialsFont}{\fontwrapdefaultfont}
320
321 \newcommand{\unicodeblockSuperscriptsandSubscriptsFont}{\fontwrapdefaultfont}
322
323 \newcommand{\unicodeblockSupplementalArrowsAFont}{\fontwrapdefaultfont}
324
325 \newcommand{\unicodeblockSupplementalArrowsBFont}{\fontwrapdefaultfont}
326
327 \newcommand{\unicodeblockSupplementalMathematicalOperatorsFont}{\fontwrapdefaultfont}
328
329 \newcommand{\unicodeblockSupplementalPunctuationFont}{\fontwrapdefaultfont}
330
331 \newcommand{\unicodeblockSupplementaryPrivateUseAreaAFont}{\fontwrapdefaultfont}
332
333 \newcommand{\unicodeblockSupplementaryPrivateUseAreaBFont}{\fontwrapdefaultfont}
334
335 \newcommand{\unicodeblockSylotiNagriFont}{\fontwrapdefaultfont}
336
337 \newcommand{\unicodeblockSyriacFont}{\fontwrapdefaultfont}
338
339 \newcommand{\unicodeblockTagalogFont}{\fontwrapdefaultfont}
340
341 \newcommand{\unicodeblockTagbanwaFont}{\fontwrapdefaultfont}
342
343 \newcommand{\unicodeblockTagsFont}{\fontwrapdefaultfont}
344
345 \newcommand{\unicodeblockTaiLeFont}{\fontwrapdefaultfont}
346
347 \newcommand{\unicodeblockTaiXuanJingSymbolsFont}{\fontwrapdefaultfont}
348
349 \newcommand{\unicodeblockTamilFont}{\fontwrapdefaultfont}
350
351 \newcommand{\unicodeblockTeluguFont}{\fontwrapdefaultfont}
352
353 \newcommand{\unicodeblockThaanaFont}{\fontwrapdefaultfont}
354
355 \newcommand{\unicodeblockThaiFont}{\fontwrapdefaultfont}
356
357 \newcommand{\unicodeblockTibetanFont}{\fontwrapdefaultfont}
358
359 \newcommand{\unicodeblockTifinaghFont}{\fontwrapdefaultfont}
360
361 \newcommand{\unicodeblockUgariticFont}{\fontwrapdefaultfont}
362
363 \newcommand{\unicodeblockUnifiedCanadianAboriginalSyllabicsFont}{\fontwrapdefaultfont}
364
365 \newcommand{\unicodeblockVariationSelectorsFont}{\fontwrapdefaultfont}
366
367 \newcommand{\unicodeblockVariationSelectorsSupplementFont}{\fontwrapdefaultfont}
368
369 \newcommand{\unicodeblockVerticalFormsFont}{\fontwrapdefaultfont}
370
371 \newcommand{\unicodeblockYiRadicalsFont}{\fontwrapdefaultCJKfont}
372
373 \newcommand{\unicodeblockYiSyllablesFont}{\fontwrapdefaultCJKfont}
374
375 \newcommand{\unicodeblockYijingHexagramSymbolsFont}{\fontwrapdefaultCJKfont}
376
377 %
378 % I don't want to write a huge ifthen construction - I prefer
379 % to rely on parse passes instead.
380 %
381 \perlnewcommand{\setunicodeblockfont}[2]{ return "\\renewcommand{\\unicodeblock".$_[0]."Font}{".$_[1]."}"; }
382
383 % ------------------------------------------------------------------
384 %
385 % in addition to the unicode blocks, also mark the informal groups
386 %
387 % ------------------------------------------------------------------
388
389 \newcommand{\unicodegroupArabicFont}{\fontwrapdefaultfont}
390 \newcommand{\unicodegroupChineseFont}{\fontwrapdefaultCJKfont}
391 \newcommand{\unicodegroupCJKFont}{\fontwrapdefaultCJKfont}
392 \newcommand{\unicodegroupCyrillicFont}{\fontwrapdefaultfont}
393 \newcommand{\unicodegroupDiacriticsFont}{\fontwrapdefaultfont}
394 \newcommand{\unicodegroupGreekFont}{\fontwrapdefaultfont}
395 \newcommand{\unicodegroupKoreanFont}{\fontwrapdefaultCJKfont}
396 \newcommand{\unicodegroupJapaneseFont}{\fontwrapdefaultCJKfont}
397 \newcommand{\unicodegroupLatinFont}{\fontwrapdefaultfont}
398 \newcommand{\unicodegroupMathematicsFont}{\fontwrapdefaultfont}
399 \newcommand{\unicodegroupPhoneticsFont}{\fontwrapdefaultfont}
400 \newcommand{\unicodegroupPunctuationFont}{\fontwrapdefaultfont}
401 \newcommand{\unicodegroupSymbolsFont}{\fontwrapdefaultfont}
402 \newcommand{\unicodegroupYiFont}{\fontwrapdefaultfont}
403 \newcommand{\unicodegroupOtherFont}{\fontwrapdefaultfont}
404
405 % -------------------------------------------------------------------------------
406 %
407 % Then, informal group font binding, to make life just a little easier.
408 % The following informal groups are supported:
409 %
410 % - Arabic
411 % - Chinese (including bopomofo)
412 % - CJK (Chinese/Japanese/Korean)
413 % - Cyrillic
414 % - Diacritics
415 % - Greek
416 % - Japanese
417 % - Korean (=Hangul)
418 % - Latin
419 % - Mathematics
420 % - Phonetics
421 % - Punctuation
422 % - Symbols
423 % - Yi
424 % - Other (I am not a fan of lump groups. I hope to un-lump most of it)
425 %
426 % -------------------------------------------------------------------------------
427
428
429 \newcommand{\setunicodegroupArabicFont}[1]{
430   \renewcommand{\unicodeblockArabicFont}{#1}
431   \renewcommand{\unicodeblockArabicPresentationFormsAFont}{#1}
432   \renewcommand{\unicodeblockArabicPresentationFormsBFont}{#1}
433   \renewcommand{\unicodeblockArabicSupplementFont}{#1}
434 \renewcommand{\unicodegroupArabicFont}{#1}
435 }
436
437 \newcommand{\setunicodegroupChineseFont}[1]{
438 \renewcommand{\unicodeblockBopomofoFont}{#1}
439 \renewcommand{\unicodeblockBopomofoExtendedFont}{#1}
440 \renewcommand{\unicodeblockCJKCompatibilityFont}{#1}
441 \renewcommand{\unicodeblockCJKCompatibilityFormsFont}{#1}
442 \renewcommand{\unicodeblockCJKCompatibilityIdeographsFont}{#1}
443 \renewcommand{\unicodeblockCJKCompatibilityIdeographsSupplementFont}{#1}
444 \renewcommand{\unicodeblockCJKRadicalsSupplementFont}{#1}
445 \renewcommand{\unicodeblockCJKStrokesFont}{#1}
446 \renewcommand{\unicodeblockCJKSymbolsandPunctuationFont}{#1}
447 \renewcommand{\unicodeblockCJKUnifiedIdeographsFont}{#1}
448 \renewcommand{\unicodeblockCJKUnifiedIdeographsExtensionAFont}{#1}
449 \renewcommand{\unicodeblockCJKUnifiedIdeographsExtensionBFont}{#1}
450 \renewcommand{\unicodeblockEnclosedCJKLettersandMonthsFont}{#1}
451 \renewcommand{\unicodeblockIdeographicDescriptionCharactersFont}{#1}
452 \renewcommand{\unicodeblockKangxiRadicalsFont}{#1}
453 \renewcommand{\unicodegroupChineseFont}{#1}
454 }
455
456 \newcommand{\setunicodegroupCJKFont}[1]{
457 \renewcommand{\unicodeblockBopomofoFont}{#1}
458 \renewcommand{\unicodeblockBopomofoExtendedFont}{#1}
459 \renewcommand{\unicodeblockCJKCompatibilityFont}{#1}
460 \renewcommand{\unicodeblockCJKCompatibilityFormsFont}{#1}
461 \renewcommand{\unicodeblockCJKCompatibilityIdeographsFont}{#1}
462 \renewcommand{\unicodeblockCJKCompatibilityIdeographsSupplementFont}{#1}
463 \renewcommand{\unicodeblockCJKRadicalsSupplementFont}{#1}
464 \renewcommand{\unicodeblockCJKStrokesFont}{#1}
465 \renewcommand{\unicodeblockCJKSymbolsandPunctuationFont}{#1}
466 \renewcommand{\unicodeblockCJKUnifiedIdeographsFont}{#1}
467 \renewcommand{\unicodeblockCJKUnifiedIdeographsExtensionAFont}{#1}
468 \renewcommand{\unicodeblockCJKUnifiedIdeographsExtensionBFont}{#1}
469 \renewcommand{\unicodeblockEnclosedCJKLettersandMonthsFont}{#1}
470 \renewcommand{\unicodeblockHalfwidthandFullwidthFormsFont}{#1}
471 \renewcommand{\unicodeblockHangulCompatibilityJamoFont}{#1}
472 \renewcommand{\unicodeblockHangulJamoFont}{#1}
473 \renewcommand{\unicodeblockHangulSyllablesFont}{#1}
474 \renewcommand{\unicodeblockHiraganaFont}{#1}
475 \renewcommand{\unicodeblockIdeographicDescriptionCharactersFont}{#1}
476 \renewcommand{\unicodeblockKanbunFont}{#1}
477 \renewcommand{\unicodeblockKangxiRadicalsFont}{#1}
478 \renewcommand{\unicodeblockKatakanaFont}{#1}
479 \renewcommand{\unicodeblockKatakanaPhoneticExtensionsFont}{#1}
480 \renewcommand{\unicodegroupCJKFont}{#1}
481 }
482
483 \newcommand{\setunicodegroupCyrillicFont}[1]{
484 \renewcommand{\unicodeblockCyrillicFont}{#1}
485 \renewcommand{\unicodeblockCyrillicExtendedAFont}{#1}
486 \renewcommand{\unicodeblockCyrillicExtendedBFont}{#1}
487 \renewcommand{\unicodeblockCyrillicSupplementFont}{#1}
488 \renewcommand{\unicodegroupCyrillicFont}{#1}
489 }
490
491 \newcommand{\setunicodegroupDiacriticsFont}[1]{
492   \renewcommand{\unicodeblockCombiningDiacriticalMarksFont}{#1}
493   \renewcommand{\unicodeblockCombiningDiacriticalMarksforSymbolsFont}{#1}
494   \renewcommand{\unicodeblockCombiningDiacriticalMarksSupplementFont}{#1}
495   \renewcommand{\unicodeblockCombiningHalfMarksFont}{#1}
496 \renewcommand{\unicodegroupDiacriticsFont}{#1}
497 }
498
499 \newcommand{\setunicodegroupGreekFont}[1]{
500   \renewcommand{\unicodeblockGreekandCopticFont}{#1}
501   \renewcommand{\unicodeblockGreekExtendedFont}{#1}
502 \renewcommand{\unicodegroupGreekFont}{#1}
503 }
504
505 \newcommand{\setunicodegroupKoreanFont}[1]{
506 \renewcommand{\unicodeblockHangulCompatibilityJamoFont}{#1}
507 \renewcommand{\unicodeblockHangulJamoFont}{#1}
508 \renewcommand{\unicodeblockHangulSyllablesFont}{#1}
509 \renewcommand{\unicodegroupKoreanFont}{#1}
510 }
511
512 \newcommand{\setunicodegroupJapaneseFont}[1]{
513 \renewcommand{\unicodeblockHalfwidthandFullwidthFormsFont}{#1}
514 \renewcommand{\unicodeblockHiraganaFont}{#1}
515 \renewcommand{\unicodeblockKanbunFont}{#1}
516 \renewcommand{\unicodeblockKatakanaFont}{#1}
517 \renewcommand{\unicodeblockKatakanaPhoneticExtensionsFont}{#1}
518 \renewcommand{\unicodeblockKangxiRadicalsFont}{#1}
519 \renewcommand{\unicodegroupJapaneseFont}{#1}
520 }
521
522 \newcommand{\setunicodegroupLatinFont}[1]{
523   \renewcommand{\unicodeblockBasicLatinFont}{#1}
524   \renewcommand{\unicodeblockLatinExtendedAdditionalFont}{#1}
525   \renewcommand{\unicodeblockLatinExtendedAFont}{#1}
526   \renewcommand{\unicodeblockLatinExtendedBFont}{#1}
527   \renewcommand{\unicodeblockLatinExtendedCFont}{#1}
528   \renewcommand{\unicodeblockLatinExtendedDFont}{#1}
529   \renewcommand{\unicodeblockLatinSupplementFont}{#1}
530 \renewcommand{\unicodeblockAlphabeticPresentationFormsFont}{#1}
531 \renewcommand{\unicodegroupLatinFont}{#1}
532 }
533
534 \newcommand{\setunicodegroupMathematicsFont}[1]{
535 \renewcommand{\unicodeblockMathematicalAlphanumericSymbolsFont}{#1}
536 \renewcommand{\unicodeblockMathematicalOperatorsFont}{#1}
537 \renewcommand{\unicodeblockMiscellaneousMathematicalSymbolsAFont}{#1}
538 \renewcommand{\unicodeblockMiscellaneousMathematicalSymbolsBFont}{#1}
539 \renewcommand{\unicodeblockSupplementalMathematicalOperatorsFont}{#1}
540 \renewcommand{\unicodegroupMathematicsFont}{#1}
541 }
542
543 \newcommand{\setunicodegroupPhoneticsFont}[1]{
544 \renewcommand{\unicodeblockIPAExtensionsFont}{#1}
545 \renewcommand{\unicodeblockPhoneticExtensionsFont}{#1}
546 \renewcommand{\unicodeblockPhoneticExtensionsSupplementFont}{#1}
547 \renewcommand{\unicodegroupPhoneticsFont}{#1}
548 }
549
550 \newcommand{\setunicodegroupPunctuationFont}[1]{
551 \renewcommand{\unicodeblockGeneralPunctuationFont}{#1}
552 \renewcommand{\unicodeblockSupplementalPunctuationFont}{#1}
553 \renewcommand{\unicodegroupPunctuationFont}{#1}
554 }
555
556 \newcommand{\setunicodegroupSymbolsFont}[1]{
557 \renewcommand{\unicodeblockArrowsFont}{#1}
558 \renewcommand{\unicodeblockBoxDrawingFont}{#1}
559 \renewcommand{\unicodeblockByzantineMusicalSymbolsFont}{#1}
560 \renewcommand{\unicodeblockControlPicturesFont}{#1}
561 \renewcommand{\unicodeblockCurrencySymbolsFont}{#1}
562 \renewcommand{\unicodeblockGeometricShapesFont}{#1}
563 \renewcommand{\unicodeblockLetterlikeSymbolsFont}{#1}
564 \renewcommand{\unicodeblockMiscellaneousSymbolsFont}{#1}
565 \renewcommand{\unicodeblockMiscellaneousSymbolsandArrowsFont}{#1}
566 \renewcommand{\unicodeblockMiscellaneousTechnicalFont}{#1}
567 \renewcommand{\unicodeblockSupplementalArrowsAFont}{#1}
568 \renewcommand{\unicodeblockSupplementalArrowsBFont}{#1}
569 \renewcommand{\unicodeblockVariationSelectorsFont}{#1}
570 \renewcommand{\unicodeblockVariationSelectorsSupplementFont}{#1}
571 \renewcommand{\unicodegroupSymbolsFont}{#1}
572 }
573
574 \newcommand{\setunicodegroupYiFont}[1]{
575 \renewcommand{\unicodeblockYiRadicalsFont}{#1}
576 \renewcommand{\unicodeblockYiSyllablesFont}{#1}
577 \renewcommand{\unicodegroupYiFont}{#1}
578 }
579
580 \newcommand{\setunicodegroupOtherFont}[1]{
581 \renewcommand{\unicodeblockAegeanNumbersFont}{#1}
582 \renewcommand{\unicodeblockAncientGreekMusicalNotationFont}{#1}
583 \renewcommand{\unicodeblockAncientGreekNumbersFont}{#1}
584 \renewcommand{\unicodeblockArmenianFont}{#1}
585 \renewcommand{\unicodeblockBalineseFont}{#1}
586 \renewcommand{\unicodeblockBengaliFont}{#1}
587 \renewcommand{\unicodeblockBlockElementsFont}{#1}
588 \renewcommand{\unicodeblockBraillePatternsFont}{#1}
589 \renewcommand{\unicodeblockBugineseFont}{#1}
590 \renewcommand{\unicodeblockBuhidFont}{#1}
591 \renewcommand{\unicodeblockCherokeeFont}{#1}
592 \renewcommand{\unicodeblockCopticFont}{#1}
593 \renewcommand{\unicodeblockCountingRodNumeralsFont}{#1}
594 \renewcommand{\unicodeblockCuneiformFont}{#1}
595 \renewcommand{\unicodeblockCuneiformNumbersandPunctuationFont}{#1}
596 \renewcommand{\unicodeblockCypriotSyllabaryFont}{#1}
597 \renewcommand{\unicodeblockDeseretFont}{#1}
598 \renewcommand{\unicodeblockDevanagariFont}{#1}
599 \renewcommand{\unicodeblockDingbatsFont}{#1}
600 \renewcommand{\unicodeblockDominoTilesFont}{#1}
601 \renewcommand{\unicodeblockEnclosedAlphanumericsFont}{#1}
602 \renewcommand{\unicodeblockEthiopicFont}{#1}
603 \renewcommand{\unicodeblockEthiopicExtendedFont}{#1}
604 \renewcommand{\unicodeblockEthiopicSupplementFont}{#1}
605 \renewcommand{\unicodeblockGeorgianFont}{#1}
606 \renewcommand{\unicodeblockGeorgianSupplementFont}{#1}
607 \renewcommand{\unicodeblockGlagoliticFont}{#1}
608 \renewcommand{\unicodeblockGothicFont}{#1}
609 \renewcommand{\unicodeblockGujaratiFont}{#1}
610 \renewcommand{\unicodeblockGurmukhiFont}{#1}
611 \renewcommand{\unicodeblockHanunooFont}{#1}
612 \renewcommand{\unicodeblockHebrewFont}{#1}
613 \renewcommand{\unicodeblockHighPrivateUseSurrogatesFont}{#1}
614 \renewcommand{\unicodeblockHighSurrogatesFont}{#1}
615 \renewcommand{\unicodeblockKannadaFont}{#1}
616 \renewcommand{\unicodeblockKharoshthiFont}{#1}
617 \renewcommand{\unicodeblockKhmerFont}{#1}
618 \renewcommand{\unicodeblockKhmerSymbolsFont}{#1}
619 \renewcommand{\unicodeblockLaoFont}{#1}
620 \renewcommand{\unicodeblockLimbuFont}{#1}
621 \renewcommand{\unicodeblockLinearBIdeogramsFont}{#1}
622 \renewcommand{\unicodeblockLinearBSyllabaryFont}{#1}
623 \renewcommand{\unicodeblockLowSurrogatesFont}{#1}
624 \renewcommand{\unicodeblockMahjongTilesFont}{#1}
625 \renewcommand{\unicodeblockMalayalamFont}{#1}
626 \renewcommand{\unicodeblockModifierToneLettersFont}{#1}
627 \renewcommand{\unicodeblockMongolianFont}{#1}
628 \renewcommand{\unicodeblockMusicalSymbolsFont}{#1}
629 \renewcommand{\unicodeblockMyanmarFont}{#1}
630 \renewcommand{\unicodeblockNewTaiLueFont}{#1}
631 \renewcommand{\unicodeblockNKoFont}{#1}
632 \renewcommand{\unicodeblockNumberFormsFont}{#1}
633 \renewcommand{\unicodeblockOghamFont}{#1}
634 \renewcommand{\unicodeblockOldItalicFont}{#1}
635 \renewcommand{\unicodeblockOldPersianFont}{#1}
636 \renewcommand{\unicodeblockOpticalCharacterRecognitionFont}{#1}
637 \renewcommand{\unicodeblockOriyaFont}{#1}
638 \renewcommand{\unicodeblockOsmanyaFont}{#1}
639 \renewcommand{\unicodeblockPhagsPaFont}{#1}
640 \renewcommand{\unicodeblockPhoenicianFont}{#1}
641 \renewcommand{\unicodeblockPrivateUseAreaFont}{#1}
642 \renewcommand{\unicodeblockRunicFont}{#1}
643 \renewcommand{\unicodeblockShavianFont}{#1}
644 \renewcommand{\unicodeblockSinhalaFont}{#1}
645 \renewcommand{\unicodeblockSmallFormVariantsFont}{#1}
646 \renewcommand{\unicodeblockSpacingModifierLettersFont}{#1}
647 \renewcommand{\unicodeblockSpecialsFont}{#1}
648 \renewcommand{\unicodeblockSuperscriptsandSubscriptsFont}{#1}
649 \renewcommand{\unicodeblockSupplementaryPrivateUseAreaAFont}{#1}
650 \renewcommand{\unicodeblockSupplementaryPrivateUseAreaBFont}{#1}
651 \renewcommand{\unicodeblockSylotiNagriFont}{#1}
652 \renewcommand{\unicodeblockSyriacFont}{#1}
653 \renewcommand{\unicodeblockTagalogFont}{#1}
654 \renewcommand{\unicodeblockTagbanwaFont}{#1}
655 \renewcommand{\unicodeblockTagsFont}{#1}
656 \renewcommand{\unicodeblockTaiLeFont}{#1}
657 \renewcommand{\unicodeblockTaiXuanJingSymbolsFont}{#1}
658 \renewcommand{\unicodeblockTamilFont}{#1}
659 \renewcommand{\unicodeblockTeluguFont}{#1}
660 \renewcommand{\unicodeblockThaanaFont}{#1}
661 \renewcommand{\unicodeblockThaiFont}{#1}
662 \renewcommand{\unicodeblockTibetanFont}{#1}
663 \renewcommand{\unicodeblockTifinaghFont}{#1}
664 \renewcommand{\unicodeblockUgariticFont}{#1}
665 \renewcommand{\unicodeblockUnifiedCanadianAboriginalSyllabicsFont}{#1}
666 \renewcommand{\unicodeblockVerticalFormsFont}{#1}
667 \renewcommand{\unicodeblockYijingHexagramSymbolsFont}{#1}
668 \renewcommand{\unicodegroupOtherFont}{#1}
669 }
670
671 \newcommand{\setfontwrapdefaultfont}[1]{
672 \setunicodegroupArabicFont{#1}
673 \setunicodegroupCJKFont{#1}
674 \setunicodegroupCyrillicFont{#1}
675 \setunicodegroupDiacriticsFont{#1}
676 \setunicodegroupGreekFont{#1}
677 \setunicodegroupLatinFont{#1}
678 \setunicodegroupMathematicsFont{#1}
679 \setunicodegroupPhoneticsFont{#1}
680 \setunicodegroupPunctuationFont{#1}
681 \setunicodegroupSymbolsFont{#1}
682 \setunicodegroupYiFont{#1}
683 \setunicodegroupOtherFont{#1}
684 }
685
686 %
687 % I don't want to write a huge ifthen construction here either
688 %
689 \perlnewcommand{\setunicodegroupfont}[2]{ return "\\setunicodegroup".$_[0]."Font{".$_[1]."}"; }
690
691
692 % ------------------------------------------------------------------------------------
693 %
694 % then, the actual block data definitions. These consist of a comma delimited list of:
695 %
696 % - unicode block name
697 % - informal group the block is in
698 % - codepoint of the first glyph in the block, in hexadecimal notation
699 % - codepoint of the last glyph in the block, in hexadecimal notation
700 % - number of glyphs in the block
701 % - font macro, which is passed as macro argument
702 %
703 % ------------------------------------------------------------------------------------
704
705 \newcommand{\unicodeblockAegeanNumbers}[1]{Aegean Numbers,Other,10100,1013F,57,#1}
706
707 \newcommand{\unicodeblockAlphabeticPresentationForms}[1]{Alphabetic Presentation Forms,Ligatures,FB00,FB4F,58,#1}
708
709 \newcommand{\unicodeblockAncientGreekMusicalNotation}[1]{Ancient Greek Musical Notation,Other,1D200,1D24F,70,#1}
710
711 \newcommand{\unicodeblockAncientGreekNumbers}[1]{Ancient Greek Numbers,Other,10140,1018F,75,#1}
712
713 \newcommand{\unicodeblockArabic}[1]{Arabic,Arabic,0600,06FF,235,#1}
714
715 \newcommand{\unicodeblockArabicPresentationFormsA}[1]{Arabic Presentation Forms-A,Arabic,FB50,FDFF,595,#1}
716
717 \newcommand{\unicodeblockArabicPresentationFormsB}[1]{Arabic Presentation Forms-B,Arabic,FE70,FEFF,141,#1}
718
719 \newcommand{\unicodeblockArabicSupplement}[1]{Arabic Supplement,Arabic,0750,077F,30,#1}
720
721 \newcommand{\unicodeblockArmenian}[1]{Armenian,Other,0530,058F,86,#1}
722
723 \newcommand{\unicodeblockArrows}[1]{Arrows,Symbols,2190,21FF,112,#1}
724
725 \newcommand{\unicodeblockBalinese}[1]{Balinese,Other,1B00,1B7F,121,#1}
726
727 \newcommand{\unicodeblockBasicLatin}[1]{Basic Latin,Latin,0000,007F,128,#1}
728
729 \newcommand{\unicodeblockBengali}[1]{Bengali,Other,0980,09FF,91,#1}
730
731 \newcommand{\unicodeblockBlockElements}[1]{Block Elements,Other,2580,259F,32,#1}
732
733 \newcommand{\unicodeblockBopomofo}[1]{Bopomofo,Bopomofo,3100,312F,40,#1}
734
735 \newcommand{\unicodeblockBopomofoExtended}[1]{Bopomofo Extended,Bopomofo,31A0,31BF,24,#1}
736
737 \newcommand{\unicodeblockBoxDrawing}[1]{Box Drawing,Symbols,2500,257F,128,#1}
738
739 \newcommand{\unicodeblockBraillePatterns}[1]{Braille Patterns,Other,2800,28FF,256,#1}
740
741 \newcommand{\unicodeblockBuginese}[1]{Buginese,Other,1A00,1A1F,30,#1}
742
743 \newcommand{\unicodeblockBuhid}[1]{Buhid,Other,1740,175F,20,#1}
744
745 \newcommand{\unicodeblockByzantineMusicalSymbols}[1]{Byzantine Musical Symbols,Symbols,1D000,1D0FF,246,#1}
746
747 \newcommand{\unicodeblockCherokee}[1]{Cherokee,Other,13A0,13FF,85,#1}
748
749 \newcommand{\unicodeblockCJKCompatibility}[1]{CJK Compatibility,CJK,3300,33FF,256,#1}
750
751 \newcommand{\unicodeblockCJKCompatibilityForms}[1]{CJK Compatibility Forms,CJK,FE30,FE4F,32,#1}
752
753 \newcommand{\unicodeblockCJKCompatibilityIdeographs}[1]{CJK Compatibility Ideographs,CJK,F900,FAFF,467,#1}
754
755 \newcommand{\unicodeblockCJKCompatibilityIdeographsSupplement}[1]{CJK Compatibility Ideographs Supplement,CJK,2F800,2FA1F,542,#1}
756
757 \newcommand{\unicodeblockCJKRadicalsSupplement}[1]{CJK Radicals Supplement,CJK,2E80,2EFF,115,#1}
758
759 \newcommand{\unicodeblockCJKStrokes}[1]{CJK Strokes,CJK,31C0,31EF,16,#1}
760
761 \newcommand{\unicodeblockCJKSymbolsandPunctuation}[1]{CJK Symbols and Punctuation,CJK,3000,303F,64,#1}
762
763 \newcommand{\unicodeblockCJKUnifiedIdeographs}[1]{CJK Unified Ideographs,CJK,4E00,9FFF,20924,#1}
764
765 \newcommand{\unicodeblockCJKUnifiedIdeographsExtensionA}[1]{CJK Unified Ideographs Extension A,CJK,3400,4DBF,6582,#1}
766
767 \newcommand{\unicodeblockCJKUnifiedIdeographsExtensionB}[1]{CJK Unified Ideographs Extension B,CJK,20000,2A6DF,42711,#1}
768
769 \newcommand{\unicodeblockCombiningDiacriticalMarks}[1]{Combining Diacritical Marks,Diacritics,0300,036F,112,#1}
770
771 \newcommand{\unicodeblockCombiningDiacriticalMarksforSymbols}[1]{Combining Diacritical Marks for Symbols,Diacritics,20D0,20FF,32,#1}
772
773 \newcommand{\unicodeblockCombiningDiacriticalMarksSupplement}[1]{Combining Diacritical Marks Supplement,Diacritics,1DC0,1DFF,13,#1}
774
775 \newcommand{\unicodeblockCombiningHalfMarks}[1]{Combining Half Marks,Diacritics,FE20,FE2F,4,#1}
776
777 \newcommand{\unicodeblockControlPictures}[1]{Control Pictures,Symbols,2400,243F,39,#1}
778
779 \newcommand{\unicodeblockCoptic}[1]{Coptic,Other,2C80,2CFF,114,#1}
780
781 \newcommand{\unicodeblockCountingRodNumerals}[1]{Counting Rod Numerals,Other,1D360,1D37F,18,#1}
782
783 \newcommand{\unicodeblockCuneiform}[1]{Cuneiform,Other,12000,123FF,879,#1}
784
785 \newcommand{\unicodeblockCuneiformNumbersandPunctuation}[1]{Cuneiform Numbers and Punctuation,Other,12400,1247F,103,#1}
786
787 \newcommand{\unicodeblockCurrencySymbols}[1]{Currency Symbols,Symbols,20A0,20CF,22,#1}
788
789 \newcommand{\unicodeblockCypriotSyllabary}[1]{Cypriot Syllabary,Other,10800,1083F,55,#1}
790
791 \newcommand{\unicodeblockCyrillic}[1]{Cyrillic,Cyrillic,0400,04FF,255,#1}
792
793 \newcommand{\unicodeblockCyrillicExtendedA}[1]{Cyrillic Extended-A,Cyrillic,2DE0,2DFF,32,#1}
794
795 \newcommand{\unicodeblockCyrillicExtendedB}[1]{Cyrillic Extended-B,Cyrillic,A640,A69f,78,#1}
796
797 \newcommand{\unicodeblockCyrillicSupplement}[1]{Cyrillic Supplement,Cyrillic,0500,052F,20,#1}
798
799 \newcommand{\unicodeblockDeseret}[1]{Deseret,Other,10400,1044F,80,#1}
800
801 \newcommand{\unicodeblockDevanagari}[1]{Devanagari,Other,0900,097F,110,#1}
802
803 \newcommand{\unicodeblockDingbats}[1]{Dingbats,Other,2700,27BF,174,#1}
804
805 \newcommand{\unicodeblockDominoTiles}[1]{Domino Tiles,Other,1F030,1F09F,100,#1}
806
807 \newcommand{\unicodeblockEnclosedAlphanumerics}[1]{Enclosed Alphanumerics,Other,2460,24FF,160,#1}
808
809 \newcommand{\unicodeblockEnclosedCJKLettersandMonths}[1]{Enclosed CJK Letters and Months,CJK,3200,32FF,242,#1}
810
811 \newcommand{\unicodeblockEthiopic}[1]{Ethiopic,Other,1200,137F,356,#1}
812
813 \newcommand{\unicodeblockEthiopicExtended}[1]{Ethiopic Extended,Other,2D80,2DDF,79,#1}
814
815 \newcommand{\unicodeblockEthiopicSupplement}[1]{Ethiopic Supplement,Other,1380,139F,26,#1}
816
817 \newcommand{\unicodeblockGeneralPunctuation}[1]{General Punctuation,Punctuation,2000,206F,106,#1}
818
819 \newcommand{\unicodeblockGeometricShapes}[1]{Geometric Shapes,Symbols,25A0,25FF,96,#1}
820
821 \newcommand{\unicodeblockGeorgian}[1]{Georgian,Other,10A0,10FF,83,#1}
822
823 \newcommand{\unicodeblockGeorgianSupplement}[1]{Georgian Supplement,Other,2D00,2D2F,38,#1}
824
825 \newcommand{\unicodeblockGlagolitic}[1]{Glagolitic,Other,2C00,2C5F,94,#1}
826
827 \newcommand{\unicodeblockGothic}[1]{Gothic,Other,10330,1034F,27,#1}
828
829 \newcommand{\unicodeblockGreekandCoptic}[1]{Greek and Coptic,Greek,0370,03FF,127,#1}
830
831 \newcommand{\unicodeblockGreekExtended}[1]{Greek Extended,Greek,1F00,1FFF,233,#1}
832
833 \newcommand{\unicodeblockGujarati}[1]{Gujarati,Other,0A80,0AFF,83,#1}
834
835 \newcommand{\unicodeblockGurmukhi}[1]{Gurmukhi,Other,0A00,0A7F,77,#1}
836
837 \newcommand{\unicodeblockHalfwidthandFullwidthForms}[1]{Halfwidth and Fullwidth Forms,CJK,FF00,FFEF,225,#1}
838
839 \newcommand{\unicodeblockHangulCompatibilityJamo}[1]{Hangul Compatibility Jamo,Hangul,3130,318F,94,#1}
840
841 \newcommand{\unicodeblockHangulJamo}[1]{Hangul Jamo,Hangul,1100,11FF,240,#1}
842
843 \newcommand{\unicodeblockHangulSyllables}[1]{Hangul Syllables,Hangul,AC00,D7AF,2,#1}
844
845 \newcommand{\unicodeblockHanunoo}[1]{Hanunoo,Other,1720,173F,23,#1}
846
847 \newcommand{\unicodeblockHebrew}[1]{Hebrew,Other,0590,05FF,87,#1}
848
849 \newcommand{\unicodeblockHighPrivateUseSurrogates}[1]{High Private Use Surrogates,Other,DB80,DBFF,2,#1}
850
851 \newcommand{\unicodeblockHighSurrogates}[1]{High Surrogates,Other,D800,DB7F,2,#1}
852
853 \newcommand{\unicodeblockHiragana}[1]{Hiragana,CJK,3040,309F,93,#1}
854
855 \newcommand{\unicodeblockIdeographicDescriptionCharacters}[1]{Ideographic Description Characters,CJK,2FF0,2FFF,12,#1}
856
857 \newcommand{\unicodeblockIPAExtensions}[1]{IPA Extensions,Phonetics,0250,02AF,96,#1}
858
859 \newcommand{\unicodeblockKanbun}[1]{Kanbun,CJK,3190,319F,16,#1}
860
861 \newcommand{\unicodeblockKangxiRadicals}[1]{Kangxi Radicals,CJK,2F00,2FDF,214,#1}
862
863 \newcommand{\unicodeblockKannada}[1]{Kannada,Other,0C80,0CFF,86,#1}
864
865 \newcommand{\unicodeblockKatakana}[1]{Katakana,CJK,30A0,30FF,96,#1}
866
867 \newcommand{\unicodeblockKatakanaPhoneticExtensions}[1]{Katakana Phonetic Extensions,CJK,31F0,31FF,16,#1}
868
869 \newcommand{\unicodeblockKharoshthi}[1]{Kharoshthi,Other,10A00,10A5F,65,#1}
870
871 \newcommand{\unicodeblockKhmer}[1]{Khmer,Other,1780,17FF,114,#1}
872
873 \newcommand{\unicodeblockKhmerSymbols}[1]{Khmer Symbols,Other,19E0,19FF,32,#1}
874
875 \newcommand{\unicodeblockLao}[1]{Lao,Other,0E80,0EFF,65,#1}
876
877 \newcommand{\unicodeblockLatinExtendedAdditional}[1]{Latin Extended Additional,Latin,1E00,1EFF,246,#1}
878
879 \newcommand{\unicodeblockLatinExtendedA}[1]{Latin Extended-A,Latin,0100,017F,128,#1}
880
881 \newcommand{\unicodeblockLatinExtendedB}[1]{Latin Extended-B,Latin,0180,024F,208,#1}
882
883 \newcommand{\unicodeblockLatinExtendedC}[1]{Latin Extended-C,Latin,2C60,2C7F,17,#1}
884
885 \newcommand{\unicodeblockLatinExtendedD}[1]{Latin Extended-D,Latin,A720,A7FF,2,#1}
886
887 \newcommand{\unicodeblockLatinSupplement}[1]{Latin-1 Supplement,Latin,0080,00FF,128,#1}
888
889 \newcommand{\unicodeblockLetterlikeSymbols}[1]{Letterlike Symbols,Symbols,2100,214F,79,#1}
890
891 \newcommand{\unicodeblockLimbu}[1]{Limbu,Other,1900,194F,66,#1}
892
893 \newcommand{\unicodeblockLinearBIdeograms}[1]{Linear B Ideograms,Other,10080,100FF,123,#1}
894
895 \newcommand{\unicodeblockLinearBSyllabary}[1]{Linear B Syllabary,Other,10000,1007F,88,#1}
896
897 \newcommand{\unicodeblockLowSurrogates}[1]{Low Surrogates,Other,DC00,DFFF,2,#1}
898
899 \newcommand{\unicodeblockMahjongTiles}[1]{Mahjong Tiles,Other,1F000,1F02F,44,#1}
900
901 \newcommand{\unicodeblockMalayalam}[1]{Malayalam,Other,0D00,0D7F,78,#1}
902
903 \newcommand{\unicodeblockMathematicalAlphanumericSymbols}[1]{Mathematical Alphanumeric Symbols,Mathematics,1D400,1D7FF,996,#1}
904
905 \newcommand{\unicodeblockMathematicalOperators}[1]{Mathematical Operators,Mathematics,2200,22FF,256,#1}
906
907 \newcommand{\unicodeblockMiscellaneousMathematicalSymbolsA}[1]{Miscellaneous Mathematical Symbols-A,Mathematics,27C0,27EF,39,#1}
908
909 \newcommand{\unicodeblockMiscellaneousMathematicalSymbolsB}[1]{Miscellaneous Mathematical Symbols-B,Mathematics,2980,29FF,128,#1}
910
911 \newcommand{\unicodeblockMiscellaneousSymbols}[1]{Miscellaneous Symbols,Symbols,2600,26FF,176,#1}
912
913 \newcommand{\unicodeblockMiscellaneousSymbolsandArrows}[1]{Miscellaneous Symbols and Arrows,Symbols,2B00,2BFF,31,#1}
914
915 \newcommand{\unicodeblockMiscellaneousTechnical}[1]{Miscellaneous Technical,Symbols,2300,23FF,232,#1}
916
917 \newcommand{\unicodeblockModifierToneLetters}[1]{Modifier Tone Letters,Other,A700,A71F,27,#1}
918
919 \newcommand{\unicodeblockMongolian}[1]{Mongolian,Other,1800,18AF,155,#1}
920
921 \newcommand{\unicodeblockMusicalSymbols}[1]{Musical Symbols,Other,1D100,1D1FF,219,#1}
922
923 \newcommand{\unicodeblockMyanmar}[1]{Myanmar,Other,1000,109F,78,#1}
924
925 \newcommand{\unicodeblockNewTaiLue}[1]{New Tai Lue,Other,1980,19DF,80,#1}
926
927 \newcommand{\unicodeblockNKo}[1]{NKo,Other,07C0,07FF,59,#1}
928
929 \newcommand{\unicodeblockNumberForms}[1]{Number Forms,Other,2150,218F,50,#1}
930
931 \newcommand{\unicodeblockOgham}[1]{Ogham,Other,1680,169F,29,#1}
932
933 \newcommand{\unicodeblockOldItalic}[1]{Old Italic,Other,10300,1032F,35,#1}
934
935 \newcommand{\unicodeblockOldPersian}[1]{Old Persian,Other,103A0,103DF,50,#1}
936
937 \newcommand{\unicodeblockOpticalCharacterRecognition}[1]{Optical Character Recognition,Other,2440,245F,11,#1}
938
939 \newcommand{\unicodeblockOriya}[1]{Oriya,Other,0B00,0B7F,81,#1}
940
941 \newcommand{\unicodeblockOsmanya}[1]{Osmanya,Other,10480,104AF,40,#1}
942
943 \newcommand{\unicodeblockPhagsPa}[1]{PhagsPa,Other,A840,A87F,56,#1}
944
945 \newcommand{\unicodeblockPhoenician}[1]{Phoenician,Other,10900,1091F,27,#1}
946
947 \newcommand{\unicodeblockPhoneticExtensions}[1]{Phonetic Extensions,Phonetics,1D00,1D7F,128,#1}
948
949 \newcommand{\unicodeblockPhoneticExtensionsSupplement}[1]{Phonetic Extensions Supplement,Phonetics,1D80,1DBF,64,#1}
950
951 \newcommand{\unicodeblockPrivateUseArea}[1]{Private Use Area,Other,E000,F8FF,2,#1}
952
953 \newcommand{\unicodeblockRunic}[1]{Runic,Other,16A0,16FF,81,#1}
954
955 \newcommand{\unicodeblockShavian}[1]{Shavian,Other,10450,1047F,48,#1}
956
957 \newcommand{\unicodeblockSinhala}[1]{Sinhala,Other,0D80,0DFF,80,#1}
958
959 \newcommand{\unicodeblockSmallFormVariants}[1]{Small Form Variants,Other,FE50,FE6F,26,#1}
960
961 \newcommand{\unicodeblockSpacingModifierLetters}[1]{Spacing Modifier Letters,Other,02B0,02FF,80,#1}
962
963 \newcommand{\unicodeblockSpecials}[1]{Specials,Other,FFF0,FFFF,5,#1}
964
965 \newcommand{\unicodeblockSuperscriptsandSubscripts}[1]{Superscripts and Subscripts,Other,2070,209F,34,#1}
966
967 \newcommand{\unicodeblockSupplementalArrowsA}[1]{Supplemental Arrows-A,Symbols,27F0,27FF,16,#1}
968
969 \newcommand{\unicodeblockSupplementalArrowsB}[1]{Supplemental Arrows-B,Symbols,2900,297F,128,#1}
970
971 \newcommand{\unicodeblockSupplementalMathematicalOperators}[1]{Supplemental Mathematical Operators,Mathematics,2A00,2AFF,256,#1}
972
973 \newcommand{\unicodeblockSupplementalPunctuation}[1]{Supplemental Punctuation,Punctuation,2E00,2E7F,26,#1}
974
975 \newcommand{\unicodeblockSupplementaryPrivateUseAreaA}[1]{Supplementary Private Use Area-A,Other,F0000,FFFFF,2,#1}
976
977 \newcommand{\unicodeblockSupplementaryPrivateUseAreaB}[1]{Supplementary Private Use Area-B,Other,100000,10FFFF,2,#1}
978
979 \newcommand{\unicodeblockSylotiNagri}[1]{Syloti Nagri,Other,A800,A82F,44,#1}
980
981 \newcommand{\unicodeblockSyriac}[1]{Syriac,Other,0700,074F,77,#1}
982
983 \newcommand{\unicodeblockTagalog}[1]{Tagalog,Other,1700,171F,20,#1}
984
985 \newcommand{\unicodeblockTagbanwa}[1]{Tagbanwa,Other,1760,177F,18,#1}
986
987 \newcommand{\unicodeblockTags}[1]{Tags,Other,E0000,E007F,97,#1}
988
989 \newcommand{\unicodeblockTaiLe}[1]{Tai Le,Other,1950,197F,35,#1}
990
991 \newcommand{\unicodeblockTaiXuanJingSymbols}[1]{Tai Xuan Jing Symbols,Other,1D300,1D35F,87,#1}
992
993 \newcommand{\unicodeblockTamil}[1]{Tamil,Other,0B80,0BFF,71,#1}
994
995 \newcommand{\unicodeblockTelugu}[1]{Telugu,Other,0C00,0C7F,80,#1}
996
997 \newcommand{\unicodeblockThaana}[1]{Thaana,Other,0780,07BF,50,#1}
998
999 \newcommand{\unicodeblockThai}[1]{Thai,Other,0E00,0E7F,87,#1}
1000
1001 \newcommand{\unicodeblockTibetan}[1]{Tibetan,Other,0F00,0FFF,195,#1}
1002
1003 \newcommand{\unicodeblockTifinagh}[1]{Tifinagh,Other,2D30,2D7F,55,#1}
1004
1005 \newcommand{\unicodeblockUgaritic}[1]{Ugaritic,Other,10380,1039F,31,#1}
1006
1007 \newcommand{\unicodeblockUnifiedCanadianAboriginalSyllabics}[1]{Unified Canadian Aboriginal Syllabics,Other,1400,167F,630,#1}
1008
1009 \newcommand{\unicodeblockVariationSelectors}[1]{Variation Selectors,Symbols,FE00,FE0F,16,#1}
1010
1011 \newcommand{\unicodeblockVariationSelectorsSupplement}[1]{Variation Selectors Supplement,Symbols,E0100,E01EF,240,#1}
1012
1013 \newcommand{\unicodeblockVerticalForms}[1]{Vertical Forms,Other,FE10,FE1F,10,#1}
1014
1015 \newcommand{\unicodeblockYiRadicals}[1]{Yi Radicals,Yi,A490,A4CF,55,#1}
1016
1017 \newcommand{\unicodeblockYiSyllables}[1]{Yi Syllables,Yi,A000,A48F,1165,#1}
1018
1019 \newcommand{\unicodeblockYijingHexagramSymbols}[1]{Yijing Hexagram Symbols,Other,4DC0,4DFF,64,#1}
1020
1021 % -------------------------------------------------------
1022 %
1023 % And finally, the macro that generates the whole zwiq
1024 %
1025 % -------------------------------------------------------
1026
1027 \newcommand{\autfontunicodedata}{
1028 % these first four blocks have been ordered for fast resolution by the perl script,
1029 % because the list of blocks is checked in order.
1030
1031 \unicodeblockBasicLatin{ \unicodeblockBasicLatinFont }
1032
1033 \unicodeblockHiragana{ \unicodeblockHiraganaFont }
1034
1035 \unicodeblockCJKUnifiedIdeographs{ \unicodeblockCJKUnifiedIdeographsFont }
1036
1037 \unicodeblockKatakana{ \unicodeblockKatakanaFont }
1038
1039 \unicodeblockAegeanNumbers{ \unicodeblockAegeanNumbersFont }
1040
1041 \unicodeblockAlphabeticPresentationForms{ \unicodeblockAlphabeticPresentationFormsFont }
1042
1043 \unicodeblockAncientGreekMusicalNotation{ \unicodeblockAncientGreekMusicalNotationFont }
1044
1045 \unicodeblockAncientGreekNumbers{ \unicodeblockAncientGreekNumbersFont }
1046
1047 \unicodeblockArabic{ \unicodeblockArabicFont }
1048
1049 \unicodeblockArabicPresentationFormsA{ \unicodeblockArabicPresentationFormsAFont }
1050
1051 \unicodeblockArabicPresentationFormsB{ \unicodeblockArabicPresentationFormsBFont }
1052
1053 \unicodeblockArabicSupplement{ \unicodeblockArabicSupplementFont }
1054
1055 \unicodeblockArmenian{ \unicodeblockArmenianFont }
1056
1057 \unicodeblockArrows{ \unicodeblockArrowsFont }
1058
1059 \unicodeblockBalinese{ \unicodeblockBalineseFont }
1060
1061 \unicodeblockBengali{ \unicodeblockBengaliFont }
1062
1063 \unicodeblockBlockElements{ \unicodeblockBlockElementsFont }
1064
1065 \unicodeblockBopomofo{ \unicodeblockBopomofoFont }
1066
1067 \unicodeblockBopomofoExtended{ \unicodeblockBopomofoExtendedFont }
1068
1069 \unicodeblockBoxDrawing{ \unicodeblockBoxDrawingFont }
1070
1071 \unicodeblockBraillePatterns{ \unicodeblockBraillePatternsFont }
1072
1073 \unicodeblockBuginese{ \unicodeblockBugineseFont }
1074
1075 \unicodeblockBuhid{ \unicodeblockBuhidFont }
1076
1077 \unicodeblockByzantineMusicalSymbols{ \unicodeblockByzantineMusicalSymbolsFont }
1078
1079 \unicodeblockCherokee{ \unicodeblockCherokeeFont }
1080
1081 \unicodeblockCJKCompatibility{ \unicodeblockCJKCompatibilityFont }
1082
1083 \unicodeblockCJKCompatibilityForms{ \unicodeblockCJKCompatibilityFormsFont }
1084
1085 \unicodeblockCJKCompatibilityIdeographs{ \unicodeblockCJKCompatibilityIdeographsFont }
1086
1087 \unicodeblockCJKCompatibilityIdeographsSupplement{ \unicodeblockCJKCompatibilityIdeographsSupplementFont }
1088
1089 \unicodeblockCJKRadicalsSupplement{ \unicodeblockCJKRadicalsSupplementFont }
1090
1091 \unicodeblockCJKStrokes{ \unicodeblockCJKStrokesFont }
1092
1093 \unicodeblockCJKSymbolsandPunctuation{ \unicodeblockCJKSymbolsandPunctuationFont }
1094
1095 \unicodeblockCJKUnifiedIdeographsExtensionA{ \unicodeblockCJKUnifiedIdeographsExtensionAFont }
1096
1097 \unicodeblockCJKUnifiedIdeographsExtensionB{ \unicodeblockCJKUnifiedIdeographsExtensionBFont }
1098
1099 \unicodeblockCombiningDiacriticalMarks{ \unicodeblockCombiningDiacriticalMarksFont }
1100
1101 \unicodeblockCombiningDiacriticalMarksforSymbols{ \unicodeblockCombiningDiacriticalMarksforSymbolsFont }
1102
1103 \unicodeblockCombiningDiacriticalMarksSupplement{ \unicodeblockCombiningDiacriticalMarksSupplementFont }
1104
1105 \unicodeblockCombiningHalfMarks{ \unicodeblockCombiningHalfMarksFont }
1106
1107 \unicodeblockControlPictures{ \unicodeblockControlPicturesFont }
1108
1109 \unicodeblockCoptic{ \unicodeblockCopticFont }
1110
1111 \unicodeblockCountingRodNumerals{ \unicodeblockCountingRodNumeralsFont }
1112
1113 \unicodeblockCuneiform{ \unicodeblockCuneiformFont }
1114
1115 \unicodeblockCuneiformNumbersandPunctuation{ \unicodeblockCuneiformNumbersandPunctuationFont }
1116
1117 \unicodeblockCurrencySymbols{ \unicodeblockCurrencySymbolsFont }
1118
1119 \unicodeblockCypriotSyllabary{ \unicodeblockCypriotSyllabaryFont }
1120
1121 \unicodeblockCyrillic{ \unicodeblockCyrillicFont }
1122
1123 \unicodeblockCyrillicExtendedA{ \unicodeblockCyrillicExtendedAFont }
1124
1125 \unicodeblockCyrillicExtendedB{ \unicodeblockCyrillicExtendedBFont }
1126
1127 \unicodeblockCyrillicSupplement{ \unicodeblockCyrillicSupplementFont }
1128
1129 \unicodeblockDeseret{ \unicodeblockDeseretFont }
1130
1131 \unicodeblockDevanagari{ \unicodeblockDevanagariFont }
1132
1133 \unicodeblockDingbats{ \unicodeblockDingbatsFont }
1134
1135 \unicodeblockDominoTiles{ \unicodeblockDominoTilesFont }
1136
1137 \unicodeblockEnclosedAlphanumerics{ \unicodeblockEnclosedAlphanumericsFont }
1138
1139 \unicodeblockEnclosedCJKLettersandMonths{ \unicodeblockEnclosedCJKLettersandMonthsFont }
1140
1141 \unicodeblockEthiopic{ \unicodeblockEthiopicFont }
1142
1143 \unicodeblockEthiopicExtended{ \unicodeblockEthiopicExtendedFont }
1144
1145 \unicodeblockEthiopicSupplement{ \unicodeblockEthiopicSupplementFont }
1146
1147 \unicodeblockGeneralPunctuation{ \unicodeblockGeneralPunctuationFont }
1148
1149 \unicodeblockGeometricShapes{ \unicodeblockGeometricShapesFont }
1150
1151 \unicodeblockGeorgian{ \unicodeblockGeorgianFont }
1152
1153 \unicodeblockGeorgianSupplement{ \unicodeblockGeorgianSupplementFont }
1154
1155 \unicodeblockGlagolitic{ \unicodeblockGlagoliticFont }
1156
1157 \unicodeblockGothic{ \unicodeblockGothicFont }
1158
1159 \unicodeblockGreekandCoptic{ \unicodeblockGreekandCopticFont }
1160
1161 \unicodeblockGreekExtended{ \unicodeblockGreekExtendedFont }
1162
1163 \unicodeblockGujarati{ \unicodeblockGujaratiFont }
1164
1165 \unicodeblockGurmukhi{ \unicodeblockGurmukhiFont }
1166
1167 \unicodeblockHalfwidthandFullwidthForms{ \unicodeblockHalfwidthandFullwidthFormsFont }
1168
1169 \unicodeblockHangulCompatibilityJamo{ \unicodeblockHangulCompatibilityJamoFont }
1170
1171 \unicodeblockHangulJamo{ \unicodeblockHangulJamoFont }
1172
1173 \unicodeblockHangulSyllables{ \unicodeblockHangulSyllablesFont }
1174
1175 \unicodeblockHanunoo{ \unicodeblockHanunooFont }
1176
1177 \unicodeblockHebrew{ \unicodeblockHebrewFont }
1178
1179 \unicodeblockHighPrivateUseSurrogates{ \unicodeblockHighPrivateUseSurrogatesFont }
1180
1181 \unicodeblockHighSurrogates{ \unicodeblockHighSurrogatesFont }
1182
1183 \unicodeblockIdeographicDescriptionCharacters{ \unicodeblockIdeographicDescriptionCharactersFont }
1184
1185 \unicodeblockIPAExtensions{ \unicodeblockIPAExtensionsFont }
1186
1187 \unicodeblockKanbun{ \unicodeblockKanbunFont }
1188
1189 \unicodeblockKangxiRadicals{ \unicodeblockKangxiRadicalsFont }
1190
1191 \unicodeblockKannada{ \unicodeblockKannadaFont }
1192
1193 \unicodeblockKatakanaPhoneticExtensions{ \unicodeblockKatakanaPhoneticExtensionsFont }
1194
1195 \unicodeblockKharoshthi{ \unicodeblockKharoshthiFont }
1196
1197 \unicodeblockKhmer{ \unicodeblockKhmerFont }
1198
1199 \unicodeblockKhmerSymbols{ \unicodeblockKhmerSymbolsFont }
1200
1201 \unicodeblockLao{ \unicodeblockLaoFont }
1202
1203 \unicodeblockLatinExtendedAdditional{ \unicodeblockLatinExtendedAdditionalFont }
1204
1205 \unicodeblockLatinExtendedA{ \unicodeblockLatinExtendedAFont }
1206
1207 \unicodeblockLatinExtendedB{ \unicodeblockLatinExtendedBFont }
1208
1209 \unicodeblockLatinExtendedC{ \unicodeblockLatinExtendedCFont }
1210
1211 \unicodeblockLatinExtendedD{ \unicodeblockLatinExtendedDFont }
1212
1213 \unicodeblockLatinSupplement{ \unicodeblockLatinSupplementFont }
1214
1215 \unicodeblockLetterlikeSymbols{ \unicodeblockLetterlikeSymbolsFont }
1216
1217 \unicodeblockLimbu{ \unicodeblockLimbuFont }
1218
1219 \unicodeblockLinearBIdeograms{ \unicodeblockLinearBIdeogramsFont }
1220
1221 \unicodeblockLinearBSyllabary{ \unicodeblockLinearBSyllabaryFont }
1222
1223 \unicodeblockLowSurrogates{ \unicodeblockLowSurrogatesFont }
1224
1225 \unicodeblockMahjongTiles{ \unicodeblockMahjongTilesFont }
1226
1227 \unicodeblockMalayalam{ \unicodeblockMalayalamFont }
1228
1229 \unicodeblockMathematicalAlphanumericSymbols{ \unicodeblockMathematicalAlphanumericSymbolsFont }
1230
1231 \unicodeblockMathematicalOperators{ \unicodeblockMathematicalOperatorsFont }
1232
1233 \unicodeblockMiscellaneousMathematicalSymbolsA{ \unicodeblockMiscellaneousMathematicalSymbolsAFont }
1234
1235 \unicodeblockMiscellaneousMathematicalSymbolsB{ \unicodeblockMiscellaneousMathematicalSymbolsBFont }
1236
1237 \unicodeblockMiscellaneousSymbols{ \unicodeblockMiscellaneousSymbolsFont }
1238
1239 \unicodeblockMiscellaneousSymbolsandArrows{ \unicodeblockMiscellaneousSymbolsandArrowsFont }
1240
1241 \unicodeblockMiscellaneousTechnical{ \unicodeblockMiscellaneousTechnicalFont }
1242
1243 \unicodeblockModifierToneLetters{ \unicodeblockModifierToneLettersFont }
1244
1245 \unicodeblockMongolian{ \unicodeblockMongolianFont }
1246
1247 \unicodeblockMusicalSymbols{ \unicodeblockMusicalSymbolsFont }
1248
1249 \unicodeblockMyanmar{ \unicodeblockMyanmarFont }
1250
1251 \unicodeblockNewTaiLue{ \unicodeblockNewTaiLueFont }
1252
1253 \unicodeblockNKo{ \unicodeblockNKoFont }
1254
1255 \unicodeblockNumberForms{ \unicodeblockNumberFormsFont }
1256
1257 \unicodeblockOgham{ \unicodeblockOghamFont }
1258
1259 \unicodeblockOldItalic{ \unicodeblockOldItalicFont }
1260
1261 \unicodeblockOldPersian{ \unicodeblockOldPersianFont }
1262
1263 \unicodeblockOpticalCharacterRecognition{ \unicodeblockOpticalCharacterRecognitionFont }
1264
1265 \unicodeblockOriya{ \unicodeblockOriyaFont }
1266
1267 \unicodeblockOsmanya{ \unicodeblockOsmanyaFont }
1268
1269 \unicodeblockPhagsPa{ \unicodeblockPhagsPaFont }
1270
1271 \unicodeblockPhoenician{ \unicodeblockPhoenicianFont }
1272
1273 \unicodeblockPhoneticExtensions{ \unicodeblockPhoneticExtensionsFont }
1274
1275 \unicodeblockPhoneticExtensionsSupplement{ \unicodeblockPhoneticExtensionsSupplementFont }
1276
1277 \unicodeblockPrivateUseArea{ \unicodeblockPrivateUseAreaFont }
1278
1279 \unicodeblockRunic{ \unicodeblockRunicFont }
1280
1281 \unicodeblockShavian{ \unicodeblockShavianFont }
1282
1283 \unicodeblockSinhala{ \unicodeblockSinhalaFont }
1284
1285 \unicodeblockSmallFormVariants{ \unicodeblockSmallFormVariantsFont }
1286
1287 \unicodeblockSpacingModifierLetters{ \unicodeblockSpacingModifierLettersFont }
1288
1289 \unicodeblockSpecials{ \unicodeblockSpecialsFont }
1290
1291 \unicodeblockSuperscriptsandSubscripts{ \unicodeblockSuperscriptsandSubscriptsFont }
1292
1293 \unicodeblockSupplementalArrowsA{ \unicodeblockSupplementalArrowsAFont }
1294
1295 \unicodeblockSupplementalArrowsB{ \unicodeblockSupplementalArrowsBFont }
1296
1297 \unicodeblockSupplementalMathematicalOperators{ \unicodeblockSupplementalMathematicalOperatorsFont }
1298
1299 \unicodeblockSupplementalPunctuation{ \unicodeblockSupplementalPunctuationFont }
1300
1301 \unicodeblockSupplementaryPrivateUseAreaA{ \unicodeblockSupplementaryPrivateUseAreaAFont }
1302
1303 \unicodeblockSupplementaryPrivateUseAreaB{ \unicodeblockSupplementaryPrivateUseAreaBFont }
1304
1305 \unicodeblockSylotiNagri{ \unicodeblockSylotiNagriFont }
1306
1307 \unicodeblockSyriac{ \unicodeblockSyriacFont }
1308
1309 \unicodeblockTagalog{ \unicodeblockTagalogFont }
1310
1311 \unicodeblockTagbanwa{ \unicodeblockTagbanwaFont }
1312
1313 \unicodeblockTags{ \unicodeblockTagsFont }
1314
1315 \unicodeblockTaiLe{ \unicodeblockTaiLeFont }
1316
1317 \unicodeblockTaiXuanJingSymbols{ \unicodeblockTaiXuanJingSymbolsFont }
1318
1319 \unicodeblockTamil{ \unicodeblockTamilFont }
1320
1321 \unicodeblockTelugu{ \unicodeblockTeluguFont }
1322
1323 \unicodeblockThaana{ \unicodeblockThaanaFont }
1324
1325 \unicodeblockThai{ \unicodeblockThaiFont }
1326
1327 \unicodeblockTibetan{ \unicodeblockTibetanFont }
1328
1329 \unicodeblockTifinagh{ \unicodeblockTifinaghFont }
1330
1331 \unicodeblockUgaritic{ \unicodeblockUgariticFont }
1332
1333 \unicodeblockUnifiedCanadianAboriginalSyllabics{ \unicodeblockUnifiedCanadianAboriginalSyllabicsFont }
1334
1335 \unicodeblockVariationSelectors{ \unicodeblockVariationSelectorsFont }
1336
1337 \unicodeblockVariationSelectorsSupplement{ \unicodeblockVariationSelectorsSupplementFont }
1338
1339 \unicodeblockVerticalForms{ \unicodeblockVerticalFormsFont }
1340
1341 \unicodeblockYiRadicals{ \unicodeblockYiRadicalsFont }
1342
1343 \unicodeblockYiSyllables{ \unicodeblockYiSyllablesFont }
1344
1345 \unicodeblockYijingHexagramSymbols{ \unicodeblockYijingHexagramSymbolsFont }
1346
1347 }
1348
1349
1350 % ----------------------------------------------------------
1351 %
1352 % After all this unicode font and data stuff, the perl
1353 % program for placing fontspec codes appropriately is
1354 % defined in a \perlautolang 'macro', which is wrapped
1355 % by the \fontwrap macro, which passes it the text it
1356 % needs to add font macros into, and the list of unicode
1357 % block data entries, with appropriate font macros loaded.
1358 %
1359 % ----------------------------------------------------------
1360
1361 %
1362 % The list of macros fontwrap is allowed to go inside of, to add font
1363 % renew this command to actually get things to happen =)
1364 %
1365
1366 \newcommand{\fontwrapallowedmacros}{}
1367 \newcommand{\setfontwrapallowedmacros}[1]{\renewcommand{\fontwrapallowedmacros}{#1}}
1368
1369 %
1370 % The list of environments fontwrap is allowed to go inside of, to add font
1371 % renew this command to actually get things to happen =)
1372 %
1373
1374 \newcommand{\fontwrapallowedenvironments}{}
1375 \newcommand{\setfontwrapallowedenvironments}[1]{\renewcommand{\fontwrapallowedenvironments}{#1}}
1376
1377
1378 %
1379 % Normally it doesn't matter that (Xe)(La)TeX strips all the whitespace when
1380 % running through a command, but in settings where it is of the utmost
1381 % importance that they are preserved, you should wrap the text in the
1382 % fontwrap equivalent of the verbatim environment: "verbatimfontwrap".
1383 %
1384
1385 \newenvironment{verbatimfontwrap}{\begingroup \obeylines \obeyspaces}{\endgroup}
1386
1387 %
1388 % a wrapper to the perl command. Feeds it both the text to wrap,
1389 % and the unicode block data, with font bindings.
1390 %
1391
1392 \newcommand{\fontwrap}[1]{
1393 \perlfontwrap{#1}{\autfontunicodedata}{\fontwrapallowedmacros}{\fontwrapallowedenvironments}
1394 }
1395
1396 %
1397 % the language detection/font insertion command
1398 %
1399
1400 \perlnewcommand{\perlfontwrap}[4]{
1401
1402 # the input text
1403 $text = $_[0];
1404
1405 # all the unicode data
1406 $blockdata = &trim($_[1]);
1407
1408 # the list of macros we're allowed to process the content of
1409 @args = split(/,/,&trim($_[2]));
1410 foreach $am (@args) { $allowedmacros{$am}='1'; }
1411
1412 # the list of environments we're allowed to process the content of
1413 @args = split(/,/,&trim($_[3]));
1414 foreach $am (@args) { $allowedenvironments{$am}='1'; }
1415
1416 # clear
1417 @args=();
1418
1419 # Also, I know these two look silly. Without them, checks on $swapped break...
1420 $true=1;
1421 $false=0;
1422
1423 # ------------------------------------------------
1424 # Create the unicode block data array-of-arrays.
1425 # This is essentially an array with on each position
1426 # a list representing a unicode block. The data is
1427 # is organised as:
1428 #
1429 # [0] - block name
1430 # [1] - informal group name
1431 # [2] - first codepoint in the block (in hex)
1432 # [3] - last codepoint in the block (in hex)
1433 # [4] - number of glyphs in the block
1434 # [5] - font bound to this block
1435 #
1436 # mostly for my personal ease of code-use, these
1437 # indices are never used numerically, instead I
1438 # will use indicatively named variables.
1439 # -----------------------------------------------
1440
1441 $idx_blockname=0;
1442 $idx_groupname=1;
1443 $idx_start=2;
1444 $idx_end=3;
1445 $idx_glyphs=4;
1446 $idx_font=5;
1447
1448 $unicodeblockcount=0;
1449 @lines = split(/\\par /,$blockdata);
1450 for $i (0 .. @lines) {
1451 $line = &trim($lines[$i]);
1452 # skip any comments
1453 if(substr($line,0,1) eq chr(35) || $line eq '') { next; }
1454 else {
1455 ($blockname,$groupname,$start,$end,$glyphs,$font) = split(/,/,$line);
1456 $unicodeblocks[$unicodeblockcount++] = [$blockname,$groupname,$start,$end,$glyphs,(&trim($font) ne '')?&trim($font):'fontwrapdefaultfont'];
1457 }
1458 }
1459
1460
1461 # ----------------------------------------------------------------------
1462 #
1463 # Miscellaneous subroutines
1464 #
1465 # ----------------------------------------------------------------------
1466
1467
1468 #
1469 # very simple trim function
1470 #
1471 sub trim {
1472 my $string = shift;
1473 $string =~ s/^\s+//;
1474 $string =~ s/\s+$//;
1475 return $string }
1476
1477
1478 #
1479 # checks if the passed byte indicates the start of a new unicode glyph
1480 #
1481 sub isnewglyph {
1482 $byte = shift;
1483 # in utf8 context, anything that isn't 10xxxxxxx is a new byte
1484 return (ord($byte)<128 || ord($byte)>191); }
1485
1486
1487 #
1488 # detemines the hexadecimal location of the passed glyph
1489 # in the unicode 5.0 space
1490 #
1491 sub codepoint {
1492 @utf_lead_bytes = (0,0,192,224,240,248,252);
1493 @utf_first_byte = (0,7,5,4,3,2,1);
1494 @utf_total_bits = (0,7,11,16,21,26,31);
1495 @bytes=split(//,shift);
1496 $blength = @bytes;
1497
1498 # if we're dealing with a single byte, its ordinal value can be obtained by calling ord() directly
1499 if($blength==1) { $ordinal = ord($bytes[0]); }
1500
1501 # ----------------------------------------------------------------------------
1502 #
1503 # UTF8 byte layout:
1504 #
1505 # U-00000000 ... U-0000007F = 0xxxxxxx
1506 # U-00000080 ... U-000007FF = 110xxxxx 10xxxxxx
1507 # U-00000800 ... U-0000FFFF = 1110xxxx 10xxxxxx 10xxxxxx
1508 # U-00010000 ... U-001FFFFF = 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
1509 # U-00200000 ... U-03FFFFFF = 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
1510 # U-04000000 ... U-7FFFFFFF = 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
1511 #
1512 # After 2,147,483,648 characters, we run out of UTF8 places... then again, even if there
1513 # are languages with tens of thousands of characters (42 thousand for the unified CJK
1514 # block extended B, for instance), it's really hard to fill 2 billion glyphs. Even
1515 # if all currently used languages had 100,000 letters, that would only use up a little
1516 # over a quarter of all UTF8 spots available... and most languages have less than 250
1517 # characters.
1518 #
1519 # ----------------------------------------------------------------------------
1520
1521 # if there are more bytes, we need to play by the UTF8 rules
1522 else
1523 {
1524 # handle first byte
1525 $bpos = 0;
1526 $baseval = ord($bytes[0]) - $utf_lead_bytes[$blength]; # remove the first byte mask (see list above)
1527 $basepower = 2**(6*($blength-1)); # this number starts at bit 1+6*(bytes-1), because bytes 2-> are 6 bits
1528 $ordinal = $baseval * $basepower; # fairly obvious calculation
1529
1530 # handle further bytes
1531 for($bpos=1;$bpos<$blength;$bpos++) {
1532 $baseval = ord($bytes[$bpos]) - 128; # remove the 10xxxxxx mask that 'followup' utf8 bytes have
1533 $basepower = 2**(6*($blength-($bpos+1))); # this number starts at bit 1+6*((bytes-currentpos)-1)
1534 $ordinal += $baseval * $basepower; } # again, fairly obvious calculation
1535 }
1536
1537 # return uppercase hex representation
1538 $hexval = sprintf("%x",$ordinal);
1539 if(length($hexval)%2!=0) { $hexval = "0".$hexval; } # add a leading zero (purely cosmetic)
1540 return uc($hexval); # return in uppercase (again, purely cosmetic)
1541 }
1542
1543
1544 #
1545 # appends the output string with the passed string.
1546 #
1547 sub appendoutput
1548 {
1549 $string=shift;
1550 $rewritten .= $string;
1551 }
1552
1553
1554 # ----------------------------------------------------------------------
1555 #
1556 # Font changing subroutine
1557 #
1558 # ----------------------------------------------------------------------
1559
1560
1561 sub attemptfontchange
1562 {
1563 $glyphblock{'blockname'} = 'unknown...';
1564 $cp = &codepoint($glyph);
1565
1566 # check which unicode block this character is in
1567 for($pos=0;$pos<$unicodeblockcount;$pos++) {
1568 # add '0' padding to the codepoint if necessary
1569 $ncp = ("0" x (length($unicodeblocks[$pos][$idx_start]) - length($cp))) . $cp;
1570 $higher = $ncp cmp $unicodeblocks[$pos][$idx_start];
1571 $lower = $ncp cmp $unicodeblocks[$pos][$idx_end];
1572 # if within range, we found the right unicode block
1573 if($higher>=0 && $lower <=0) {
1574 $glyphblock = $unicodeblocks[$pos][$idx_blockname];
1575 $glyphfont = $unicodeblocks[$pos][$idx_font];
1576 last; }}
1577
1578 # if this differs from what we were already in, add a fontchange code if we need to, and set currentblock to the new block
1579 if($glyphblock ne $currentblock) {
1580 if($currentfont ne $glyphfont) {
1581 &appendoutput("\\fontspec{".$glyphfont."}");
1582 $currentfont=$glyphfont;
1583 $swapped=$true; }
1584 $currentblock=$glyphblock; }
1585
1586 # if we swapped fonts, and the next glyph was a space, escape it for good measure.
1587 if($swapped==1 && $glyph eq ' ') { &appendoutput("\\"); }
1588 $swapped=$false;
1589 }
1590
1591
1592
1593 # ----------------------------------------------------------------------
1594 #
1595 # Macro parsing support subroutines
1596 #
1597 # ----------------------------------------------------------------------
1598
1599
1600 #
1601 # runs through the text array, extracting the macro's command.
1602 # In case this was an argumented macro, the text pointer $i is
1603 # moved to the first non-whitespace character after the macro
1604 # name. If it was an argumentless macro, the pointer is set to
1605 # directly after the macro name.
1606 #
1607 sub getmacrocommand {
1608 for($i=$i+1;$i<@textarray;$i++) {
1609 $glyph = $textarray[$i];
1610 if($glyph ne chr(123) && &trim($glyph) ne '') {
1611 undef $textarray[$i];
1612 $macro .= $glyph; }
1613 else {
1614 # if glyph was whitespace, check if there is an argument list to come, or not.
1615 if($glyph ne chr(123)) {
1616 for($j=1;$j<@textarray;$j++) {
1617 # non-whitespace: we need to stop. but do we need to discard the crossed whitespace?
1618 if(&trim($textarray[$i+$j]) ne '') {
1619 # if we found an argument list, we do. otherwise, we don't have to.
1620 if($textarray[$i+$j] eq chr(123)) { $i=$i+$j; }
1621 last; }}
1622 }
1623 $i--;
1624 return $macro; }}
1625 }
1626
1627 #
1628 # simply copies from the textarray to the rewritten string until we run out of macrobody.
1629 #
1630 sub copymacrotooutput
1631 {
1632 $depth=0;
1633 for(;$i<@textarray;$i++) {
1634 $glyph = $textarray[$i];
1635 $textarray[$i]='';
1636 if($depth==0 && &trim($glyph) eq '') { next; }
1637 # { increments $depth, } decrements it.
1638 if($glyph eq chr(123)) { $depth++;}
1639 elsif($glyph eq chr(125)) { $depth--; }
1640 $macrobody .= $glyph;
1641 if($depth==0 && $glyph ne chr(123)) {
1642 &appendoutput($macrobody);
1643 $macrobody = '';
1644 if(&hasarguments) {
1645 # recurse, for as many arguments as there are...
1646 &copymacrotooutput(); }
1647 $i--;
1648 last; }}
1649 }
1650
1651
1652
1653 #
1654 # check whether a macro has arguments or not
1655 #
1656 sub hasarguments {
1657 $j=$i;
1658 for(;$j<@textarray;$j++) {
1659 $check = $textarray[$j];
1660 if(&trim($check) ne '') {
1661 return ($check eq chr(123)); }}}
1662
1663
1664 # ----------------------------------------------------------------------
1665 #
1666 # Environment parsing support subroutines
1667 #
1668 # ----------------------------------------------------------------------
1669
1670
1671 #
1672 # runs through the text array, extracting the environments's name
1673 # when this is done, $i will point to the glyph *after* the closing
1674 # brace:
1675 #
1676 # \begin{environmentname} Whatever text
1677 # L
1678 # $i
1679 #
1680 sub getenvironment {
1681 for($i=$i+1;$i<@textarray;$i++) {
1682 $glyph = $textarray[$i];
1683
1684 # ignore opening brace and possible whitespace
1685 if($glyph eq chr(123) || &trim($glyph) eq '') { next; }
1686
1687 # something that's part of environment name
1688 elsif($glyph ne chr(123) && $glyph ne chr(125) && &trim($glyph) ne '') {
1689 $textarray[$i]='';
1690 $environment .= $glyph; }
1691
1692 # because of the way environments are defined, this has to now
1693 # be a closing brace... unless you messed up your TeX.
1694 else {
1695 if($glyph ne chr(125)) { die "You messed up your TeX - environment name \"".$environment."\" not followed by '".chr(125)."' but by '".$glyph."'!"; }
1696 $i=$i+1;
1697 return $environment; }}
1698 }
1699
1700 #
1701 # copies from the textarray to the rewritten string until we hit \end{environment}
1702 #
1703 sub copyenvironmenttooutput
1704 {
1705 $environment=shift;
1706 $environmentbody='';
1707 for(;$i<@textarray;$i++) {
1708 $glyph = $textarray[$i];
1709 $textarray[$i]='';
1710 if($glyph eq chr(92)) {
1711 $check='';
1712 for $j (1..3) { $check .= $textarray[$i+$j]; }
1713 if($check eq 'end') {
1714 # make sure this is the end tag for the right environment!
1715 $checkenv='';
1716 $spaces=0;
1717 # $i+1..3 was 'end', so the next read spot is at $i+4
1718 for($j=4;$j<@textarray;$j++) {
1719 if(&trim($textarray[$i+$j]) eq '') { $spaces++; }
1720 else { last; }}
1721
1722 $start = 4+$spaces+1;
1723 $end = $start + length($environment)-1;
1724 for $j ($start .. $end) { $checkenv .= $textarray[$i+$j]; }
1725 if($checkenv eq $environment) {
1726 &appendoutput($environmentbody . "\\end{".$environment."}");
1727 $i = $i + length("end{".$environment."}")+1;
1728 $environmentbody='';
1729 return; }
1730
1731 # "end" macro, just not the right one. append glyph to environment body
1732 else { $environmentbody .= $glyph; }}
1733 # some marco that isn't "end": append glyph to body
1734 else { $environmentbody .= $glyph; }}
1735 # regular glyph... you guessed it: append
1736 else { $environmentbody .= $glyph; }}
1737 }
1738
1739
1740
1741 # ----------------------------------------------------------------------
1742 #
1743 # Macro parsing subroutine
1744 #
1745 # ----------------------------------------------------------------------
1746
1747
1748 #
1749 # processes a LaTeX macro
1750 #
1751 sub processmacro
1752 {
1753 $macro = &getmacrocommand();
1754 # rather special macro
1755 if($macro eq 'begin') {
1756 $macro='';
1757 # find out which environment is being entered, whether we may work inside it
1758 $environment = &getenvironment();
1759 &appendoutput("\\begin{" . $environment . "}");
1760 if($allowedenvironments{$environment} ne '') {
1761 # allowed to process, which means we don't need to pay any special
1762 # attention to end{environment} commands, as they'll be processed like
1763 # any other macro (though you should not put them in the allowedmacro
1764 # list, obviously :)
1765 $environment='';
1766 return; }
1767 else {
1768 # not allowed to process environment. copy until we hit "\end{environment}"
1769 &copyenvironmenttooutput($environment);
1770 $environment=''; }
1771 return; }
1772 else {
1773 &appendoutput("\\" . $macro);
1774 if($allowedmacros{$macro} ne '') {
1775 # if we're allowed to work inside it, return so that the
1776 # processing of glyphs continues as normal
1777 $macro='';
1778 return; }
1779 else {
1780 $macro='';
1781 # not allowed to do anything with this content - write out any arguments if it has
1782 # them and stop processing, returning to the toplevel processglyph subroutine
1783 if(&hasarguments) { &copymacrotooutput(); }}}
1784 }
1785
1786
1787 # ----------------------------------------------------------------------
1788 #
1789 # Glyph parsing subroutines
1790 #
1791 # ----------------------------------------------------------------------
1792
1793 #
1794 # processes one glyph
1795 #
1796 sub processglyph
1797 {
1798 # get the current glyph
1799 $glyph = $textarray[$i];
1800 $textarray[$i]=''; # maintainance. progressively clears up a bit of mem
1801 if($glyph eq '') { return; } # shortcut for the first, empty, split character in the array
1802
1803 # if we find a '\', we process the text as macro.
1804 if($glyph eq chr(92)) {
1805 &processmacro();
1806 # after we process a macro, it will have already been inserted into the $rewritten string, so we just return.
1807 return; }
1808
1809 else {
1810 # check if the font needs changing
1811 &attemptfontchange();
1812 # finally, add the glyph to the $rewritten string
1813 &appendoutput($glyph); }
1814 }
1815
1816
1817 # ----------------------------------------------------------------------
1818 # start running through the passed text.
1819 # ----------------------------------------------------------------------
1820
1821
1822 #
1823 # first off, convert the passed text into an array of unicode glyphs, so
1824 # we can iterate over it letter by letter.
1825 #
1826
1827 @bytes = split(//,$text);
1828 $text = ""; # maintenance. Saves a bit of memory.
1829 $buffer="";
1830 @textarray=();
1831 foreach $byte (@bytes) {
1832 if(&isnewglyph($byte)) {
1833 push @textarray, $buffer;
1834 $buffer=$byte; }
1835 else { $buffer.=$byte; }}
1836 push @textarray, $buffer;
1837 @bytes=();
1838
1839 #
1840 # At this point the text has been pulled apart as unicode glyphs, rather than just bytes, which means we can start walking through the array.
1841 #
1842
1843 $rewritten='';
1844 $currentblock='not set yet';
1845 $currentfont='not set yet';
1846
1847 # set the processing in motion (because all variables are persistent,
1848 # this script runs through the text a like a finite state machine)
1849 $i=0;
1850 for(;$i<@textarray; $i++) { &processglyph(); }
1851
1852 #
1853 # perltex uses persistent variables, but in some cases frees the wrong threadpool's memory.
1854 # as such, emptying the variables before exit is not a bad good idea, although normally
1855 # you wouldn't bother with it this close to the return statement.
1856 #
1857
1858 undef $text;
1859 undef @textarray;
1860 undef $blockdata;
1861 undef @args;
1862 undef %allowedmacros;
1863 undef %allowedenvironments;
1864 undef $glyph;
1865 undef $currentblock;
1866 undef $currentfont;
1867 undef $glyphblock;
1868 undef $glyphfont;
1869 undef $macro;
1870 undef $macrobody;
1871 undef $cp;
1872
1873 # return the now font-tagged text
1874 return $rewritten;
1875 }
1876
1877 % ----------------------------------------------------------------------------
1878 \endinput
1879 %
1880 % End of file `langfont.sty'.