It is currently Sun Aug 20, 2017 5:58 pm

All times are UTC - 5 hours




 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Block Justification
PostPosted: Mon Jul 13, 2015 2:11 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 448
Something I've been thinking about for the Justification of text; how much trouble would it be to do a block justification where both left and right sides are justified with automatic wrapping of text based on the width of the TextArea? The kind of Justification you would see in reading books.


Offline
 Profile  
 
 Post subject: Re: Block Justification
PostPosted: Mon Jul 13, 2015 3:08 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
This wouldn't be too hard to implement. What you need to do is keep track of how much space each word takes up on a line. Once you get to the end of a line and you know you can't place the next word on the same line, you need to then take the remaining space left on the line and sub divide it among all the spaces that you already placed. In essence you will need to shift each of the words that you already placed to reposition them. You can equally divide the left over space and then the block justification should look correct.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron