glyph_path_flutter 1.0.0 copy "glyph_path_flutter: ^1.0.0" to clipboard
glyph_path_flutter: ^1.0.0 copied to clipboard

Flutter integration for glyph_path — converts TextPathResult into a dart:ui Path for direct Canvas rendering.

example/example.md

flutter_canvas.dart #

A minimal CustomPainter that loads a .ttf from an asset bundle, generates a TextPathResult via glyph_path, converts it with toUiPath(), and draws it on a Canvas. Copy the file into an existing Flutter project's lib/ directory — it can't be run with dart run since it depends on dart:ui and package:flutter.

import 'package:glyph_path/glyph_path.dart';
import 'package:glyph_path_flutter/glyph_path_flutter.dart';

class GlyphPainter extends CustomPainter {
  const GlyphPainter({required this.result});

  final TextPathResult result;

  @override
  void paint(Canvas canvas, Size size) {
    canvas.drawPath(result.toUiPath(), Paint()..color = Colors.black);
  }

  @override
  bool shouldRepaint(GlyphPainter oldDelegate) => oldDelegate.result != result;
}

flutter_demo/ #

A runnable Flutter app (flutter run from inside example/flutter_demo/) with font selection, fill/stroke drawing modes, and a side-by-side comparison against Flutter's built-in Text widget.

0
likes
160
points
115
downloads

Documentation

API reference

Publisher

verified publishercrossapplication.members.co.jp

Weekly Downloads

Flutter integration for glyph_path — converts TextPathResult into a dart:ui Path for direct Canvas rendering.

Repository (GitHub)
View/report issues

Topics

#font #text #flutter #canvas

License

BSD-3-Clause (license)

Dependencies

flutter, glyph_path

More

Packages that depend on glyph_path_flutter