kb-text-shape: Unicode segmentation and shaping using kb_text_shape

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:


[Skip to Readme]

Properties

Versions 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.16 && <5), bytestring, text [details]
License BSD-3-Clause
Copyright 2025 IC Rainbow
Author IC Rainbow
Maintainer aenor.realm@gmail.com
Category Font
Home page https://github.com/dpwiz/kb-text-shape#readme
Bug tracker https://github.com/dpwiz/kb-text-shape/issues
Source repo head: git clone https://github.com/dpwiz/kb-text-shape
Uploaded by AlexanderBondarenko at 2025-12-07T20:47:12Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for kb-text-shape-0.1.0.0

[back to package description]

kb-text-shape

Haskell wrapper for the kb_text_shape.h unicode segmentation and shaping library.

Automatic segmentation and shaping

Fonts and text go in, font and glyph indices go out:

import KB.Text.Shape where qualified as TextShape

main = do
  TextShape.withContext \ctx -> do
    _font <- TextShape.pushFontFromFile ctx "test/Ubuntu-R.ttf" 0
    results <- TextShape.run ctx do
      TextShape.text_ "A bunch of characters"
      TextShape.char_ '!'
    forM_ results \(run, glyphs) -> do
      forM_ glyphs \glyph ->
        print (run.fontIndex, glyph.id)