diff options
author | Norbert Preining <norbert@preining.info> | 2021-04-20 03:00:55 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-04-20 03:00:55 +0000 |
commit | d65c208b161ffee9ce5343fdfdb17d00523cecae (patch) | |
tree | 6829c46d8881891365b9be3fb660dba3ca79e6f5 /macros/optex/pkg/emoji.opm | |
parent | 272d21375e83d59014b6591075291d172bbfa007 (diff) |
CTAN sync 202104200300
Diffstat (limited to 'macros/optex/pkg/emoji.opm')
-rw-r--r-- | macros/optex/pkg/emoji.opm | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/macros/optex/pkg/emoji.opm b/macros/optex/pkg/emoji.opm new file mode 100644 index 0000000000..e14579135f --- /dev/null +++ b/macros/optex/pkg/emoji.opm @@ -0,0 +1,55 @@ +% This is the macro package used by OpTeX, see http://petr.olsak.net/optex + +% emoji.opm, Petr Olšák <petr@olsak.net>, 2021 + +% Emoji allows us to use colored emoticons as characters from the font. +% The \emoji{<name>} command is available, see texdoc emoji (from +% corresponding LaTeX package). + +\_namespace{emoji} + +\_codedecl \.emoji {Emotikons from the TwemojiMozilla.ttf font} + + \_doc ----------------------------- + Font TwemojiMozilla.ttf is loaded. The font feature +colr is needed. + The `\emojifont` is implemented using `\_resizethefont` as size-dependent. + \_cod ----------------------------- + +\_initunifonts +\_font\.tenemoji=[TwemojiMozilla]:+colr +\_def\.emojifont{\.tenemoji\_resizethefont} +\_def\.emoji#1{{\.emojifont\_trycs{_emoji_:#1}{\_opwarning{uknown emoji "#1"}}}} + + \_doc ----------------------------- + The mapping from names or aliases to the codes are declared in the + `emoji-table.def` file from the \LaTeX/ package emoji. + \_cod ----------------------------- + +\_bgroup + \_def\__emoji_def #1 #2#3#4#5#6{% #1=n, #2=data, #3=name, #4=aliases, #5=descr, #6=versi + \_sxdef{_emoji_:#3}{#2}% + \_ifx^#4^\_else \_foreach #4, \_do ##1, {\_global\_slet{_emoji_:##1}{_emoji_:#3}}\_fi + } + \_def\ProvidesExplFile#1#2#3#4{} + \_def\__emoji_group#1 #2{} + \_def\__emoji_subgroup#1 #2{} + \_catcode`\#=12 + \_input {emoji-table.def}% defining emoji names +\_egroup + +\_nspublic \emoji \emojifont ; + +\_endnamespace + +\_endcode + +\begtt % ----------------------- Testing file --------------------------- +\load[emoji] +We can use \emoji{grinning} or directly: {\emojifont 😀} too. +\bye +\endtt % ---------------------------------------------------------------- + +More than 3000 emoticons are available. + +If you want black-and-white pictograms, see another font: +\url{http://petr.olsak.net/optex/optex-tricks.html\#fawesome} |