summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/kotex-oblivoir/memhangul-x/ob-unfontsdefault.sty
blob: 853643763e9fe99f8986f3a50edea49af68ff482 (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
%%
%% ob-unfontsdefault.sty
%% part of xob-font.sty
%%
%% public domain
%%
\ProvidesExplPackage{ob-unfontsdefault}
	{2020/10/26}
	{v0.4}
	{Un and Baekmuk Fonts for xetexko}

\RequirePackage{l3keys2e}

\msg_new:nnn { ksxeunfonts } { errormsg } { Legacy~TeX~engine~not~supported }

\sys_if_engine_pdftex:T { 
	\msg_error:nn { ksxeunfonts } { errormsg }
}

\keys_define:nn { ksxeunfonts }
{
	mj	.tl_set:N	= \opt_mjfont_tl,
	mjbold	.tl_set:N	= \opt_mjboldfont_tl,
	mjitalic	.tl_set:N	= \opt_mjitalicfont_tl,
	mjbolditalic	.tl_set:N	= \opt_mjbolditalicfont_tl,
	gt	.tl_set:N	= \opt_gtfont_tl,
	gtbold	.tl_set:N	= \opt_gtboldfont_tl,
	gtitalic	.tl_set:N	= \opt_gtitalicfont_tl,
	gtbolditalic	.tl_set:N	= \opt_gtbolditalicfont_tl,
	renderer	.tl_set:N 	= \opt_renderer_tl,
	fakeitalic	.bool_set:N	= \opt_fakeitalic_bool,
	jamo	.bool_set:N	= \opt_script_bool,
	mjinterhangul	.tl_set:N	= \opt_mjinterhangul_tl,
	gtinterhangul	.tl_set:N	= \opt_gtinterhangul_tl,
	mjwordspace	.tl_set:N	= \opt_mjwordspace_tl,
	gtwordspace	.tl_set:N	= \opt_gtwordspace_tl,
	untaza	.bool_set:N	= \opt_untaza_bool,
	more	.tl_set:N 	= \opt_moreopt_tl,
	other	.tl_set:N	= \opt_otheropt_tl,
	baekmuk	.bool_set:N = \opt_baekmuk_bool,
}

\keys_set:nn { ksxeunfonts }
{
	mj = UnBatang.ttf,
	mjbold	= UnBatangBold.ttf,
	mjitalic	= UnGraphic.ttf,
	mjbolditalic	= UnGraphicBold.ttf,
	gt = UnDotum.ttf,
	gtbold = UnDotumBold.ttf,
	gtitalic = UnDinaru.ttf,
	gtbolditalic = UnYetgul.ttf,
	renderer = OpenType,
	fakeitalic = false,
	jamo = false,
	mjinterhangul = .06em,
	gtinterhangul = .04em,
	mjwordspace = {.95,.45,.25},
	gtwordspace = {.96,.45,.2},
	more = {},
	other = {},
	baekmuk = false,
}

\ProcessKeysOptions { ksxeunfonts }

\bool_if:NT \opt_baekmuk_bool
{
    \keys_set:nn { ksxeunfonts }
    {
    	mj = batang.ttf,
    	mjbold	= *,
    	mjitalic	= *,
    	mjbolditalic	= *,
    	gt = dotum.ttf,
    	gtbold = *,
    	gtitalic = gulim.ttf,
    	gtbolditalic = hline.ttf,
    	renderer = OpenType,
    	fakeitalic = true,
    	jamo = false,
    	mjinterhangul = .06em,
    	gtinterhangul = .045em,
    	mjwordspace = {.48,.3,.2},
    	gtwordspace = {.50,.3,.2},
    	more = {BoldFeatures={FakeBold=1.1},BoldItalicFeatures={FakeBold=1.1}},
    }
}

\sys_if_engine_luatex:T {
	\hangulbyhangulfont=1
}

\bool_if:NTF \opt_fakeitalic_bool
{
	\tl_set:Nn \l_fakeitalic_option_tl { 
		BoldItalicFeatures = { FakeSlant = { 0.167 } },
		AutoFakeSlant,
	}
}
{
	\tl_set:Nn \l_fakeitalic_option_tl { }
}

\bool_if:NTF \opt_script_bool
{
	\tl_set:Nn \l_script_option_tl { Script = Hangul, }
}
{
	\tl_set:Nn \l_script_option_tl {}
}

\setmainhangulfont{\opt_mjfont_tl}[
	BoldFont = \opt_mjboldfont_tl,
	ItalicFont = \opt_mjitalicfont_tl,
	BoldItalicFont = \opt_mjbolditalicfont_tl,
	Renderer = \opt_renderer_tl,
	InterHangul = -\opt_mjinterhangul_tl,
	WordSpace = {\opt_mjwordspace_tl},
	\l_script_option_tl \l_fakeitalic_option_tl
	\opt_moreopt_tl,
	\opt_otheropt_tl
]

\setsanshangulfont{\opt_gtfont_tl}[
	BoldFont = \opt_gtboldfont_tl,
	ItalicFont = \opt_gtitalicfont_tl,
	BoldItalicFont = \opt_gtbolditalicfont_tl,
	Renderer = \opt_renderer_tl,
	InterHangul = -\opt_gtinterhangul_tl,
	WordSpace = {\opt_gtwordspace_tl},
	\l_fakeitalic_option_tl
	\opt_moreopt_tl,
	\opt_otheropt_tl
]

\bool_if:NT \opt_untaza_bool
{
	\setmonohangulfont { UnTaza.ttf }
	\setmonohanjafont { UnDotum.ttf }
}

\endinput