Skip to main content

genSty

GitHub release (latest by date including pre-releases) PyPI - Status PyPI version PyPI - Python Version License

GenSty is a LaTex style package generator for OpenType fonts (otf/ttf) which supports W3C SMuFL notation. With gensty you can generate your LaTeX package based on any OpenType font; the generator parses ttf/otf files and creates LaTeX commands for all Unicode Symbols. In the case of SMuFL fonts, you can also include the glyphnames.json file, so it will create friendlier names and include "Private Use" symbols.

Installation

Use the package manager pip to install foobar.

pip install gensty

Installation (manual)

Clone the repository

git clone git@github.com:tsotsos/genSty.git

and then use from the top folder. Eg.

python3 -m gensty -h

Usage

As referred above, the package can be used directly, installed from pip, and as a module. In case of command line the script can be used :

gensty -h

usage: genSty [-h] [--version] [--all] [--smufl SMUFL]
              [--one-package ONE_PACKAGE] [--author AUTHOR] [--ver VER]
              path

LaTeX Style file generator for fonts

positional arguments:
  path                  Font(s) path. It can be either a directory in case of
                        multiple fonts or file path.

optional arguments:
  -h, --help            show this help message and exit
  --version, -v         show program's version number and exit
  --all, -a             If choosed genSty will generate LaTeX Styles for all
                        fonts in directory
  --smufl SMUFL, -s SMUFL
                        If choosed genSty will generate LaTeX Styles for all
                        fonts in directory based on glyphnames provided.
  --one-package ONE_PACKAGE
                        Creates one package with name provided by this
                        argument.
  --author AUTHOR       Author's name.
  --ver VER             LaTeX package version.

Use as a module

Use the module to create LaTeXstyle instances and handle generated latex code yourself.

import gensty

# Generate LaTeXstyle instance from font file:

latexObj = font.LaTeXstyle(author,version, "path/to/font.otf",smufl)

# then you can get for latexObj,Header(), DefCommands(), Commands() or File()

Use them module to create the LaTeX package in filesystem.

import gensty

# Use the same functions as gensty CLI and handle both folder or font file
# input (path can be either font file or folder including fonts).
# Then using savePackage you can save the generated output to disk
# accorndingly.
# smufl is the path to glyphnames.json which is defined according to W3C
# Specifications https://www.w3.org/2019/03/smufl13/specification/glyphnames.html

# prepare fonts. author, version and smuf, can be None.
fonts = prepareFonts(path, version, author, smufl)

# packageName and forcedCommand can be None. They are used to force LaTeX
# pacakage name and commands respectively.
fontnames, fontfiles, files = makePackage(fonts, packageName, forcedCommand)

# creates font package in file system.
savePackage(fontnames, fontfiles, files, packageName)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Release files for gensty 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gensty 0.3.1
File Size Uploaded
gensty-0.3.1.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gensty 0.3.1
File Interpreter ABI Platform
gensty-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.6 kB

Release files / gensty-0.3.1.tar.gz

Download URL gensty-0.3.1.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0cad000826fd5aed492f78a63cc359e51a0b4c9b33817cd50b978cac9b72f91c
BLAKE2b-256 checksum
How to use checksums
1fbb6ed1ea19883158bbc7a691acb23fdc6213dd5d72aa9e422ef92dcab376bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / gensty-0.3.1-py3-none-any.whl

Download URL gensty-0.3.1-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2dcfab0dbac932b8d0370e227eaa49afff58300a787734bf4f17d54fe1aa314f
BLAKE2b-256 checksum
How to use checksums
8480bbc452576f1ec1d58a5d4fcca07b8ebafcead4e83a918011451dd86602d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page