# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-ufonormalizer VERSION= 0.6.3 KEYWORDS= python VARIANTS= v14 v15 SDESC[v14]= Normalization of XML data of a UFO (3.14) SDESC[v15]= Normalization of XML data of a UFO (3.15) HOMEPAGE= https://github.com/unified-font-object/ufoNormalizer CONTACT= Python_Automaton[python@ravenports.com] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/e9/5b/b6751a54387344cb7cef779a231df68dea77b7adbbab924f5e4f2056cedb DISTFILE[1]= ufonormalizer-0.6.3-py3-none-any.whl:main DIST_SUBDIR= python-src DF_INDEX= 1 SPKGS[v14]= single SPKGS[v15]= single OPTIONS_AVAILABLE= PY314 PY315 OPTIONS_STANDARD= none VOPTS[v14]= PY314=ON PY315=OFF VOPTS[v15]= PY314=OFF PY315=ON DISTNAME= ufonormalizer-0.6.3.dist-info GENERATED= yes [PY314].USES_ON= python:v14,wheel [PY315].USES_ON= python:v15,wheel [FILE:2500:descriptions/desc.single] [Coverage Status] ![Python Versions] [PyPI Version] # ufoNormalizer Provides a standard formatting so that there are meaningful diffs in version control rather than formatting noise. Examples of formatting applied by ufoNormalizer include: - Changing floating-point numbers to integers where it doesn't alter the value (e.g. `x="95.0"` becomes `x="95"` ) - Rounding floating-point numbers to 10 digits - Formatting XML with tabs rather than spaces ## Usage in RoboFont RoboFont comes with ufoNormalizer pre-installed, and you can set a preference to normalize UFOs on save. Simply open the Scripting Window and run the following code: ``` from mojo.UI import setDefault, getDefault setDefault("shouldNormalizeOnSave", True) print("shouldNormalizeOnSave is set to " + str(getDefault("shouldNormalizeOnSave"))) ``` ## Advanced usage ### Installation Install these tools using the [pip] package [hosted on PyPI]: ``` pip install --upgrade ufonormalizer ``` ### Command line Use on the command line: ``` ufonormalizer /font.ufo ``` To view all arguments, run: ``` ufonormalizer --help ``` Note: if you are working on a UFO within RoboFont and run ufoNormalizer on that UFO, RoboFont will notify you that the UFO has been updated externally. Simply accept this by selecting "Update." ### Automating via Git hooks Beyond basic command-line usage, ufoNormalizer can be used in an automated manner. Of course, you can automate it to run from a shell script or a Python script. One useful possibility is using it within a Git hook. > Git hooks are scripts that Git executes before or after events such as: commit, push, and receive. Git hooks are a built-in feature - no need to download anything. Git hooks are run locally. – from [Git Hooks] It's easy to set up a git hook that will normalize ufos in a project immediately before each commit, ensuring that you only ever commit clean UFO data. In a Git project, navigate to `/.git/hooks` and replace `pre-commit.sample` with the following code, then remove the file extension: ```bash #!/bin/sh # A hook script to verify what is about to be committed. # Called by "git commit" with no arguments. # # Uses bash syntax to call arguments as needed. # # To enable this hook, save this to /.git/hooks/pre-commit (with no file extension) set -e for ufo in ./*.ufo; do ufonormalizer "$ufo" done ``` Now, each time you commit, all `.ufo`s in your Git project will be normalized before being recorded by Git. [FILE:126:distinfo] 09015963e0fec72ca96f2128bcace869990dead40e8f4872a02a014d2a2f024f 18320 python-src/ufonormalizer-0.6.3-py3-none-any.whl