printed-text 0.0.0

Text layout engine on top of `printed` graphics package.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

printed-text

standard-readme compliant GitHub DUB

Text layout engine on top of printed graphics package.

printed-text provides a text layout engine on top of the graphics context API of printed for creating text documents in PDF, HTML or SVG format. It is intended to provide a barebones and extensible API.

Table of Contents

Install

With dub add printed-text.

With dub.sdl:

dependency "printed-text" version=">=0.0.0"

With dub.json:

"dependencies": { "printed-text": ">=0.0.0" }

Usage

Here is a minimal example. More examples can be found under docs/exmaples.

import printed.canvas;
import printed.text;

void loremIpsum(IRenderingContext2D renderer, ITextLayouter textLayouter)
{
    with (textLayouter)
    {
        textWidth = 150f; //mm
        fontFace = "Arial";
        fontSize = 10f; //pt

        textLayouter.group({
            fontSize = 16f; //pt
            fontWeight = FontWeight.bold;
            write("Lorem Ipsum\n");
        });
        write("\n")
        write("Lorem ipsum dolor sit amet.");
        foreach (block; layout())
            block.renderWith(renderer);
    }
}

Maintainer

printed-text is being developed by Arne Ludwig <arne.ludwig@posteo.de>.

Contributing

Contributions are warmly welcome. Just create an issue or pull request on GitHub. If you submit a pull request please make sure that:

  • the code compiles on Linux using the current release of dmd,
  • your code is covered with unit tests (if feasible) and
  • dub test runs successfully.

License

This project is licensed under MIT License (see LICENSE).

Authors:
  • Arne Ludwig
Dependencies:
printed:canvas, printed:font
Versions:
0.0.1 2021-Jul-28
0.0.0 2021-Jul-19
~main 2022-Dec-05
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 10 downloads total

Score:
0.4
Short URL:
printed-text.dub.pm