summaryrefslogtreecommitdiff
path: root/fonts/kpfonts-otf/tex/kpfonts-otf.sty
blob: 14596278ffdcad6ca722f24ceb889a163746a2a2 (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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
\NeedsTeXFormat{LaTeX2e}[2019-01-01]
\def\fileversion{0.44}
\def\filedate{2022-09-28}
\ProvidesPackage{kpfonts-otf}[\filedate\space\fileversion]

% Ensure luatex or xetex engine
\RequirePackage{iftex}[2019-10-24]
\RequireTUTeX
%
\newif\ifkp@math	\kp@mathtrue
\newif\ifkp@text  	\kp@texttrue
\newif\ifkp@sf      \kp@sftrue
\newif\ifkp@tt      \kp@tttrue
%
\newif\ifkp@lighttext
\newif\ifkp@largesmallcaps
\newif\ifkp@altfligs
\newif\ifkp@eurosym
\newif\ifkp@germandbls
\newif\ifkp@harfbuzz
\newif\ifkp@osn
\newif\ifkp@os
\newif\ifkp@vos
\newif\ifkp@longs
\newif\ifkp@Qtail
%
\newif\ifkp@lightmath
\newif\ifkp@osnm
\newif\ifkp@narrowiints
\newif\ifkp@partialup
\newif\ifkp@Dcommand    \kp@Dcommandtrue
\newif\ifkp@sfmathbb
\newif\ifkp@frenchstyle
\newif\ifkp@calasscr
\newif\ifkp@oldReIm
\newif\ifkp@symbols     \kp@symbolstrue
\newif\ifkp@tight
%
% Global options
\DeclareOption{light}            {\kp@lighttexttrue\kp@lightmathtrue}
\DeclareOption{nomath}           {\kp@mathfalse\kp@symbolsfalse}
\DeclareOption{notext}           {\kp@textfalse}
\DeclareOption{nosf}             {\kp@sffalse}
\DeclareOption{nott}             {\kp@ttfalse}
\DeclareOption{onlyrm}           {\kp@ttfalse\kp@sffalse}
\DeclareOption{fulloldstylenums} {\kp@osntrue\kp@osnmtrue}
\DeclareOption{fulloldstyle}     {\kp@ostrue\kp@Qtailtrue\kp@osntrue
                                  \kp@osnmtrue}
% Text options
\DeclareOption{lighttext}        {\kp@lighttexttrue}
\DeclareOption{oldstylenums}     {\kp@osntrue}
\DeclareOption{oldstyle}         {\kp@ostrue\kp@osntrue\kp@Qtailtrue}
\DeclareOption{longs}            {\kp@longstrue}
\DeclareOption{veryoldstyle}     {\kp@vostrue\kp@osntrue\kp@Qtailtrue
                                  \ifluatex\kp@longstrue\fi}
\DeclareOption{largesmallcaps}   {\kp@largesmallcapstrue}
\DeclareOption{altfligs}         {\kp@altfligstrue}
\DeclareOption{germandbls}       {\kp@germandblstrue}
\DeclareOption{eurosym}          {\kp@eurosymtrue}
\DeclareOption{harfbuzz}         {\kp@harfbuzztrue}
% Math options
\DeclareOption{lightmath}        {\kp@lightmathtrue}
\DeclareOption{bbsans}           {\kp@sfmathbbtrue}
\DeclareOption{mathcal}          {\kp@calasscrtrue}
\DeclareOption{narrowiints}      {\kp@narrowiintstrue}
\DeclareOption{frenchstyle}      {\kp@frenchstyletrue}
\DeclareOption{partialup}        {\kp@partialuptrue}
\DeclareOption{oldstylenumsmath} {\kp@osnmtrue}
\DeclareOption{fancyReIm}        {\kp@oldReImtrue}
\DeclareOption{noDcommand}       {\kp@Dcommandfalse}
\DeclareOption{tight}            {\kp@tighttrue}
\DeclareOption{symbols}          {\kp@textfalse\kp@sffalse\kp@ttfalse
                                  \kp@mathfalse}
\ProcessOptions

% Concatenation of Math options.
\newtoks\KpMtoks
\newcommand*{\Store@KP@MOption}[2]{%
  \KpMtoks=\expandafter{\the\KpMtoks #1={#2},}}

% Text fonts setup...
\ifkp@text
  \RequirePackage{fontspec}[2019/01/01]
  \RequirePackage{realscripts}
  % Two candidates for \rmfamily:
  \newfontfamily\KpRoman{KpRoman}
  \newfontfamily\KpLight{KpLight}
  % Euro symbol
  \newcommand*{\kp@euro}{\ifkp@eurosym\char"E990 \else\char"20AC \fi}
  \newcommand*{\kpeuro}[1][]{\def\@tmp{#1}%
    \ifx\@tmp\@empty \kp@euro \else #1~\kp@euro\fi
  }
  % Option harfbuzz is needed with HBLuaTeX to typeset some composed chars
  % not ready-made in the KPfonts (f.i. ċṅṁ, ạẹịụọṃ,…).
  \ifluahbtex\ifkp@harfbuzz\defaultfontfeatures+{Renderer=HarfBuzz}\fi\fi
  % TS1 accent in Private Area
  \DeclareUnicodeAccent{\newtie}{TU}{"E9F0}
  % Accents not in tuenc.def
  \DeclareUnicodeAccent{\candra}    \UnicodeEncodingName{"0310}
  \DeclareUnicodeAccent{\ringbelow} \UnicodeEncodingName{"0325}
  % Oldstylenums
  \ifkp@osn
    \ifkp@tt
      \defaultfontfeatures+[\ttfamily]{Numbers=Lowercase}
    \fi
    \defaultfontfeatures+[KpRoman,KpLight,\sffamily]{Numbers=Lowercase}
  \fi
  %% Oldstyle
  \ifkp@os
    \ifkp@tt
      \defaultfontfeatures+[\ttfamily]{Style=Swash}
    \fi
    \defaultfontfeatures+[KpRoman,KpLight,\sffamily]{Style=Swash,Ligatures=Rare}
  \fi
  %% Veryoldstyle
  \ifkp@vos
    \ifkp@tt
      \defaultfontfeatures+[\ttfamily]{Style=Historic, Contextuals=Alternate}
    \fi
    \defaultfontfeatures+[KpRoman,KpLight,\sffamily]{%
            Style=Historic,Ligatures=Historic,Contextuals=Alternate}
  \fi
  %% No Long s before spaces with luatex
  \ifkp@longs
    \ifluatex
      % This function adds character U+200B (zero width space) when an "s"
      % is followed by a TeX space (glue or penalty) so that it is not turned
      % into a long "s" by the "calt" feature.
      \directlua{%
        function add_eow_char (head)
          local eow = 0x200B
          local GLUE = node.id("glue")
          local GLYPH = node.id("glyph")
          local SPSKIP = 13
          local PENALTY = node.id("penalty")
          local Longs =
            {[string.byte("s")] = true}
          local new_node  = node.new
          local copy_node = node.copy
          local insert_node_after = node.insert_after
          % Perserve TeX's kerning
          head = node.kerning(head)
          % wordbd is the zero width node to add
          local wordbd = new_node(GLYPH)
          for item in node.traverse_id(GLYPH, head) do
              if Longs[item.char] then
                 local fid = item.font
                 % Check if char U+200B is available in the current font:
                 % code borrowed from file "luaotfload-auxiliary.lua".
                 local fontdata = fonts.hashes.identifiers[fid]
                 if fontdata and fontdata.characters[eow] then
                    nxt = item.next
                    if not nxt or (nxt.id == GLUE and nxt.subtype == SPSKIP)
                               or  nxt.id == PENALTY  then
                       wordbd.font = fid
                       wordbd.char = eow
                       wordbd.attr = item.attr
                       insert_node_after(head,item,copy_node(wordbd))
                    end
                 end
              end
          end
        end
      }
      % Register *after* loading babel-french!
      \AtBeginDocument{%
        \directlua{
          luatexbase.add_to_callback("kerning", add_eow_char,
                                     "add_end_of_word_boundary");
        }
      }
    \else
      \PackageWarning{kpfonts-otf}%
        {Option "longs" skipped (luatex only), reported}
    \fi
  \fi
  % Smallcaps
  \ifkp@largesmallcaps
    \defaultfontfeatures+[KpRoman,KpLight,\sffamily]{%
            SmallCapsFeatures = {Letters=SmallCaps}}
  \else
    \defaultfontfeatures+[KpRoman,KpLight,\sffamily]{%
            SmallCapsFeatures = {Letters=PetiteCaps}}
  \fi
  % Altfligs
  \ifkp@altfligs
    \defaultfontfeatures+[KpRoman,KpLight,\sffamily]{StylisticSet=1}
  \fi
  % Germandbls
  \ifkp@germandbls
    \defaultfontfeatures+[KpRoman,KpLight,\sffamily]{StylisticSet=2}
  \fi
  % Euro symbol
  \ifkp@eurosym
    \ifkp@tt
      \defaultfontfeatures+[\ttfamily]{StylisticSet=3}
    \fi
    \defaultfontfeatures+[KpRoman,KpLight,\sffamily]{StylisticSet=3}
  \fi
  % Loading Text Serif fonts:
  \ifkp@lighttext
    \setmainfont{KpLight}
    \renewfontfamily\KpLight{KpLight}
    \renewfontfamily\KpRoman{KpRoman}
    \newcommand*{\sbseries}{\KpRoman}
    \newcommand*{\ebseries}{\KpRoman\bfseries}
    \DeclareTextFontCommand{\textsb}{\sbseries}
    \DeclareTextFontCommand{\texteb}{\ebseries}
  \else
    \setmainfont{KpRoman}
    \renewfontfamily\KpRoman{KpRoman}
    \renewfontfamily\KpLight{KpLight}
    \newcommand*{\sbseries}{\KpLight\bfseries}
    \newcommand*{\ltseries}{\KpLight}
    \DeclareTextFontCommand{\textsb}{\sbseries}
    \DeclareTextFontCommand{\textlt}{\ltseries}
  \fi
  % Loading Text Sans Serif fonts:
  \ifkp@sf
    \setsansfont{KpSans}
  \fi
  % Loading Text Typewriter fonts:
  \ifkp@tt
    \setmonofont{KpMono}
  \fi
  % Large/Petite smallcaps
  \DeclareRobustCommand\lscshape{\addfontfeatures{RawFeature=+smcp}}
  \DeclareRobustCommand\pscshape{\addfontfeatures{RawFeature=+pcap}}
  \DeclareRobustCommand\textlsc[1]{{\lscshape #1}}
  \DeclareRobustCommand\textpsc[1]{{\pscshape #1}}
\fi

\ifkp@symbols  % true unless "nomath"
  \RequirePackage{unicode-math}[2019/01/01]
  % \D close integral
  \ifkp@Dcommand
    \newcommand*{\D}[1]{\mathclose{\,\symup{d}}#1}%
  \fi
\fi

% Loading Math fonts...
\newcommand*{\KP@mathcal@Warning}{%
  \PackageWarning{kpfonts-otf}{Option mathcal is no longer needed:\MessageBreak
    just use \protect\mathcal{} for "calligraphic" \MessageBreak
    and \protect\mathscr{} for "script" capitals;\MessageBreak reported
  }%
}
\ifkp@math
  \ifkp@tight
    \thinmuskip=2mu
    \medmuskip=2.5mu plus 1mu minus 2.5mu
    \thickmuskip=3.5mu plus 2.5mu
  \fi
  \ifkp@calasscr
    \KP@mathcal@Warning
  \fi
  \ifkp@sfmathbb
    \Store@KP@MOption{RawFeature}{+ss02}
  \fi
  \ifkp@narrowiints
    \Store@KP@MOption{RawFeature}{+ss03}
  \fi
  \ifkp@osnm
    \Store@KP@MOption{Numbers}{Lowercase}
  \fi
  \ifkp@oldReIm
    \Store@KP@MOption{RawFeature}{+cv00}
  \fi
  \ifkp@frenchstyle
    \Store@KP@MOption{math-style}{french}
  \fi
  \ifkp@partialup
    \Store@KP@MOption{partial}{upright}
  \fi
  \ifkp@lightmath
    % Following Joseph Wright in https://tex.stackexchange.com/questions/451
    \begingroup
      \edef\temp{%
        \endgroup
        \noexpand\setmathfont{KpMath-Light.otf}%
        [\unexpanded\expandafter{\the\KpMtoks}]%
      }
      \temp
    \setmathfont[range={cal,bfcal},RawFeature=+ss01]{KpMath-Light.otf}
  \else
    % Following Joseph Wright in https://tex.stackexchange.com/questions/451
    \begingroup
      \edef\temp{%
        \endgroup
        \noexpand\setmathfont{KpMath-Regular.otf}%
        [\unexpanded\expandafter{\the\KpMtoks}]%
      }
      \temp
    \setmathfont[range={cal,bfcal},RawFeature=+ss01]{KpMath-Regular.otf}
  \fi
\fi

\ifkp@symbols
  % Style aliases (math only)
  \newopentypefeature{Style}{mathcal}{ss01}
  \newopentypefeature{Style}{bbsans}{ss02}
  \newopentypefeature{Style}{narrowiints}{ss03}
  \newopentypefeature{Style}{leqslant}{ss04}
  \newopentypefeature{Style}{smaller}{ss05}
  \newopentypefeature{Style}{subsetneq}{ss06}
  \newopentypefeature{Style}{parallelslant}{ss07}
  \AtBeginDocument{%
    % Kpfonts specific math symbols
    \Umathchardef\mitsanswp =            0 0 "E015 \relax
    \Umathchardef\mitsansell =           0 0 "E019 \relax
    \Umathchardef\varemptyset =          0 0 "E021 \relax
    \Umathchardef\lambdaslash =          0 0 "E029 \relax
    \Umathchardef\lambdabar =            0 0 "019B \relax
    \Umathchardef\mbfvec =               0 0 "E044 \relax
    \Umathchardef\mbfwp =                0 0 "E045 \relax
    \Umathchardef\mbfdotlessi =          0 0 "E046 \relax
    \Umathchardef\mbfdotlessj =          0 0 "E047 \relax
    \Umathchardef\mbfell =               0 0 "E049 \relax
    \Umathchardef\mbfimath =             0 0 "E066 \relax
    \Umathchardef\mbfjmath =             0 0 "E067 \relax
    \Umathchardef\mbhbar =               0 0 "E068 \relax
    \Umathchardef\mbhslash =             0 0 "E06F \relax
    \Umathchardef\mithbar =              0 0 "E078 \relax
    \Umathchardef\parallelbackslant =    3 0 "E080 \relax
    \Umathchardef\nparallelbackslant =   3 0 "E081 \relax
    \Umathchardef\parallelslant  =       3 0 "E090 \relax
    \Umathchardef\nparallelslant =       3 0 "E091 \relax
    \Umathchardef\nsubseteqq =           3 0 "E0AE \relax
    \Umathchardef\nsupseteqq =           3 0 "E0AF \relax
    \Umathchardef\@idotsint =            1 0 "E111 \relax
    \Umathchardef\Mmapsfrom =            0 0 "E400 \relax
    \Umathchardef\Mmapsto =              0 0 "E401 \relax
    \Umathchardef\mmapsfrom =            0 0 "E402 \relax
    \Umathchardef\mmapsto =              0 0 "E403 \relax
    \Umathchardef\Longmmapsfrom =        0 0 "E404 \relax
    \Umathchardef\Longmmapsto =          0 0 "E405 \relax
    \Umathchardef\longmmapsfrom =        0 0 "E406 \relax
    \Umathchardef\longmmapsto =          0 0 "E407 \relax
    \Umathchardef\leftrightdasharrow =   0 0 "E408 \relax
    \Umathchardef\leadsto =              0 0 "E409 \relax
    \Umathchardef\leadstoext =           0 0 "E40A \relax
    \Umathchardef\longleadsto =          0 0 "E40B \relax
    \Umathchardef\colonapprox =          0 0 "E410 \relax
    \Umathchardef\colonsim =             0 0 "E411 \relax
    \Umathchardef\Colonapprox =          0 0 "E412 \relax
    \Umathchardef\Colonsim =             0 0 "E413 \relax
    \Umathchardef\colondash =            0 0 "E414 \relax
    \Umathchardef\eqqColon =             0 0 "E415 \relax
    \Umathchardef\Colondash =            0 0 "E416 \relax
    \Umathchardef\dashColon =            0 0 "E417 \relax
    \Umathchardef\strictif =             0 0 "E418 \relax
    \Umathchardef\strictfi =             0 0 "E419 \relax
    \Umathchardef\strictiff =            0 0 "E41A \relax
    \Umathchardef\circledwedge =         0 0 "E41B \relax
    \Umathchardef\circledvee =           0 0 "E41C \relax
    \Umathchardef\circledbar =           0 0 "E41D \relax
    \Umathchardef\multimapdot =          0 0 "E420 \relax
    \Umathchardef\multimapdotinv =       0 0 "E421 \relax
    \Umathchardef\multimapdotboth =      0 0 "E422 \relax
    \Umathchardef\multimapbothvert =     0 0 "E423 \relax
    \Umathchardef\multimapdotbothvert =  0 0 "E424 \relax
    \Umathchardef\multimapdotbothAvert = 0 0 "E425 \relax
    \Umathchardef\multimapdotbothBvert = 0 0 "E426 \relax
    \Umathchardef\Wr =                   0 0 "E427 \relax
    \Umathchardef\boxbar =               0 0 "E428 \relax
    \Umathchardef\opentimes =            0 0 "E429 \relax
    \Umathchardef\openJoin =             0 0 "E42A \relax
    \Umathchardef\VvDash =               0 0 "E42B \relax
    \Umathchardef\Diamondright =         0 0 "E430 \relax
    \Umathchardef\Diamondleft =          0 0 "E431 \relax
    \Umathchardef\Diamonddotright =      0 0 "E432 \relax
    \Umathchardef\Diamonddotleft =       0 0 "E433 \relax
    \Umathchardef\boxright =             0 0 "E434 \relax
    \Umathchardef\boxleft =              0 0 "E435 \relax
    \Umathchardef\boxdotright =          0 0 "E436 \relax
    \Umathchardef\boxdotleft =           0 0 "E437 \relax
    \Umathchardef\DiamondRight =         0 0 "E438 \relax
    \Umathchardef\DiamondLeft =          0 0 "E439 \relax
    \Umathchardef\DiamonddotRight =      0 0 "E43A \relax
    \Umathchardef\DiamonddotLeft =       0 0 "E43B \relax
    \Umathchardef\boxRight  =            0 0 "E43C \relax
    \Umathchardef\boxLeft =              0 0 "E43D \relax
    \Umathchardef\boxdotRight =          0 0 "E43E \relax
    \Umathchardef\boxdotLeft =           0 0 "E43F \relax
    \Umathchardef\circleright =          0 0 "E440 \relax
    \Umathchardef\circleleft =           0 0 "E441 \relax
    \Umathchardef\circledotright =       0 0 "E442 \relax
    \Umathchardef\circledotleft =        0 0 "E443 \relax
    \Umathchardef\capplus =              0 0 "E444 \relax
    \Umathchardef\bigcapplus =           0 0 "E445 \relax
    \Umathchardef\sqcapplus =            0 0 "E447 \relax
    \Umathchardef\bigsqcapplus =         0 0 "E448 \relax
    \Umathchardef\sqcupplus =            0 0 "E44A \relax
    \Umathchardef\bigsqcupplus =         0 0 "E44B \relax
    \Umathchardef\oint@cw =              1 0 "E44E \relax
    \Umathchardef\oiint@acw =            1 0 "E450 \relax
    \Umathchardef\varoiint@cw =          1 0 "E452 \relax
    \Umathchardef\oiiint@acw =           1 0 "E454 \relax
    \Umathchardef\varoiiint@cw =         1 0 "E456 \relax
    \Umathchardef\varoiint@acw =         1 0 "E458 \relax
    \Umathchardef\oiint@cw =             1 0 "E45A \relax
    \Umathchardef\varoiiint@acw =        1 0 "E45C \relax
    \Umathchardef\oiiint@cw =            1 0 "E45E \relax
    \Umathchardef\sq@iint =              1 0 "E460 \relax
    \Umathchardef\sq@iiint =             1 0 "E462 \relax
    \Umathchardef\var@int =              1 0 "E464 \relax
    \Umathchardef\var@iint =             1 0 "E466 \relax
    \Umathchardef\var@iiint =            1 0 "E468 \relax
    \Umathchardef\var@iiiint =           1 0 "E46A \relax
    \Umathchardef\var@idotsint =         1 0 "E46C \relax
    \Umathchardef\varoint@acw =          1 0 "E46E \relax
    \DeclareRobustCommand{\ointclockwise}{\oint@cw\nolimits}%
    \DeclareRobustCommand{\varointctrclockwise}{\varoint@acw\nolimits}%
    \DeclareRobustCommand{\oiintclockwise}{\oiint@cw\nolimits}%
    \DeclareRobustCommand{\oiintctrclockwise}{\oiint@acw\nolimits}%
    \DeclareRobustCommand{\varoiintclockwise}{\varoiint@cw\nolimits}%
    \DeclareRobustCommand{\varoiintctrclockwise}{\varoiint@acw\nolimits}%
    \DeclareRobustCommand{\oiiintclockwise}{\oiiint@cw\nolimits}%
    \DeclareRobustCommand{\oiiintctrclockwise}{\oiiint@acw\nolimits}%
    \DeclareRobustCommand{\varoiiintclockwise}{\varoiiint@cw\nolimits}%
    \DeclareRobustCommand{\varoiiintctrclockwise}{\varoiiint@acw\nolimits}%
    \DeclareRobustCommand{\idotsint}{\@idotsint\nolimits}%
    \DeclareRobustCommand{\sqiint}{\sq@iint\nolimits}%
    \DeclareRobustCommand{\sqiiint}{\sq@iiint\nolimits}%
    \DeclareRobustCommand{\varint}{\var@int\nolimits}%
    \DeclareRobustCommand{\variint}{\var@iint\nolimits}%
    \DeclareRobustCommand{\variiint}{\var@iiint\nolimits}%
    \DeclareRobustCommand{\variiiint}{\var@iiiint\nolimits}%
    \DeclareRobustCommand{\varidotsint}{\var@idotsint\nolimits}%
    \Umathchardef\msanspartial =         0 0 "E77A \relax
    \Umathchardef\mitsanspartial =       0 0 "E7CA \relax
    \Umathchardef\IM =                   0 0 "E7FE \relax
    \Umathchardef\RE =                   0 0 "E7FF \relax
    %\widearc and\overrightarc
    \newcommand*{\widearc}{\Umathaccent  0 0 "E540 }%
    \newcommand*{\widearcarrow}{\Umathaccent 0 0 "20D5 }%
    \let\overrightarc\widearcarrow
    % amssymb
    \@ifpackageloaded{amssymb}%
      {\PackageWarning{kpfonts-otf}{%
         kpfonts-otf provides all AMS symbols.\MessageBreak
         Loading amssymb.sty is not advisable.\MessageBreak
         Reported}%
      }%
      {% AMS Symbols not referenced in unicode-math-table.tex
       % \Umathchardef\sum = <math type> <family> <slot>
       % <math type> : \mathord=0 \mathrel=3 ; <family>=0
       \Umathchardef\circledR =       0 0 "24C7 \relax
       \Umathchardef\circledS =       0 0 "24C8 \relax
       \Umathchardef\shortparallelslant =  3 0 "E092 \relax
       \Umathchardef\nshortparallelslant = 3 0 "E093 \relax
       \Umathchardef\lesseqslantgtr =      3 0 "E094 \relax
       \Umathchardef\gtreqslantless =      3 0 "E095 \relax
       \Umathchardef\lesseqqslantgtr =     3 0 "E096 \relax
       \Umathchardef\gtreqqslantless =     3 0 "E097 \relax
       \Umathchardef\npreceq =        3 0 "E098 \relax
       \Umathchardef\nsucceq =        3 0 "E099 \relax
       \Umathchardef\diagup =         0 0 "E0A0 \relax
       \Umathchardef\diagdown =       0 0 "E0A1 \relax
       \Umathchardef\shortmid =       3 0 "E0A2 \relax
       \Umathchardef\shortparallel =  3 0 "E0A3 \relax
       \Umathchardef\nshortmid =      3 0 "E0A4 \relax
       \Umathchardef\nshortparallel = 3 0 "E0A5 \relax
       \Umathchardef\lvertneqq =      3 0 "E0A6 \relax
       \Umathchardef\gvertneqq =      3 0 "E0A7 \relax
       \Umathchardef\varsubsetneq =   3 0 "E0AC \relax
       \Umathchardef\varsupsetneq =   3 0 "E0AD \relax
       \Umathchardef\varsubsetneqq =  3 0 "E09C \relax
       \Umathchardef\varsupsetneqq =  3 0 "E09D \relax
       \Umathchardef\nleqslant =      3 0 "E0A8 \relax
       \Umathchardef\ngeqslant =      3 0 "E0A9 \relax
       \Umathchardef\nleqq =          3 0 "E0AA \relax
       \Umathchardef\ngeqq =          3 0 "E0AB \relax
       \Umathchardef\leadsto =        3 0 "E409 \relax
       \let\centerdot\cdotp                % vysmblksquare ?
       \let\restriction\upharpoonright
       \let\doteqdot\Doteq
       \let\doublecup\Cup
       \let\doublecap\Cap
       \let\llless\lll
       \let\gggtr\ggg
       \let\circlearrowleft\acwopencirclearrow
       \let\circlearrowright\cwopencirclearrow
       \let\lozenge\diamondsuit
       \let\blacklozenge\vardiamondsuit
       \let\square\mdlgwhtsquare
       \let\blacksquare\mdlgblksquare
       \let\dashleftarrow\leftdasharrow
       \let\dashrightarrow\rightdasharrow
       \let\ntriangleleft\nvartriangleleft
       \let\ntriangleright\nvartriangleright
       \let\varpropto\propto
       \let\thicksim\sim
       \let\thickapprox\approx
       \let\smallsmile\smile
       \let\smallfrown\frown
      }%
    % latexsym
    \@ifpackageloaded{latexsym}%
      {\PackageWarning{kpfonts-otf}{%
         kpfonts-otf provides all LaTeX symbols.\MessageBreak
         Loading latexsym.sty is not advisable.\MessageBreak
         Reported}%
      }%
      {\let\lhd\triangleleft
       \let\rhd\triangleright
       \let\unlhd\trianglelefteq
       \let\unrhd\trianglerighteq
       \let\Box\mdlgwhtsquare
       \let\Diamond\mdwhtdiamond
      }%
  }
\fi

\endinput