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

Cross-platform FreeType bindings for Flutter, with native FFI support and bundled WebAssembly for the web.

flutter_freetype #

Cross-platform FreeType bindings for Flutter using FFI on native platforms and WebAssembly on the web.

Features #

  • Bindings generated automatically with ffigen
  • Native FreeType is built automatically by the Flutter plugin_ffi build (Android/iOS/macOS/Linux/Windows)
  • Web/Wasm uses the bundled wasm/dist/freetype.{js,wasm}

Installation #

dependencies:
  flutter_freetype: ^1.0.0

Binding generation #

dart run ffigen

Native builds (Android/iOS/macOS/Linux/Windows) #

No manual steps required. The consuming Flutter app builds and bundles the native library automatically (Flutter plugin_ffi).

Usage #

Prefer the async constructor so the same code works on Web/Wasm and native:

import 'package:flutter_freetype/flutter_freetype.dart';

final ft = await Freetype.create();

On Web/Wasm, load fonts from bytes (paths are not supported):

final face = ft.newFaceFromBytes(fontBytes);

If you need the raw ffigen bindings on native platforms, import:

import 'package:flutter_freetype/flutter_freetype_ffi.dart';

Tests #

  • VM (default): flutter test test/vm
  • Web/Wasm (optional): RUN_WEB_TESTS=1 ./scripts/test_all.sh
  • All (VM only): ./scripts/test_all.sh

License #

Original package code is available under the MIT License. The bundled FreeType source and binary are distributed under the FreeType License. Other bundled components and the example font retain their respective open-source licenses. See THIRD_PARTY_NOTICES.md for attribution and full license references.

1
likes
140
points
101
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Cross-platform FreeType bindings for Flutter, with native FFI support and bundled WebAssembly for the web.

Repository (GitHub)
View/report issues

Topics

#freetype #ffi #fonts #typography #wasm

License

MIT (license)

Dependencies

ffi, flutter

More

Packages that depend on flutter_freetype

Packages that implement flutter_freetype