2025-07-02 15:38:54 +02:00
2025-06-17 17:17:19 +02:00
2025-06-17 17:17:19 +02:00
2025-06-17 17:17:19 +02:00
2025-06-17 17:17:19 +02:00
2025-07-02 15:38:54 +02:00
2025-07-02 15:38:54 +02:00
2025-06-17 17:43:32 +02:00
2025-06-17 18:10:42 +02:00

graphemy-typst

Use Graphemy scripts in your typst documents

Build

Dependencies

  • Cargo with the Rust wasm32-unknown-unknown toolchain installed

Run build.sh.

Installation

Build or download a relase.

As a typst package

The typst directort of the repository or the released archive contains the typst package files that you can copy to your local package repository. See the typst package documentation for more information.

As a standalone typst file

Copy graphemy_typst.wasm and graphemy.typ to your project directory. (this is the method that will be used in the rest of this document.)

Usage

Import the load-gmy function from the package

#import "graphemy.typ": load-gmy

Load your script, This will read the specified file. you can also add here options that should be set for all instances of your script, such as margin

#let myscript = load-gmy("myscript.gmy").with(margin: 3)

Use your script as a function which formats strings

#myscript("my sample text")

Available options are

width
The width of the resulting text in absolute length, also informs the linewidth for the graphemy typesetter if it is not set separately. (default: auto)
height
The height of the resulting text in absolute length. If both width and height are set, informs the shape of the bounding box for the text. (default: auto)
margin
The margin left around the image by graphemy, useful in stroke-based scripts. (defaulut: 0)
comment
Doesnt do anything in practice, only added for completness of the Graphemy rendering options. (default: none)
fg
the foreground color of the rendered text, specified as a Typst color value (default: color.black)
bg
the background color of the rendered text, specified as a Typst color value (default: none)
linewidth
the logical linewidth in absolute length, if it isnt specified but width is, it is used instead, otherwise the default is 100pt.
scale
overall scale factor of the text, doesnt affect the typst bounding box, just the scaling.

License

Copyright © Annwan 2025

This project is licensed under the terms of the GNU General Public License version 3. A copy of the license can be found in LICENSE or obtained from the Free Software Fundation at https://www.gnu.org/licenses/gpl-3.0.en.html.

Graphemy is Copyright © Zhuriel 2024-2025, licensed under the terms of the GNU General Public License version 3.

Description
Use graphemy scripts in your typst documents.
Readme 68 KiB
Languages
Typst 52.1%
Rust 44.2%
Shell 3.7%