arabic_text_justification 0.0.2 copy "arabic_text_justification: ^0.0.2" to clipboard
arabic_text_justification: ^0.0.2 copied to clipboard

Flutter FFI plugin for Arabic text justification using HarfBuzz shaping and FreeType rasterization.

arabic_text_justification #

A Flutter FFI plugin for Arabic text rendering with kashida-based justification using HarfBuzz and FreeType.

Supports two rendering modes: bitmap and vector outline.

Demo #

screenshot      demo

How It Works #

  1. Text shaping — HarfBuzz applies Arabic letter forms, ligatures, and optional kashida justification.
  2. Glyph processing — FreeType either rasterizes glyphs to bitmap or extracts vector bezier outlines.
  3. Word mapping — per-word bounding rectangles and glyph-to-word indices for hit-testing and animation.

Usage #

import 'package:arabic_text_justification/arabic_text_justification.dart';

// Bitmap rendering
final result = await ArabicTextJustification.renderLine(
  fontPath, text, fontSize, availableWidth,
  justify: true,
);
RawImage(image: result.image, fit: BoxFit.fill);

// Vector outline rendering
final outline = ArabicTextJustification.getOutline(
  fontPath, text, fontSize, availableWidth,
  justify: true,
);
CustomPaint(painter: ArabicOutlinePainter(outline: outline));

Acknowledgments #

  • DigitalKhatt — Arabic justification and font technology
  • HarfBuzz — Text shaping engine (justification branch by DigitalKhatt)
  • FreeType — Font rendering library

Portions of this software are copyright (c) 2023 The FreeType Project (https://freetype.org). All rights reserved.

See THIRD_PARTY_NOTICES for full license details.

License #

MIT — see LICENSE for details.

3
likes
0
points
222
downloads

Publisher

verified publisherkartika.dev

Weekly Downloads

Flutter FFI plugin for Arabic text justification using HarfBuzz shaping and FreeType rasterization.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ffi, flutter, plugin_platform_interface

More

Packages that depend on arabic_text_justification

Packages that implement arabic_text_justification