Graphics, Figures & TablestikZ | Many small Triangles form a Word

Information and discussion about graphics, figures & tables in LaTeX documents.
EigenGoofy
Posts: 42
Joined: Fri Jul 22, 2011 12:26 am

tikZ | Many small Triangles form a Word

Post by EigenGoofy »

For example, suppose I have many small triangles, I want these triangles to follow a path, which is defined by words. (e.g. "BEST"), so that the triangles align themselves to form the word "BEST".

Can the »tikZ« package do this? From its user guide (over 700 pages long), I am only able to find the triangles are able to follow a path, which is defined by drawing geometric shape (e.g. circle) within a coordinate, not by words.

Thank you!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tikZ | Many small Triangles form a Word

Post by localghost »

I'm not aware of a solution with pgf/tikZ. But you can try pst-text.


Thorsten
EigenGoofy
Posts: 42
Joined: Fri Jul 22, 2011 12:26 am

tikZ | Many small Triangles form a Word

Post by EigenGoofy »

Thank you very much, Thorsten!

pst-text... I have just tried this package. It's a nightmare!

The help document from here:
http://mirror.csclub.uwaterloo.ca/CTAN/ ... xt-doc.pdf
http://ctan.cms.math.ca/tex-archive/gra ... ks-doc.pdf
These two documents are badly written, none of any example from them works. And the document said nothing of what package I need to run it properly. There are just too many similar packages, such as pdftricks, pst-plot, pst-all, pstricks-add, pst-text, pspicture. They just confuse me. The user guides aim to provide help for pros, not for layman.

I add up the package auto-pst-pdf and add -shell-escape to LyX, so that no error message comes out. However, it produces nothing, it gives me a blank PDF.

After manipulating it more and more, more problems come out, such as the problem from the link below, which is irrevertible. It changes my system permanently, and I don't know how to solve it, except for everytime I manually re-name my file names. This was never happened before.
http://www.latex-community.org/forum/vi ... =23&t=5002

I have to delete my LyX, and Adobe, and hope to recover by re-installation; otherwise, maybe I have to format my disk in the end.

But still, thank you very much, Thorsten!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

tikZ | Many small Triangles form a Word

Post by Stefan Kottwitz »

The mentioned problem seems to be a known problem, that newer versions of the Adobe Reader lock the PDF file when it's opened. You could verify that: next time close the document in the Adobe Reader before recompiling. Did you update the reader?

In such cases, people often switch to the Sumatra PDF reader. It's a fast one, it doesn't lock the file, and even better: it supports SyncTeX, i.e. forward and inverse search. Click in the PDF to jump to the corresponding place in the source code - very helpful when writing big documents.

The Adobe Reader can still be used for finally checking the result. Since the Adobe Reader is popular, it's good to use it as a reference before giving documents away.

Regarding the original question: I can imagine that it could be solved using \pgf@mask or similar, but I think that's a challenge. Masking with pgf has some documentation in the manual, but not so much, and it's not yet integrated in TikZ.

Stefan
LaTeX.org admin
EigenGoofy
Posts: 42
Joined: Fri Jul 22, 2011 12:26 am

tikZ | Many small Triangles form a Word

Post by EigenGoofy »

Did you update the reader?
Nice to meet you again, Stefan! I updated my reader to Adobe 8.0 three month ago. No such problem was found until yesterday. I am not sure which step of operation caused this locking problem. There're some suspects, for example,
1, I clicked "Reconfigure" in LyX;
2, I began to use a package called "etex" to solve a problem described from the link below:
http://www.latex-community.org/forum/vi ... f=5&t=5149
3, I had also installed and loaded a piles of packages, such as, {auto-pst-pdf}, {pdftricks}, {pst-plot}, {pst-all}, {pstricks-add}, {pst-text}, etc. I don't know whether they conflict with other packages or not.

To solve the locking problem, I have tried some method recommended from the links below:
http://www.mail-archive.com/lyx-users@l ... 69147.html
http://www.latex-community.org/forum/vi ... 19&t=10855
None of the methods from these links work for my LyX 2.0.4

So as you recommend, I am going to try Sumatra PDF reader. After that, I wish I could go back to work for my original question soon.

Thank you, Stefan!
jake
Posts: 3
Joined: Sat Jun 23, 2012 11:26 pm

Re: tikZ | Many small Triangles form a Word

Post by jake »

You might want to take a look at the solutions proposed at http://tex.stackexchange.com/questions/21548. Andrew Stacey has come up with a nice approach for this problem. In the example, letters are used, but adjusting it to use triangles should be reasonably simple.
EigenGoofy
Posts: 42
Joined: Fri Jul 22, 2011 12:26 am

Re: tikZ | Many small Triangles form a Word

Post by EigenGoofy »

Hi, Jake!

You message is very useful. However, after installing fontforge, I don't know how to use fontforge to generate SVG path. Any idea?

Thank you!
jake
Posts: 3
Joined: Sat Jun 23, 2012 11:26 pm

Re: tikZ | Many small Triangles form a Word

Post by jake »

There are quite detailed explanations in Andrew's answer. He's provided a small script file that calls fontforge and converts the font to SVG. Could you add some more detail about where exactly you're stuck? Probably best to post that as a comment to Andrew's question, because he's obviously the most competent to help you.
EigenGoofy
Posts: 42
Joined: Fri Jul 22, 2011 12:26 am

tikZ | Many small Triangles form a Word

Post by EigenGoofy »

Hi, Jake!

Thank you for your reply!

I don't know how to post comment to their answer, as if posting comment is forbidden because there is no button I can click to post comment, but only posting answer is allowed there.

Unfortunately, their answers are not well-written, only those pros are able to understand. For example, they said:
1.Convert the font to SVG. You need fontforge installed. Then the following script, made executable, will invoke fontforge and convert the font specified on the command line to SVG format (output saved in the current directory). Eg if it is saved as x2svg.pe (note the extension) then run as x2svg.pe /path/to/font/amazing-font.otf.
My question:
1, where shall I put the script? How do I execute the script? What software or system do I need to execute the script properly?
2, what is "the command line"? Where can I find it?
2, where does amazing-font.otf come from?

They said:
2.Extract the glyph paths from the resulting XML file. The following Perl script does a reasonable job: it should trim excess whitespace at the start and end as well. Also, one could do with a better naming scheme (I tried unicode, but that got confusing).
My question:
1, Can fontforge extract the glyph paths from the resulting XML file?
2, Perl script? Do I need to download and install Perl Programming Language?
3, how do I execute the Perl script?

Thank you, Jake!
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

tikZ | Many small Triangles form a Word

Post by CrazyHorse »

EigenGoofy wrote:For example, suppose I have many small triangles, I want these triangles to follow a path, which is defined by words. (e.g. "BEST"), so that the triangles align themselves to form the word "BEST".

Code: Select all

\documentclass[landscape]{article}
\usepackage[margin=1cm]{geometry}
\usepackage[tiling]{pst-fill}      % PSTricks package for filling/tiling
\usepackage{pst-text}              % PSTricks package for character path
\usepackage{auto-pst-pdf}
\DeclareFixedFont{\pb}{T1}{pbk}{b}{n}{5cm}
\pagestyle{empty}
%
\begin{document}
\begin{pspicture}(0,0)(18,6)
\psset{boxfillsize={(-0.75\linewidth,-5cm)(0.75\linewidth,8cm)}}
\psboxfill{\psset{unit=3mm}\pspicture(1,0.5)\pspolygon(0,0)(0.5,0.5)(1,0)\endpspicture}
  \centerline{%
    \pscharpath[fillstyle=solid,fillcolor=white,%green!30!white,
      linestyle=none,addfillstyle=boxfill,fillangle=0,fillsep=1mm]%
        {\rput[b](0,0){\pb Triangle}}}
\end{pspicture}

\end{document}
Runs without any problems with "pdflatex -shell-escape " or the sequence "latex -> dvips -> ps2pdf" (http://archiv.dante.de/~herbert/temp.png)

See also: http://tug.org/PSTricks/main.cgi?file=E ... t/WriteBig
Attachments
temp.png
temp.png (15.93 KiB) Viewed 9625 times
Post Reply