Implementation of returning the text width of the chars [start, stop) in the buffer. Unlike the previous version that was inside PFont, this will return the size not of a 1 pixel font, but the actual current size.
(char[] buffer, int start, int stop)
| 4625 | * return the size not of a 1 pixel font, but the actual current size. |
| 4626 | */ |
| 4627 | protected float textWidthImpl(char[] buffer, int start, int stop) { |
| 4628 | float wide = 0; |
| 4629 | for (int i = start; i < stop; i++) { |
| 4630 | // could add kerning here, but it just ain't implemented |
| 4631 | wide += textFont.width(buffer[i]) * textSize; |
| 4632 | } |
| 4633 | return wide; |
| 4634 | } |
| 4635 | |
| 4636 | |
| 4637 | // ........................................................ |
no test coverage detected