summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-08-08 20:38:40 +0000
committerKarl Berry <karl@freefriends.org>2017-08-08 20:38:40 +0000
commitbb5a582a3651ea6fe3c4fce9580cc248f5953f43 (patch)
tree2db9e292c86b09339265b097a9cddfdf3fe8ff89 /Master/texmf-dist/tex
parent3a8846b896e8f1b37294b5cd54016bf3b6f58490 (diff)
scsnowman (8aug17)
git-svn-id: svn://tug.org/texlive/trunk@44984 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/scsnowman/scsnowman-normal.def10
-rw-r--r--Master/texmf-dist/tex/latex/scsnowman/scsnowman.sty34
-rw-r--r--Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty61
3 files changed, 71 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/latex/scsnowman/scsnowman-normal.def b/Master/texmf-dist/tex/latex/scsnowman/scsnowman-normal.def
index 8c42db598fb..7ad14247daa 100644
--- a/Master/texmf-dist/tex/latex/scsnowman/scsnowman-normal.def
+++ b/Master/texmf-dist/tex/latex/scsnowman/scsnowman-normal.def
@@ -10,14 +10,15 @@
%% Twitter : @aminophen
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{scsnowman-normal.def}[2017/01/22 v1.1 scsnowman definition (normal)]
-\def\sctkzsym@snowman@normal{%
+\ProvidesFile{scsnowman-normal.def}[2017/08/08 v1.2 scsnowman definition (normal)]
+\def\sctkzsym@snowman@shape@normal{%
\setlength{\sctkzsym@coord@baseline}{%
\ifsctkzsym@snowman@adjustbaseline
\dimexpr0.144ex*\sctkzsym@snowman@scale\relax
\else
\z@
\fi}%
+ \sctkzsym@beginyokobox
\begin{tikzpicture}[x=1.8ex,y=1.8ex,line width=0.025ex*\sctkzsym@coord@scl,line join=round,line cap=round,scale=\sctkzsym@snowman@scale,baseline=\sctkzsym@coord@baseline]
\useasboundingbox(0,0) rectangle (1,1);
\sctkzsym@snowman@bodypath % body (IPA-like)
@@ -37,9 +38,9 @@
\sctkzsym@snowman@eyepath (0.60,0.56) circle (0.02 and 0.03);
\fi
\ifsctkzsym@snowman@mouth
- \expandafter\ifnum\csname sctkzsym@snowman@mouthshape@c\endcsname=\thr@@
+ \ifx\sctkzsym@snowman@mouthshape\sctkzsym@snowman@mouthshape@iii
\sctkzsym@snowman@mouthpath (0.40,0.47) -- (0.60,0.47);
- \else\expandafter\ifnum\csname sctkzsym@snowman@mouthshape@c\endcsname=\tw@
+ \else\ifx\sctkzsym@snowman@mouthshape\sctkzsym@snowman@mouthshape@ii
\sctkzsym@snowman@mouthpath (0.40,0.46) .. controls (0.45,0.49) and (0.55,0.49) .. (0.60,0.46);
\else
\sctkzsym@snowman@mouthpath (0.40,0.48) .. controls (0.45,0.45) and (0.55,0.45) .. (0.60,0.48);
@@ -115,6 +116,7 @@
\sctkzsym@snowman@snowpath (0.94,0.23) circle (0.04);
\fi
\end{tikzpicture}%
+ \sctkzsym@endyokobox
}
\endinput
%%
diff --git a/Master/texmf-dist/tex/latex/scsnowman/scsnowman.sty b/Master/texmf-dist/tex/latex/scsnowman/scsnowman.sty
index 77d2ab22d3c..1c38d12474f 100644
--- a/Master/texmf-dist/tex/latex/scsnowman/scsnowman.sty
+++ b/Master/texmf-dist/tex/latex/scsnowman/scsnowman.sty
@@ -10,10 +10,10 @@
%% Twitter : @aminophen
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{scsnowman}[2017/01/22 v1.1 Snowman variants using TikZ]
+\ProvidesPackage{scsnowman}[2017/08/08 v1.2 Snowman variants using TikZ]
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{sctkzsym-base}}
\ProcessOptions\relax
-\RequirePackage{sctkzsym-base}[2017/01/22]
+\RequirePackage{sctkzsym-base}[2017/08/08]
%
% make document snowman (joke)
\ifsctkzsym@document
@@ -106,6 +106,7 @@
\newcommand\sctkzsym@snowman@initkeys{%
\def\sctkzsym@snowman@init{false}%
\def\sctkzsym@snowman@scale{1}%
+ \def\sctkzsym@snowman@shape{normal}%
\def\sctkzsym@snowman@body{false}%
\def\sctkzsym@snowman@eyes{true}% default on
\def\sctkzsym@snowman@mouthshape{smile}%
@@ -126,9 +127,10 @@
% key definitions
\sctkzsym@define@key@withbool{snowman}{init}
\sctkzsym@define@key@wodefault{snowman}{scale}
+\sctkzsym@define@key@wodefault{snowman}{shape}
\sctkzsym@define@key@withbool{snowman}{body}
\sctkzsym@define@key@withbool{snowman}{eyes}
-\sctkzsym@define@key@wodefault{snowman}{mouthshape}
+\sctkzsym@define@key@withword{snowman}{mouthshape}{smile,frown,tight}
\sctkzsym@define@key@withbool{snowman}{mouth}
\sctkzsym@define@key@withbool{snowman}{sweat}
\sctkzsym@define@key@withbool{snowman}{hat}
@@ -138,9 +140,6 @@
\sctkzsym@define@key@withbool{snowman}{snow}
\sctkzsym@define@key@withbool{snowman}{adjustbaseline}
%
-% count definitions for \sctkzsym@hndl@key@wodefault
-\newcount\sctkzsym@snowman@mouthshape@c
-%
% definition of \scsnowman[...]
\DeclareRobustCommand\scsnowman[1][]{%
% key initialization using default
@@ -191,7 +190,7 @@
\sctkzsym@hndl@key@withbool{snowman}{eyes}%
\def\sctkzsym@snowman@eyepath{\path[fill=\sctkzsym@snowman@eyefill]}%
% check mouth (currently mouth=<color> not supported; falling back to default-(anti)color)
- \sctkzsym@hndl@key@wodefault{snowman}{mouthshape}{smile}{frown}{tight}%
+ \sctkzsym@hndl@key@withword{snowman}{mouthshape}%
\sctkzsym@hndl@key@withbool{snowman}{mouth}%
\def\sctkzsym@snowman@mouthpath{\path[draw=\sctkzsym@snowman@mouthstroke]}%
% check sweat
@@ -220,11 +219,16 @@
%
% drawing snowman
\set@sctkzsym@coord@scl{\sctkzsym@snowman@scale}%
- \ifdim\sctkzsym@coord@scl<0pt\set@sctkzsym@coord@scl{-\sctkzsym@snowman@scale}\fi%
+ \ifdim\sctkzsym@coord@scl<\z@\set@sctkzsym@coord@scl{-\sctkzsym@snowman@scale}\fi%
%
%%%%% input from def file
%
- \sctkzsym@snowman@normal
+ \expandafter\ifx\csname sctkzsym@snowman@shape@\sctkzsym@snowman@shape\endcsname\relax
+ \PackageError{scsnowman}{%
+ Unsupported value `\sctkzsym@snowman@shape' for shape}\@ehc
+ \else
+ \csname sctkzsym@snowman@shape@\sctkzsym@snowman@shape\endcsname
+ \fi
%
%%%%%
%
@@ -243,8 +247,18 @@
\sctkzsym@snowman@defaultkeys
}
%
+% definition of \usescsnowmanlibrary{...}
+\newcommand{\usescsnowmanlibrary}[1]{%
+ \edef\@tempa{\zap@space#1 \@empty}%
+ \@for\@tempa:=\@tempa\do{%
+ \chardef\sctkzsym@catcode=\catcode`\@\relax
+ \makeatletter\input{scsnowman-\@tempa.def}%
+ \catcode`\@=\sctkzsym@catcode\relax}%
+}
+\@onlypreamble\usescsnowmanlibrary
+%
% load shape definitions
-\input{scsnowman-normal.def}
+\usescsnowmanlibrary{normal}% default
%
\endinput
%%
diff --git a/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty b/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty
index 4f8eadd01d4..3a854bffd75 100644
--- a/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty
+++ b/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty
@@ -10,10 +10,14 @@
%% Twitter : @aminophen
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{sctkzsym-base}[2017/01/22 v1.1 Base for emoji variants using TikZ]
+\ProvidesPackage{sctkzsym-base}[2017/08/08 v1.2 Base for emoji variants using TikZ]
\RequirePackage{tikz}
\RequirePackage{keyval}
%
+\ifx\kanjiskip\@undefined\else
+ \IfFileExists{pxeveryshi.sty}{\RequirePackage{pxeveryshi}}{}
+\fi
+%
% prepare for options
\newif\ifsctkzsym@document
\newif\ifsctkzsym@qed
@@ -55,17 +59,32 @@
\fi
%
% key definitions
+% * any value; if none, 'true' is assumed
\newcommand{\sctkzsym@define@key@withbool}[2]{%
\define@key{sctkzsym@#1}{#2}[true]{\expandafter\def\csname sctkzsym@#1@#2\endcsname{##1}}%
\expandafter\newif\csname ifsctkzsym@#1@#2\endcsname
}
+% * any value; if none, an error will be raised
\newcommand{\sctkzsym@define@key@wodefault}[2]{%
\define@key{sctkzsym@#1}{#2}{\expandafter\def\csname sctkzsym@#1@#2\endcsname{##1}}%
}
+% * one from arg #3; arg #3 should be comma-separated list of candidates
+\newcommand{\sctkzsym@define@key@withword}[3]{%
+ \define@key{sctkzsym@#1}{#2}{\expandafter\def\csname sctkzsym@#1@#2\endcsname{##1}}%
+ % register known values (used in key handling)
+ \sctkzsym@hndlcnt\z@
+ \edef\@tempa{\zap@space#3 \@empty}%
+ \@for\@tempa:=\@tempa\do{%
+ \advance\sctkzsym@hndlcnt\@ne
+ \expandafter\let\csname sctkzsym@#1@#2@\romannumeral\sctkzsym@hndlcnt\endcsname\@tempa}%
+}
+% other known values (used in key handling)
+\def\sctkzsym@true{true} % for bool strcmp
+\def\sctkzsym@false{false} % for bool strcmp
%
% key handling
-\def\sctkzsym@true{true} % for strcmp
-\def\sctkzsym@false{false} % for strcmp
+\newcount\sctkzsym@hndlcnt % for withword loop
+\let\sctkzsym@status\relax % for withword status
\newcommand{\sctkzsym@hndl@key@withbool}[2]{%
\expandafter\ifx\csname sctkzsym@#1@#2\endcsname\sctkzsym@false\relax
\csname sctkzsym@#1@#2false\endcsname % <key>=false
@@ -89,31 +108,33 @@
\fi
\fi
}
-\newcommand{\sctkzsym@hndl@key@wodefault}[5]{%
- \def\@tempa{#3}%
- \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\@tempa\relax
- \csname sctkzsym@#1@#2@c\endcsname\@ne
- \else
- \def\@tempa{#4}%
- \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\@tempa\relax
- \csname sctkzsym@#1@#2@c\endcsname\tw@
- \else
- \def\@tempa{#5}%
- \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\@tempa\relax
- \csname sctkzsym@#1@#2@c\endcsname\thr@@
- \else
- \PackageError{sc#1}{Unsupported value `\csname sctkzsym@#1@#2\endcsname' for #2}\@ehc
- \csname sctkzsym@#1@#2@c\endcsname\z@
+\newcommand{\sctkzsym@hndl@key@withword}[2]{%
+ % initialize
+ \@tempcnta\@ne
+ \let\sctkzsym@status\relax
+ % check through the registered candidate values
+ \loop\expandafter\ifx\csname sctkzsym@#1@#2@\romannumeral\@tempcnta\endcsname\relax\else
+ \ifx\sctkzsym@status\relax
+ \expandafter\ifx\csname sctkzsym@#1@#2\expandafter\endcsname
+ \csname sctkzsym@#1@#2@\romannumeral\@tempcnta\endcsname\relax
+ \def\sctkzsym@status{0}%
\fi
\fi
+ \advance\@tempcnta\@ne
+ \repeat
+ % if the status is still not zero, user-specified value is invalid; throw an error
+ \ifx\sctkzsym@status\relax
+ \PackageError{sc#1}{Unsupported value `\csname sctkzsym@#1@#2\endcsname' for #2}\@ehc
\fi
}
%
% setup for tikzpicture
\newlength{\sctkzsym@coord@baseline}
\newlength{\sctkzsym@coord@scl}
-\newcommand*{\set@sctkzsym@coord@scl}[1]{\pgfmathsetlength{\sctkzsym@coord@scl}{#1pt}}
-\newcommand{\sctkzsym@defaultcolor}{black}
+\newcommand*{\set@sctkzsym@coord@scl}[1]{\pgfmathsetlength{\sctkzsym@coord@scl}{#1\p@}}
+\newcommand{\sctkzsym@beginyokobox}{\ifx\tate\@undefined\else\leavevmode\hbox\bgroup\yoko\fi}
+\newcommand{\sctkzsym@endyokobox}{\ifx\tate\@undefined\else\egroup\fi}
+\newcommand{\sctkzsym@defaultcolor}{}
\newcommand{\sctkzsym@defaultanticolor}{white}
%
\endinput