Forum Moderators: open

Message Too Old, No Replies

justifying one line of text

         

JakeFrederick

1:11 pm on Dec 27, 2001 (gmt 0)

10+ Year Member



Is it possible to justify just one line of text at a specified width? I'm trying to create a paragraph of curved text, but I want to have the whole thing right aligned so it has a clean straight margin on the right side. The problem is I want the left to have a pixel perfect "curved" look to go around an image. It seems that justifying the text would be the best solution, but I haven't been able to justify each line individually, I can only justify a paragraph as a whole with no breaks or it won't work. Anyone know if what I'm trying to do is possible?

tedster

2:25 pm on Dec 27, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What you are hoping to do here is a standard typesetting technique in print, but awfully hard to pull off in a web browser because you can't control font sizes and line breaks with certainty. However, if you're willing to make a sacrifice for poor display on systems set to large system fonts--

How about creating a special p class with margin-top:-1em? That way you could justify one line as an independent paragraph and not show the extra empty line when you break to the second paragraph (which would be class="special").

Different font sizes on different browsers could definitely foul this scheme -- but creating the justified line with enough "play" might allow similar rendering cross browser unless system fonts were set to large.

idiotgirl

5:40 am on Dec 31, 2001 (gmt 0)

10+ Year Member Top Contributors Of The Month



From what I've read it is possible, but not practical, to align text to a curve. I did a half-hearted job using the cloumns and tables and wasn't impressed enough to put it online. It involves tables with a zillion 1x1 columns and td's, the spacer.gif, and fixed-width fonts... which will blow up the minute anyone bumps up their font display size.

Currently, DHTML doesn't support clipping on a curved path across the board. With the new SVG stuff there maybe hope, but for now you'd probably be mired in so much html markup your page would take too long to load and destroy the whole experience.

Lots of sites just do the text as a graphic rendered in a screen font to fool the eye, with a transparent background to load faster. But the load time could still be considerable. Makes updating a pain, too. (And there goes your spider food.)