%D \module
%D   [       file=symb-imp-cc,
%D        version=2013.03.22,
%D          title=\CONTEXT\ Symbol Libraries,
%D       subtitle=Creative Commons,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D LS/HH: This font has changed over time so there might be diffences
%D in rendering. The otf, ttf and type1 version can differ too.

\doifelsefontpresent{ccicons.otf} { % redone ctan version
    \definefontfeature
      [creativecommons]
      [mode=base,
       goodies=ccicons,
       unicoding=yes]
    \definefontsynonym
      [creativecommons]
      [ccicons*creativecommons]
} {                                 % official version
    \definefontfeature
      [creativecommons]
      [mode=base,
       goodies=cc-icons,
       unicoding=yes]
    \definefontsynonym
      [creativecommons]
      [cc-icons*creativecommons]
}

\startsymbolset[cc]

    \definesymbol [sa]       [\getnamedglyphdirect{creativecommons}{sa}]
    \definesymbol [by]       [\getnamedglyphdirect{creativecommons}{by}]
    \definesymbol [cc]       [\getnamedglyphdirect{creativecommons}{cc}]
    \definesymbol [nd]       [\getnamedglyphdirect{creativecommons}{nd}]
    \definesymbol [nc]       [\getnamedglyphdirect{creativecommons}{nc}]
    \definesymbol [ncus]     [\getnamedglyphdirect{creativecommons}{nc}]
    \definesymbol [nceu]     [\getnamedglyphdirect{creativecommons}{nceu}]
    \definesymbol [ncjp]     [\getnamedglyphdirect{creativecommons}{ncjp}]
    \definesymbol [pd]       [\getnamedglyphdirect{creativecommons}{pd}]
    \definesymbol [sampling] [\getnamedglyphdirect{creativecommons}{sampling}]
    \definesymbol [share]    [\getnamedglyphdirect{creativecommons}{share}]
    \definesymbol [remix]    [\getnamedglyphdirect{creativecommons}{remix}]
    \definesymbol [zero]     [\getnamedglyphdirect{creativecommons}{zero}]
    \definesymbol [logo]     [\getnamedglyphdirect{creativecommons}{logo}]

    % \definesymbol [cc-by-sa-nc] [\dontleavehmode\lower.15ex\hbox\bgroup
    %     \getnamedglyphdirect{creativecommons}{cc}\enspace
    %     \getnamedglyphdirect{creativecommons}{by}\enspace
    %     \getnamedglyphdirect{creativecommons}{sa}\enspace
    %     \getnamedglyphdirect{creativecommons}{nc}%
    % \egroup]
    %
    % % more efficient:
    %
    % \definesymbol [cc-by-sa-nc] [\dontleavehmode\lower.15ex\hbox\bgroup
    %     \directsymbol{cc}{cc}\enspace\directsymbol{cc}{by}\enspace
    %     \directsymbol{cc}{sa}\enspace\directsymbol{cc}{nc}%
    % \egroup]
    %
    % % more fun:

    \unexpanded\def\creativecommons#1%
      {\dontleavehmode\lower.15\exheight\hbox\bgroup
         \overloaded\let\inbetween\relax
         \processseparatedlist[#1][-]{\inbetween\overloaded\let\inbetween\enspace\directsymbol{cc}}%
       \egroup}

    \definesymbol [cc-by-sa-nc] [\creativecommons{cc-by-sa-nc}]

\stopsymbolset

\continueifinputfile{symb-imp-cc.mkiv}

\starttext

    \showsymbolset[cc]

    \symbol[cc][cc-by-sa-nc]

\stoptext

