How to use handright - 6 common examples

To help you get started, we’ve selected a few handright examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Gsllchb / Handright / handright / _exceptions.py View on Github external
# coding: utf-8
class Error(Exception):
    pass


class LayoutError(Error):
    pass


class BackgroundTooLargeError(Error):
    pass
github Gsllchb / Handright / handright / _exceptions.py View on Github external
# coding: utf-8
class Error(Exception):
    pass


class LayoutError(Error):
    pass


class BackgroundTooLargeError(Error):
    pass
github Gsllchb / Handright / setup.py View on Github external
def main():
    setuptools.setup(
        name=handright.__name__,
        version=handright.__version__,
        description="A lightweight Python library for simulating Chinese handwriting",
        license="bsd-3-clause",
        author="Chenghui Li (Gsllchb)",
        author_email="gsllchb@hotmail.com",
        python_requires=">= 3.5",
        keywords="simulating Chinese handwriting",
        url="https://github.com/Gsllchb/Handright",
        long_description_content_type="text/markdown",
        long_description=get_long_description(),
        zip_safe=True,
        packages=setuptools.find_packages(exclude=("*.tests", "tests")),
        classifiers=(
            "Programming Language :: Python :: 3.5",
            "Programming Language :: Python :: 3.6",
            "Programming Language :: Python :: 3.7",
github Gsllchb / Handright / setup.py View on Github external
def main():
    setuptools.setup(
        name=handright.__name__,
        version=handright.__version__,
        description="A lightweight Python library for simulating Chinese handwriting",
        license="bsd-3-clause",
        author="Chenghui Li (Gsllchb)",
        author_email="gsllchb@hotmail.com",
        python_requires=">= 3.5",
        keywords="simulating Chinese handwriting",
        url="https://github.com/Gsllchb/Handright",
        long_description_content_type="text/markdown",
        long_description=get_long_description(),
        zip_safe=True,
        packages=setuptools.find_packages(exclude=("*.tests", "tests")),
        classifiers=(
            "Programming Language :: Python :: 3.5",
            "Programming Language :: Python :: 3.6",
            "Programming Language :: Python :: 3.7",
            "Programming Language :: Python :: 3.8",
github Gsllchb / Handright / handright / _core.py View on Github external
`template` could be a Template instance or a Sequence of Template
    instances. If pass a Template Sequence, the inside Template instances will
    be applied cyclically to the output pages.

    `seed` could be used for reproducibility.

    A different implementation of map built-in function (only accept one
    Iterable though) could be passed to `mapper` to boost the page rendering
    process, e.g. `multiprocessing.Pool.map`.
    """
    if isinstance(template, Template):
        templates = (template,)
    else:
        templates = template
    pages = _draft(text, templates, seed)
    renderer = _Renderer(templates, seed)
    return mapper(renderer, pages)
github Gsllchb / Handright / handright / _template.py View on Github external
def __eq__(self, other) -> bool:
        return (isinstance(other, Template)
                and self._background == other._background
                and self._line_spacing == other._line_spacing
                and self._line_spacing_sigma == other._line_spacing_sigma
                and self._font_size == other._font_size
                and self._font_size_sigma == other._font_size_sigma
                and self._font == other._font
                and self._fill == other._fill
                and self._left_margin == other._left_margin
                and self._top_margin == other._top_margin
                and self._right_margin == other._right_margin
                and self._bottom_margin == other._bottom_margin
                and self._word_spacing == other._word_spacing
                and self._word_spacing_sigma == other._word_spacing_sigma
                and self._end_chars == other._end_chars
                and self._perturb_x_sigma == other._perturb_x_sigma
                and self._perturb_y_sigma == other._perturb_y_sigma

handright

A lightweight Python library for simulating Chinese handwriting

BSD-3-Clause
Latest version published 8 months ago

Package Health Score

65 / 100
Full package analysis

Similar packages