Steady read-aloud highlight and a calmer default pace
The spoken word is now painted behind unchanged text instead of restyling the paragraph, so words never reshape, shift or rewrap as the highlight moves. Revealing the word measures its own boxes against the visible area, so a reversed transcript no longer jumps for a word already in view. Sentence breaks the reading adds no longer map onto the next item's first letter. 1.0x now reads at 0.8 of the platform's normal rate.
This commit is contained in:
@@ -53,4 +53,17 @@ void main() {
|
||||
));
|
||||
expect(result.sourceRange(0, (start: two, end: two + 3)), isNull);
|
||||
});
|
||||
|
||||
test('a word read with its added sentence break stays on its own text', () {
|
||||
const markdown = '- one\n- two';
|
||||
final document = markdownToSpeech(markdown);
|
||||
final spoken = document.text;
|
||||
// An engine may report the word with the period the reading added.
|
||||
final start = spoken.indexOf('one');
|
||||
final range = document.sourceRange(0, (start: start, end: start + 5));
|
||||
expect(range, (
|
||||
start: markdown.indexOf('one'),
|
||||
end: markdown.indexOf('one') + 3,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user