There a few antialiasing artefacts that I don't know how to get rid of, and it uses some experimental code (what else?!). The font used is Hoefler (according to my Mac). The code itself won't work without some extra bits and pieces (one of which is the conversion of the Hoefler font to PGF paths - does anyone know the licence for Hoefler?). I also don't think that the braces are Hoefler.
For what it's worth, here's the code:
\documentclass{standalone}
%\url{http://tex.stackexchange.com/q/85050/86}
\usepackage[svgnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{shapes.letters,shadows.blur}
\pgfkeys{
/pgf/letter/.cd,
load font={hoefler}{normal},
size=4,
load encoding=name,
}
\definecolor{logoBack}{HTML}{F8F8F2}
\definecolor{brace}{HTML}{F6F6EF}
\definecolor{letter}{HTML}{C04848}
\makeatletter
\tikzset{
use letter path/.code={%
\pgfscope
\pgftransformscale{\letter@size}%
\letter@path{\letter@encode{#1}}%
\endpgfscope
}
}
\makeatother
\begin{document}
\begin{tikzpicture}[every shadow/.style={
shadow blur invert,
shadow xshift=-1pt,
shadow yshift=-3pt
}]
\coordinate (bleft) at (-2,0);
\coordinate (T) at (0,0);
\coordinate (E) at (2.3cm,-.65cm);
\coordinate (X) at (4.35cm,0);
\coordinate (bright) at (8.6,0);
\begin{scope}
\begin{scope}[shift={(bleft)}]
\fill[color=brace,use letter path=braceleft];
\clip[use letter path=braceleft];
\path[blur shadow,shadow xshift=2pt, shadow yshift=0pt,use letter path=braceleft];
\path[blur shadow,shadow xshift=-1pt, shadow yshift=0pt,use letter path=braceleft];
\end{scope}
\begin{scope}[shift={(T)}]
\fill[color=letter,use letter path=T];
\clip[use letter path=T];
\path[blur shadow,use letter path=T];
\end{scope}
\begin{scope}[shift={(E)}]
\fill[color=letter,use letter path=E];
\clip[use letter path=E];
\path[blur shadow,use letter path=E];
\end{scope}
\begin{scope}[shift={(X)}]
\fill[color=letter,use letter path=X];
\clip[use letter path=X];
\path[blur shadow,use letter path=X];
\end{scope}
\begin{scope}[shift={(bright)}]
\fill[color=brace,use letter path=braceright];
\clip[use letter path=braceright];
\path[blur shadow,shadow xshift=2pt, shadow yshift=0pt,use letter path=braceright];
\path[blur shadow,shadow xshift=-1pt, shadow yshift=0pt,use letter path=braceright];
\end{scope}
\path (current bounding box.north west) ++(-1,1) (current bounding box.south east) ++(1,-1);
\clip[shift={(T)},use letter path=T] (current bounding box.north west) rectangle (current bounding box.south east);
\clip[shift={(bleft)},use letter path=braceleft] (current bounding box.north west) rectangle (current bounding box.south east);
\clip[shift={(E)},use letter path=E] (current bounding box.north west) rectangle (current bounding box.south east);
\clip[shift={(X)},use letter path=X] (current bounding box.north west) rectangle (current bounding box.south east);
\clip[shift={(bright)},use letter path=braceright] (current bounding box.north west) rectangle (current bounding box.south east);
\fill[logoBack,rounded corners] (current bounding box.north west) rectangle (current bounding box.south east);
\end{scope}
\end{tikzpicture}
\end{document}
As well as needing the letter shapes from Hoefler and the code to make use of it, in doing this I spotted an issue with the pgf-blur library now needing unique fading names. So it really isn't compilable with "off the shelf" code! Modulo a few updates, most of it is on the TeX-SX launchpad - Hoefler being the key exception.
As I said in a comment, if \definecolor
, simply stores the color definition in a TeX macro, then redefining it will recycle the same macro, and thus will not use more memory.
However it is also possible that \defincolor
is pushing some kind of literal PDF code which defines the color for the PDF engine. In this case, as far as I can understand it, no more memory should be used either for redefining a lot of times the same color.
Anyway, just in case, it is possible to use a RGB color without previous definition. Here is how.
In principle, tikz
recognizes a color specificacion of the form {rgb:red,255;green,255;blue:255}
. But it is not interpreted as one would expect. For example [fill={rgb:red,255;green,255;blue,0}]
will not produce yellow, but a black tinted yellow instead (see figure below). I could not find documentation about how this specification works. Apparently all red
, green
, blue
values are summed up, and then each particular value divided by the total. That, is, what we specify aren't absolute byte values, but relative weights. So, to get yellow we can write: {rgb:red,1;green:1;blue:-1}
. I find this syntax rather inconvenient (moreover, how could we get "white"?)
PGF uses a internal macro: \pgfsys@color@rgb@fill
which has the expected behaviour. It receives three numeric values for the r
, g
and b
components, as 0-255 values. So we can use this macro to set the fill color just before the filling command.
Here is a code which shows several options:
\documentclass{article}
\usepackage{tikz}
% Define a more convenient macro without @ in its name
\makeatletter
\def\fillRGB#1#2#3{\pgfsys@color@rgb@fill{#1}{#2}{#3}}
\makeatother
\begin{document}
% Standard xcolor defined color
\definecolor{RGByellow}{RGB}{255,255,0}
% Some examples
\tikz{\node[draw,fill=RGByellow]{defined colour};}
\tikz{\node[draw,fill={rgb:red,255;green,255;blue,0}]{Tikz rgb: 255,255,0};}
\tikz{\node[draw,fill={rgb:red,1;green,1;blue,-1}]{Tikz rgb: 1,1,-1};}
\tikz{\fillRGB{255}{255}{0}\node[fill,draw]{{\tt fillRGB: 255,255,0} };}
\end{document}
The result:
Best Answer
A good starting point is the
kik-android
document class, as well as minimal working example of Brian Jacobs's answer in Showcase of beautiful typography done in TeX & friendsThe above text links are enough because are from TeX - LaTeX Stack Exchange, but just to compare with the image in the question, this is the result: