[Date Index] [Thread Index] [Author Index]
On 2 Feb 1998 02:01:48 -0500, Mark Evans <email@example.com> wrote: >Tricky programming challenge: > >How to write out a string of text using a proportional font, then >connect given letters by means of geometric lines. The lines may cross >over one another, have different colors, or different dashings. > >Example: > > This is a proportional font > | | | || | > | | | || | > | ---------------- | > | | | > --------------------------- > >The reason for this exercise has to do with certain problems in >linguistics. > Maybe Mathematica, with all its new typesetting wonders, can still pull this off; but I am having my doubts. Other languages offer a simple expedient. They provide a call such as TextWidth(str) that returns the width in pixels of a string 'str' -- assuming a particular font, style, and font size. I could use such a call to parse my string, letter by letter, until I knew the position of each. The call is nontrivial when you think about it in terms of kerning. You can't just add up all the letter widths, because they vary with the particular string. I don't know whether Mathematica offers any such function. If not, it should! It seems to have everything else..... Mark Evans "evans" at "gte" dot "net"