gputext 0.1.0-dev.1 copy "gputext: ^0.1.0-dev.1" to clipboard
gputext: ^0.1.0-dev.1 copied to clipboard

unlisted

GPU-accelerated vector text for Flutter. Analytic coverage shaders via Flutter GPU, with HarfBuzz shaping for complex scripts and bidirectional text.

gputext #

GPU-accelerated vector text for Flutter. Glyphs are rasterized by an analytic coverage shader through Flutter GPU, with HarfBuzz for shaping (complex scripts and bidirectional text).

Pre-release. Requires a recent Flutter master / Impeller build with flutter_gpu. Widgets paint blank without Impeller.

Install #

dependencies:
  gputext: ^0.1.0-dev.1
flutter pub get

The package build hook compiles shaders and a HarfBuzz amalgamation from third_party/harfbuzz (vendored; no separate system install).

Quick start #

import 'package:gputext/gputext.dart';

GPURichText(
  text: TextSpan(
    text: 'Hello GPU text',
    style: TextStyle(fontSize: 24, color: Colors.white),
  ),
)

Register fonts with GPUFont / the engine APIs before layout when you are not using the bundled Lato default. See the example app for demos (RTL, variable fonts, benchmarks).

Hybrid rendering #

GPURichText is not a single paint path:

  • GPU blit — glyphs covered by a registered GPUFont are rasterized into a cached ui.Image, then blitted.
  • Platform Text — color-emoji clusters and characters no registered font covers (often CJK) become baseline-aligned WidgetSpans with stock Flutter Text.
  • WidgetSpan children — measured in layout and painted on top of the text image, same as RichText.

Limits #

  • Impeller / flutter_gpu only.
  • foreground Paint is flat color only.
  • Still evolving; APIs may change before 0.1.0.

License #

MIT. HarfBuzz and bundled fonts carry their own licenses (see LICENSE and assets/).

6
likes
120
points
20
downloads

Documentation

API reference

Publisher

verified publisherzennn.dev

Weekly Downloads

GPU-accelerated vector text for Flutter. Analytic coverage shaders via Flutter GPU, with HarfBuzz shaping for complex scripts and bidirectional text.

Repository (GitHub)
View/report issues

Topics

#flutter #text #gpu #rendering #fonts

License

MIT (license)

Dependencies

characters, code_assets, ffi, flutter, flutter_gpu, flutter_gpu_shaders, hooks, logging, native_toolchain_c, vector_math

More

Packages that depend on gputext