summaryrefslogtreecommitdiff
path: root/doc/context/presentations/bachotex/2017/bachotex-2017-emoji.tex
blob: c6deb387310c77adfdbe1e768ba7a7b2ea84577d (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
% language=uk

\setuppapersize
  [S6]

\setupbackgrounds
  [page]
  [background=color,
   backgroundcolor=darkgray]

\setuplayout
  [backspace=24pt,
   topspace=20pt,
   bottomspace=8pt,
   width=middle,
   height=middle,
   footerdistance=8pt,
   footer=8pt,
   header=0pt]

\setupcolors
  [textcolor=white]

\setupbodyfont
  [dejavu,14.4pt]

\definecolor[trace:o] [s=1]
\definecolor[trace:r] [s=1]
\definecolor[trace:do][s=1]
\definecolor[trace:dr][s=1]

\usemodule[abr-03]

\definefontfeature[noligatures][liga=no]

\setuphead
  [section]
  [page=yes,
   style=\bfb,
   after={\blank[3*medium]}]

\setuphead
  [subsection]
  [page=no,
   style=\bf\addfeature{noligatures},
   before={\blank[3*medium]},
   after={\blank}]

\setupfooter
  [strut=no,
   style=\bf]

\startdocument
  [title={Picture Fonts},
   subtitle={welcome to a (beautiful) mess},
   author={Hans Hagen},
   occasion={BachoTUG 2017}]

\startstandardmakeup
    \vskip32pt
    \bfd \setupinterlinespace
    \documentvariable{title}
    \crlf
    \bfb \setupinterlinespace
    \vskip12pt
    \documentvariable{subtitle}
    \vfill
    \bfb \setupinterlinespace
    \documentvariable{author}
    \crlf
    \documentvariable{occasion}
\stopstandardmakeup

\startsubject[title=A Summary]

\startitemize
\startitem
    {\bf the macro package's view:} just a font like any other but it needs to configure
    some extra color related properties
\stopitem
\startitem
    {\bf the engine's view:} depending on the technology a normal font that needs a bit
    special treatment or needs to be dealt with as collection of graphics
\stopitem
\startitem
    {\bf the viewer's view:} regular outline glyphs or images tagged as kind of
    characters so that their unicode representation can be cut and paste
\stopitem
\startitem
    {\bf the user's view:} more pictures than glyphs although some people one can
    communicate using them
\stopitem
\stopitemize

So, in practice, for most \TEX\ users it's probably not a high priority font but more a fun
one.

\stopsubject

\startsubject[title=Technologies]

As each vendor came up with something, we have to deal with a all kinds of formats. And or
course, as eagerness pushes things on the market before it's perfect we now have to deal
with all of them.

\startitemize
\startitem
    {\bf overlapping glyphs:} this technique uses the \type {colr} and \type {cpal} tables
    and is actually a quite clean technology, you can combine in different ways
\stopitem
\startitem
    {\bf svg graphics:} this technique uses the \type {svg} table that contains a svg vector
    image
\stopitem
\startitem
    {\bf bitmap graphics:} this technique uses for instance \type {sbix} tables that can have
    various graphic images
\stopitem
\stopitemize

The first two are already supported in the \CONTEXT\ font loader and processor
for a while, the last one was added recently.

\blank

Only the overlapping method is useable for the tens of thousands of skin tone combinations of
families, (kissing) couples, and professions.

\stopsubject

\startsubject[title=Preparation]

For now one has to enable the feature:

\startbuffer
\definefontfeature[overlay][default][ccmp=yes,colr=yes,dist=yes]
\definefontfeature[svg]    [default][svg=yes]
\definefontfeature[bitmap] [default][sbix=yes]

\definefontfeature [colored] [default]
  [cmcp=yes,dist=yes,
   colr=yes,svg=yes,sbix=yes]
\stopbuffer

\typebuffer \getbuffer

Defining a font is not different from others

\starttyping
\definefont[MyEmojiFont] [seguiemj*overlay]
\definefontsynonym[emoji][seguiemj*overlay]
\stoptyping

As is using:

\starttyping
{\MyEmojiFont\resolvedemoji{woman}}
\emoji{woman}
\stoptyping

\stopsubject

\startsubject[title=Accessing shapes]

\startbuffer
\definesymbol[man]  [\emoji{man}]
\definesymbol[woman][\emoji{woman}]
\definesymbol[girl] [\emoji{girl}]
\definesymbol[boy]  [\emoji{boy}]

\definesymbol[family][\emoji{family man woman girl boy}]
\stopbuffer

\typebuffer \getbuffer

\starttyping
\definefontsynonym[emoji][file:seguiemj.ttf*default,overlay]

\symbol[boy] \symbol[girl] \symbol[man] \symbol[woman]

\symbol[family]
\stoptyping

\stopsubject

\startsubject[title=Different fonts]

\def\ShowThem#1#2#3%
  {\NC #1
   \NC default
   \NC \definefontsynonym[emoji][#3*default]\symbol[boy] \symbol[girl] \symbol[man] \symbol[woman]
   \NC \definefontsynonym[emoji][#3*default]\symbol[family]
   \NC \NR
   \NC
   \NC #2
   \NC \definefontsynonym[emoji][#3*#2]\symbol[boy] \symbol[girl] \symbol[man] \symbol[woman]
   \NC \definefontsynonym[emoji][#3*#2]\symbol[family]
   \NC \NR}

\starttabulate[|T|T|||]
    \ShowThem{seguiemj}             {overlay}{file:seguiemj.ttf}
    \ShowThem{emojionecolor-svginot}{svg}    {file:emojionecolor-svginot.ttf}
    \ShowThem{emojionemozilla}      {overlay}{file:emojionemozilla.ttf}
    \ShowThem{applecoloremoji}      {bitmap} {file:applecoloremoji.ttc}
\stoptabulate

\stopsubject

\startsubject[title=Ligatures]

\definefontfeature[seguiemj-cl][default][colr=yes,ccmp=yes,dist=yes]
\definefontfeature[seguiemj-bw][default][ccmp=yes]

% \definefont[MyEmoji][emojionecolor-svginot*default,svg]
% \definefont[MyEmoji][seguiemj*seguiemj-bw]
\definefont[MyEmoji][seguiemj*seguiemj-cl]
% \definefont[MyEmoji][emojionemozilla*default,overlay]
% \definefont[MyEmoji][applecoloremoji*default,bitmap]

{\MyEmoji 👨🏽‍🌾 👨🏽‍🍳 👨🏽‍🎓 👨🏽‍🎤 👨🏽‍🎨 👨🏽‍🏫 👨🏽‍🏭 👨🏽‍💻 👨🏽‍💼 👨🏽‍🔧 👨🏽‍🔬 👨🏽‍🚀}

\starttabulate[|T|T||]
\NC character         \NC 1F477       \NC \MyEmoji \utfchar{"1F477} \NC \NR % construction worker
\NC skin modifier     \NC 1F3FE       \NC \MyEmoji \utfchar{"1F3FE} \NC \NR % medium dark skin
\NC ligature          \NC 1F477 1F3FE \NC \MyEmoji \utfchar{"1F477}%
                                                   \utfchar{"1F3FE} \NC \NR
\NC zero width joiner \NC 0200D       \NC \MyEmoji \utfchar{"0200D} \NC \NR
\NC female modifier   \NC 02640 0FE0F \NC \MyEmoji \utfchar{"02640}%
                                                   \utfchar{"0FE0F} \NC \NR
\NC the whole lot     \NC             \NC \MyEmoji \utfchar{"1F477}%
                                                   \utfchar{"1F3FE}%
                                                   \utfchar{"0200D}%
                                                   \utfchar{"02640}%
                                                   \utfchar{"0FE0F} \NC \NR
\stoptabulate

\starttabulate[|T|T||]
\NC 1F468 1F3FD 200D 1F33E \NC \MyEmoji 👨🏽‍🌾 \NC man farmer          medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F373 \NC \MyEmoji 👨🏽‍🍳 \NC man cook            medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F393 \NC \MyEmoji 👨🏽‍🎓 \NC man student         medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F3A4 \NC \MyEmoji 👨🏽‍🎤 \NC man singer          medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F3A8 \NC \MyEmoji 👨🏽‍🎨 \NC man artist          medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F3EB \NC \MyEmoji 👨🏽‍🏫 \NC man teacher         medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F3ED \NC \MyEmoji 👨🏽‍🏭 \NC man factory worker  medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F4BB \NC \MyEmoji 👨🏽‍💻 \NC man technologist    medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F4BC \NC \MyEmoji 👨🏽‍💼 \NC man office worker   medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F527 \NC \MyEmoji 👨🏽‍🔧 \NC man mechanic        medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F52C \NC \MyEmoji 👨🏽‍🔬 \NC man scientist       medium skin tone \NC \NR
\NC 1F468 1F3FD 200D 1F680 \NC \MyEmoji 👨🏽‍🚀 \NC man astronaut       medium skin tone \NC \NR
\stoptabulate

\stopsubject

\usemodule[fonts-emoji]

\startsubject[title=Snippets]

\start

    \definedfont[seguiemj*seguiemj-cl @ 32pt]

    \ShowEmojiSnippets
        [family man light skin tone woman dark skin tone girl medium skin tone boy medium skin tone]

    \vskip1ex

    \ShowEmojiSnippetsOverlay
        [family man light skin tone woman dark skin tone girl medium skin tone boy medium skin tone]

    \vskip1ex

    \ShowEmojiGlyphs
        [family man light skin tone woman dark skin tone girl medium skin tone boy medium skin tone]

\stop

\stopsubject

\startsubject[title=Using \type{\ShowEmoji[^man]}]

\start

    \MyEmoji

    \ShowEmoji[^man]

\stop

\stopsubject

\startsubject[title=Recoloring Seguiem]

\start

\definecolor[emoji-red]   [r=.4]
\definecolor[emoji-blue]  [b=.4]
\definecolor[emoji-yellow][y=.4]
\definecolor[emoji-gray]  [s=.5,t=.5,a=1]

\definefontcolorpalette
  [emoji-red]
  [emoji-red,emoji-gray]

\definefontcolorpalette
  [emoji-blue]
  [emoji-blue,emoji-gray]

\definefontcolorpalette
  [emoji-yellow]
  [emoji-yellow,emoji-gray]

\definefontfeature[seguiemj-r][default][ccmp=yes,dist=yes,colr=emoji-red]
\definefontfeature[seguiemj-b][default][ccmp=yes,dist=yes,colr=emoji-blue]
\definefontfeature[seguiemj-y][default][ccmp=yes,dist=yes,colr=emoji-yellow]

\definefont[MyColoredEmojiR][seguiemj*seguiemj-r @ 80pt]
\definefont[MyColoredEmojiB][seguiemj*seguiemj-b @ 80pt]
\definefont[MyColoredEmojiY][seguiemj*seguiemj-y @ 80pt]

\MyColoredEmojiR
    \resolvedemoji{man}
    \resolvedemoji{woman}
    \resolvedemoji{baby}

\vskip24pt

\MyColoredEmojiB
    \resolvedemoji{triangular ruler}
    \resolvedemoji{rabbit face}
    \resolvedemoji{family man woman girl boy}

\vskip24pt

\MyColoredEmojiY
    \resolvedemoji{triangular ruler}
    \resolvedemoji{rabbit face}
    \resolvedemoji{family man woman girl boy}

\stop

\page

\starttyping
\definecolor [emoji-red]  [r=.4]
\definecolor [emoji-gray] [s=.5,t=.5,a=1]

\definefontcolorpalette
  [emoji-red]
  [emoji-red,emoji-gray]

\definefontfeature
  [seguiemj-r]
  [default]
  [ccmp=yes,dist=yes,colr=emoji-red]

\definefont
  [MyColoredEmojiR]
  [seguiemj*seguiemj-r @ 80pt]

\MyColoredEmojiR
    \emoji{man}
    \emoji{woman}
    \emoji{baby}
\stoptyping

\stopsubject

\startsubject[title=Pallet \type{\ShowEmojiPalettes[1]}]

{\MyEmoji \ShowEmojiPalettes[1]}

\stopsubject

\stopdocument