使用 TikZ 或 PSTricks 来回答我的问题都是免费的。我想重新创建我们的 TeX.SX 徽标。但我的尝试远非完美。请帮助我使其更接近原始徽标。
\documentclass[pstricks,border=0pt]{standalone}
\begin{document}
\begin{pspicture}(8,3)
\rput(4,1.5){\psscalebox{8}{\textcolor{gray}{\{}\textcolor{red}{\TeX}\textcolor{gray}{\}}}}
\end{pspicture}
\end{document}
我想改进的方面:
- 字体类型。
- 字体颜色及其底纹。
答案1
有一些我不知道如何消除的抗锯齿伪影,并且它使用了一些实验性代码(还有什么?!)。使用的字体是Hoefler(根据我的 Mac)。如果没有一些额外的部分,代码本身将无法工作(其中之一是将 Hoefler 字体转换为 PGF 路径 - 有人知道 Hoefler 的许可证吗?)。我也不认为括号是 Hoefler。
无论如何,以下是代码:
\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}
除了需要 Hoefler 的字母形状和使用它的代码外,在执行此操作时,我发现 pgf-blur 库现在需要独特的淡入淡出名称。因此,它实际上无法与“现成的”代码编译!除了一些更新外,大多数更新都在 TeX-SX 启动板上 - Hoefler 是关键的例外。
答案2
我现在能得到的最接近的答案是:
\documentclass[]{article}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[outline]{contour}
\usepackage{libertine}
\begin{document}
\bfseries
\Huge{
\contourlength{.4pt}
\textsc{
\textcolor{white}{\contour{gray}{\textbraceleft}}
\contourlength{.3pt}
\hspace{-15pt}
\textcolor{BrickRed}{\contour{black}{\TeX}}
\hspace{-15pt}
\contourlength{.4pt}
\textcolor{white}{\contour{gray}{\textbraceright}}
}
\end{document}
答案3
这是一次尝试,虽然远不如 Andrew Stacey 或 Herbert 的方法完整或优雅,但不需要任何非标准或测试版软件包。它结合了 Mico 和 boucekv 的方法。有趣的是,它在 lualatex 中生成输出,但不使用 xelatex。
\documentclass {article}
\pagestyle {empty}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[centering,margin=1mm]{geometry}
\geometry{papersize={1.5in,0.4in}}
\usepackage[outline]{contour}
\usepackage{metalogo}
\makeatletter
\def\xl@drop@TeX@e{0.39ex} % default value: 0.5ex
\makeatother
\usepackage {fontspec}
\setmainfont {Hoefler Text}
\begin{document}
\centering
\Huge{
\contourlength{0.01em}
\textcolor{gray!10}{\contour{gray}{\{}}
\textcolor{BrickRed}{\contour{black}{\TeX}}
\textcolor{gray!10}{\contour{gray}{\}}}
}
\end{document}
答案4
\documentclass{article}
\usepackage{pst-grad,pst-light3d,pstricks-add}
\DeclareFixedFont{\Rmb}{T1}{ptm}{m}{n}{4cm}
\begin{document}
\begin{pspicture}(0,-4)(8,4)
\psset{linewidth=0.5pt}
\psBrace[braceWidth=4mm,fillstyle=gradient,gradbegin=black,gradend=white,
gradangle=0,gradmidpoint=0](0.5,2)(0.5,-2)
\rput(4,0){\PstLightThreeDText[fillstyle=solid,fillcolor=red!100!black!70,
LightThreeDAngle=60,LightThreeDYLength=0.1]{\Rmb\TeX}}
\psBrace[braceWidth=4mm,fillstyle=gradient,gradbegin=white,gradend=black,
gradangle=0,gradmidpoint=0](7.5,-2)(7.5,2)
\end{pspicture}
\end{document}
需要最新pstricks-add
的http://texnik.dante.de/tex/genric/pstricks-add/