smooth_reading 0.3.0 copy "smooth_reading: ^0.3.0" to clipboard
smooth_reading: ^0.3.0 copied to clipboard

Guided fixation reading: emphasise the leading letters of every word so the eye has an artificial fixation point. Zero dependencies, pure Dart, works in Flutter (TextSpan), on the server and on the we [...]

example/smooth_reading_example.dart

// ignore_for_file: avoid_print

import 'package:smooth_reading/smooth_reading.dart';

void main() {
  // HTML for string contexts (server templates, static sites, Markdown
  // pipelines).
  print(toHtml('Smooth reading works.'));
  // <b>Smo</b>oth <b>read</b>ing <b>wor</b>ks.

  // Strength and saccade interval.
  print(toHtml('Smooth reading works.',
      options: const SmoothOptions(fixation: 5, saccade: 2)));
  // <b>Smoot</b>h reading <b>work</b>s.

  // Tokens for rendering with your own primitives (Flutter TextSpan, a
  // terminal UI, a PDF generator).
  for (final token in tokenize('Smooth reading')) {
    switch (token) {
      case WordToken(:final fixationText, :final restText):
        print('[$fixationText]$restText');
      case SeparatorToken(:final text):
        print('separator "$text"');
    }
  }
  // [Smo]oth
  // separator " "
  // [read]ing

  // Markdown.
  print(toMarkdown('Smooth reading works.'));
  // **Smo**oth **read**ing **wor**ks.
}
1
likes
150
points
66
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Guided fixation reading: emphasise the leading letters of every word so the eye has an artificial fixation point. Zero dependencies, pure Dart, works in Flutter (TextSpan), on the server and on the web. Same algorithm and identical output as the TypeScript, Swift, Kotlin and Python ports.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#text #typography #reading #accessibility #unicode

License

Apache-2.0 (license)

More

Packages that depend on smooth_reading