summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec.sty
blob: b679d5a436e3bfd80e95f6514fcbdd00001cb84a (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
%
% lltjp-fontspec.sty
%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{lltjp-fontspec}[2016/03/31 Patch to fontspec for LuaTeX-ja]

\RequirePackage{fontspec,luatexja}
\ExplSyntaxOn

\cs_set:Nn \fontspec_visible_space:
 {
  \font_glyph_if_exist:NnTF \font {"2423}
   { \ltjalchar"2423\scan_stop: }
   { \fontspec_visible_space_fallback: }
 }
\def\verb
 {
  \relax\ifmmode\hbox\else\leavevmode\fi % same as lltjcore
  \bgroup
    \verb@eol@error \let\do\@makeother \dospecials
    \verbatim@font\@noligs
    \@ifstar\__fontspecsverb\@verb
 }


\cs_set_eq:NN \ltj_orig_fontspec_setup_maths: \fontspec_setup_maths: 
\cs_set:Nn \fontspec_setup_maths:
  {
    \group_begin:
      \cs_set:Npn \DeclareMathSymbol##1##2##3##4{%
        \expandafter\in@\csname sym##3\expandafter\endcsname
           \expandafter{\group@list}%
        \ifin@
          \begingroup
            \count\z@=##4\relax
            \count\tw@\count\z@
            \divide\count\z@\sixt@@n
            \count@\count\z@
            \multiply\count@\sixt@@n
            \advance\count\tw@-\count@
            \if\relax\noexpand##1% is command?
              \edef\reserved@a{\noexpand\in@{\string\mathchar}{\meaning##1}}%
              \reserved@a
              \ifin@
                \expandafter\set@mathsymbol
                   \csname sym##3\endcsname##1##2%
                   {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
                \@font@info{Redeclaring math symbol \string##1}%
              \else
                \expandafter\set@mathsymbol
                \csname sym##3\endcsname##1##2%
                  {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
              \fi
            \else
              \expandafter\set@mathchar
                \csname sym##3\endcsname##1##2
                {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}%
            \fi
          \endgroup
        \else
          \@latex@error{Symbol font `##3' is not defined}\@eha
        \fi
      }
    \ltj_orig_fontspec_setup_maths:
    \group_end:
  }

%%%%%%%% shapes in \em
\cs_set:Npn \emshape { \gtfamily \itshape }
\cs_set:Npn \eminnershape { \mcfamily \upshape }

\ExplSyntaxOff
\endinput