Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AttributedCharacterStringIterator and LineBreakMeasurer

 
John Turtle
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 50232
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know, I am afraid, but that question sounds too difficult for "beginning", so I shall move it.

And welcome to the Ranch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic