wood burning stoves 2.0*
The moose likes Java in General and the fly likes AttributedCharacterStringIterator and LineBreakMeasurer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "AttributedCharacterStringIterator and LineBreakMeasurer" Watch "AttributedCharacterStringIterator and LineBreakMeasurer" New topic
Author

AttributedCharacterStringIterator and LineBreakMeasurer

John Turtle
Greenhorn

Joined: Oct 15, 2010
Posts: 1
I'm playing with some code that will read a text file and then write the text (paragraph) from that text file to a jpeg.

I understand that I need to use LineBreakMeasurer and that it requires (AttributedCharacterStringIterator as a parameter, but I can't wrap my head around how it all works together or what I need to do. I also can't find any very good examples.

Can someone check my understanding? By my reckoning . . .

LineBreakMeasurer requires the interface AttributedCharacterStringIterator because it uses the methods of AttributedCharacterIterator to determine line length, etc. But some of the wording of the methods suggest that AttributedCharacterIterator needs to do some of the work. For instance:

getRunStart()
Returns the index of the first character of the run with respect to all attributes containing the current character.


Suggests to me that the "run" is the characters already processed and the "first character of the run" would be the first character in the next line of data to be processed (as opposed to the first character of the string).

Am I over thinking this?

I would greatly appreciate it if someone helped me understand what I need to do to even begin the code.

Thank you.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37926
    
  22
Don't know, I am afraid, but that question sounds too difficult for "beginning", so I shall move it.

And welcome to the Ranch
 
wood burning stoves
 
subject: AttributedCharacterStringIterator and LineBreakMeasurer
 
Similar Threads
Printing Database Records to an external printer/paper?
Print a JtextArea
Opening files in jsp
Invoking printer using java
Dashed underline Font problem