diff --git a/README.md b/README.md new file mode 100644 index 00000000..669c7049 --- /dev/null +++ b/README.md @@ -0,0 +1,111 @@ +![GitHub Actions Build Status][] ![Python Versions][] [![PyPI +Version][]][1] + +# fontmake + +`fontmake` compiles fonts from various sources (`.glyphs`, `.ufo`, `designspace`) into binaries (`.otf`, `.ttf`). You can use it to create static instances and variable fonts. + +## Installation + +Fontmake requires Python 3.7 or later. + +Releases are available on [PyPI][] and can be installed with [pip][]. + +``` bash +pip3 install fontmake +``` + +Use the `-U`, `--upgrade` option to update fontmake and its dependencies +to the newest available release: + +``` bash +pip3 install -U fontmake +``` + +## Basic Usage + +After installation, you will be able to use the `fontmake` executable. + +For example, to compile a variable font from a Glyphs source file, use: + +``` bash +fontmake -g MyFont.glyphs -o variable +``` + +The most important command line arguments to the `fontmake` executable are the `-g`/`-u`/`-m` flags, one of which is required and selects the source file format, and the optional `-o` flag, which chooses the output file format. + +### Source file format options + +* `-g filename.glyphs`: Converts a Glyphs source file to binary. +* `-u filename.ufo ...`: Converts one or more UFO files to binary. +* `-m filename.designspace`: Converts a Designspace file to binary. (The `-m` is for `mutatormath`, an old Python library for handling designspaces.) + +### Output file format options + +You may provide one or more output file formats after the `-o` option. For example, `-o otf ttf` creates OTF and TTF binary font files for each master in your input file. + +The following output file formats are available: + +* `otf`: Per-master OTF (CFF-outline) binaries. Placed in the `master_otf/` directory. +* `ttf`: Per-master TTF (TrueType-outline) binaries. Placed in the `master_ttf/` directory. +* `otf-cff2`: Per-master OTF binaries with CFF2 outlines. Placed in the `master_otf/` directory. +* `variable`: A TrueType variable font. Placed in the `variable_ttf/` directory. +* `variable-cff2`: A variable font with CFF2 outlines. Placed in the `variable_otf/` directory. + +The following output file formats are also available, but are generally used internally by fontmake as an intermediate step to one of the above outputs: + +* `otf-interpolatable`: OTF binaries suitable for merging into a variable font. Placed in the `master_otf_interpolatable/` directory. (These differ from `otf` in that the outlines are unoptimized.) +* `ttf-interpolatable`: TTF binaries suitable for merging into a variable font. Placed in the `master_ttf_interpolatable/` directory. (The outlines are converted to quadratic curves in an interpolation-compatible way.) +* `ufo`: Glyphs sources can be converted to UFO. Placed in the `master_ufo/` directory. + +If no format option is specified, the default is `-o otf ttf`. + +### Other important command line options + +* `-i` (Interpolate instances): Having per-master binaries is not always what you expect; if you have defined instances ("exports") in your Glyphs file, they will *not* be generated by default. To generate them, pass the `-i` flag, which interpolates static instances, and places them in the `instance_ttf/` or `instance_otf/` directory as appropriate. + +* `--output-dir `: Places all output in the given directory, instead of the per-format directories mentioned above. + +* `--output-path `: This is only valid if the output is a single binary file, and writes the output to the given filename. + +* `-f` (Flatten components): Ensures that any glyphs which contain components which *themselves* contain components are decomposed to a single level. This is recommended as certain rendering environments do not correctly handle nested components - see [this link](https://github.com/googlefonts/fontbakery/issues/2961) for more details. + +## Advanced Usage + +See [`USAGE.md`](USAGE.md). + +## Troubleshooting + +See [`TROUBLESHOOTING.md`](TROUBLESHOOTING.md). + +## Developers + +Developers can get the latest version of `fontmake` by cloning the git repository: + +``` bash +git clone https://github.com/googlefonts/fontmake +cd fontmake +pip install . +``` + +Developers who want to quickly test changes to the source code without re-installing can use the "--editable" option when installing from a local source checkout: + +``` bash +pip install -e . +``` + +It is recommended to install fontmake inside a virtual environment to +prevent conflicts between its dependencies and other modules installed +globally. + +You could also use the [pipx][] tool to automate the +installation/upgrade of python apps like fontmake in isolated +environments. + + [GitHub Actions Build Status]: https://github.com/googlefonts/fontmake/workflows/Test%20+%20Deploy/badge.svg + [Python Versions]: https://img.shields.io/badge/python-3.7-blue.svg + [PyPI Version]: https://img.shields.io/pypi/v/fontmake.svg + [1]: https://pypi.org/project/fontmake/ + [PyPI]: https://pypi.org/project/fontmake + [pip]: https://pip.pypa.io + [pipx]: https://github.com/pipxproject/pipx diff --git a/README.rst b/README.rst deleted file mode 100644 index ec8d26a2..00000000 --- a/README.rst +++ /dev/null @@ -1,76 +0,0 @@ -|GitHub Actions Build Status| |Python Versions| |PyPI Version| - -fontmake -======== - -This library provides a wrapper for several other Python libraries which -together compile fonts from various sources (.glyphs, .ufo) into -binaries (.otf, .ttf). - - -Installation -~~~~~~~~~~~~ - -Fontmake requires Python 3.7 or later. - -Releases are available on `PyPI`_ and can be installed with `pip`_. - -.. code:: bash - - pip install fontmake - -Use the ``-U``, ``--upgrade`` option to update fontmake and its dependencies -to the newest available release: - -.. code:: bash - - pip install -U fontmake - -Alternatively, you can download the git repository and install from source: - -.. code:: bash - - git clone https://github.com/googlefonts/fontmake - cd fontmake - pip install . - -Developers who want to quickly test changes to the source code without -re-installing, can use the "--editable" option when installing from a local -source checkout: - -.. code:: bash - - pip install -e . - -It is recommended to install fontmake inside a "virtual environment" to prevent -conflicts between its dependencies and other modules installed globally. - -You could also use the `pipx`_ tool to automate the installation/upgrade of -python apps like fontmake in isolated environments. - -Usage -~~~~~ - -After installation, you can use the ``fontmake`` console script. For example: - -.. code:: bash - - fontmake -g MyFont.glyphs # outputs binary font files for masters only - -Use ``fontmake -h`` to see options for specifying different types of input and -output. - -You can also use fontmake as a module to run intermediate steps in the build -process, via methods of the ``fontmake.font_project.FontProject`` class. - -.. _virtualenv: https://virtualenv.pypa.io -.. _venv: https://docs.python.org/3/library/venv.html -.. _pip: https://pip.pypa.io -.. _pip documentation: https://pip.readthedocs.io/en/stable/user_guide/#requirements-files -.. _PyPI: https://pypi.org/project/fontmake -.. _Github releases: https://github.com/googlefonts/fontmake/releases -.. _pipx: https://github.com/pipxproject/pipx -.. |GitHub Actions Build Status| image:: https://github.com/googlefonts/fontmake/workflows/Test%20+%20Deploy/badge.svg -.. |Python Versions| image:: https://img.shields.io/badge/python-3.7-blue.svg -.. |PyPI Version| image:: https://img.shields.io/pypi/v/fontmake.svg - :target: https://pypi.org/project/fontmake/ diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md new file mode 100644 index 00000000..45136d67 --- /dev/null +++ b/TROUBLESHOOTING.md @@ -0,0 +1,27 @@ +# Troubleshooting + +Sometimes things go wrong with `fontmake`, and you will need to track down what happened. In such circumstances, it is best to remember that `fontmake` itself does not actually do very much; its job is merely to orchestrate calls to different Python libraries which perform the compilation steps. So: + +* If something goes wrong with converting Glyphs files to `.designspace` and `.ufo` files, that's probably a problem with [`glyphsLib`](https://github.com/googlefonts/glyphsLib). +* Run pre-processing filters: + * If something goes wrong converting cubics to quadratics, that's probably a problem with [`cu2qu`](https://github.com/googlefonts/cu2qu). + * If something goes wrong when decomposing mixed glyphs, that's probably a problem with [`ufo2ft.filters.decomposeComponents`](https://github.com/googlefonts/ufo2ft/blob/main/Lib/ufo2ft/filters/decomposeComponents.py). + * If something goes wrong when removing overlaps, that's probably a problem with [`booleanOperations`](https://github.com/typemytype/booleanOperations) +* Anything else that goes wrong is probably a problem with [`ufo2ft`](https://github.com/googlefonts/ufo2ft), except... +* ...if something goes wrong when compiling multiple files into a variable font, that's probably a problem with [`fontTools.varLib`](https://github.com/fonttools/fonttools/tree/main/Lib/fontTools/varLib). + +In other words, any problems you experience are generally *not* problems with `fontmake`. But it's important to know at which point things went wrong, and which Python library was handling your font at the time. + +To do this, you can follow the following troubleshooting steps: + +## Troubleshooting steps + +* If your design source is a Glyphs file, the first step that `fontmake` will peform is to using `glyphsLib` to convert the file to masters + designspace and place them in the `master_ufo` directory. So a good start is to inspect the files in this directory and make sure that they look the way you would expect them to look. Pay particular attention to the axis ranges of multiple-axis fonts and the positions of masters and instances on these axes in the `.designspace` file. If this is correct, you can use `fontmake -m` on the `.designspace` file to skip the Glyphs conversion step on subsequent runs. + +* Once you have UFO files (or if you started with them in the first place), it can be helpful to pass the `--validate-ufo` flag to `fontmake` to check that the UFO files are valid and correct. + +* Next, if you receive an error from `fontmake`, you can get the full traceback by changing the log level by passing the `--verbose DEBUG` flag. Please pass this flag before filing any issues - although often the full traceback will point you to the source of the problem! + +* Finally, you can debug the operation of the feature writers by passing the `--debug-feature-file ` flag. This will cause `fontmake` to write out the generated feature file to a known filename, allowing you to inspect the file afterwards and check that it is as expected. + +If none of these steps are helpful, please file an issue in the `fontmake` repository, or in the repository of the Python library responsible for the problem. diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 00000000..9e8133da --- /dev/null +++ b/USAGE.md @@ -0,0 +1,198 @@ +# Advanced Usage + +This guide assumes that you have read the basic instructions in `README.md`. + +## Functional overview + +`fontmake` has many more options than the basic ones outlined in `README.md`. +These options customize various elements of the font compilation process, and so +to understand the options, it helps to understand the general outline of the +process by which `fontmake` creates binary fonts. + +Here are the basic operations: + +* Convert Glyphs file to `.designspace` and `.ufo` files. +* Run pre-processing filters. (Convert cubics to quadratics for TTF outlines, decompose mixed glyphs, remove overlaps, etc.) +* Generate explicit feature files. (Turn anchor and kerning information in source file into Adobe feature file syntax, so that it can be compiled into OpenType layout.) +* Create outlines. +* Build OpenType tables. +* Run post-processing filters. (Rename glyphs to production names.) + +For most people, the default settings will produce optimal results, but in some situations you may wish to alter the default operation. + +## General options + +* `--no-production-names`: By default, `fontmake` renames the glyphs in the output binary font file during post-processing based on the value of the `public.postscriptNames` lib key in the UFO file. (In the case of Glyphs source files, conversion to UFO populates this lib key with the production names from the Glyphs file.) Any encoded glyphs without production names are renamed to `uniXXXX` based on their Unicode code point, unencoded ligature glyphs are renamed based on the production names of their components, and other unencoded glyphs are not renamed. The `--no-production-names` flag suppresses all glyph renaming. + +* `-a`/`-a ""`: Run ttfautohint on TrueType output binary font files. If any arguments are provided in a quoted string, these are passed to the `ttfautohint` binary. + +* `--mti-source `: Instead of generating feature files from the design sources, this takes an external plist file which links masters to Monotype FontDame feature definition files. You may safely ignore this option unless you are compiling Monotype-supplied font sources for the Noto project. + +## Options for Glyphs sources + +* `--no-write-skipexportglyphs`: When converting the Glyphs sources to UFO, all glyphs, even glyphs not set to be exported into the font, are converted to UFO format. Glyphs which are set as unexported are listed in the `public.skipExportGlyphs` lib key of the UFO and designspace files. Before this key was standardized by UFO, older versions of `fontmake` would use a private lib key, `com.schriftgestaltung.Glyphs.Export` instead. If you are managing a workflow which tracks files created by an older version of `fontmake`, you may wish to use this flag to use the older lib key and maintain compatibility with those files. + +* `--instance-dir `: When generating static instances from Glyphs sources with the `-i` flag, `fontmake` writes UFO files representing the instances to the `instance_ufo` directory by default before compiling them to binary. This flag directs `fontmake` to write these temporary UFO files to another directory. If you pass the special value `{tmp}`, `fontmake` uses a temporary directory which it removes after processing. + +* `--master-dir `: Similarly, this specifies the directory to be used when writing UFO files representing the font masters. + +* `--designspace-path `: When converting the masters to UFO, `fontmake` also creates a Designspace file in the `master_ufo` directory. This option specifies the path where the Designspace file should be written. + +* `--family-name `: When this flag is provided, the masters are given the family name supplied, and only instances containing that family name are exported. For example, you can use this to create multiple optical-size-specific subfamilies from a single Glyphs file; `--family-name "MyFont 12pt"` will set the family name to `MyFont 12pt` and only export the instances which contain `MyFont 12pt` in the `familyName` custom parameter of the instance definition. + +* `--subset` / `--no-subset`: By default, `fontmake` determines whether or not to subset an instance based on the presence or absence of "Keep Glyphs" custom parameter on the instance. To turn off subsetting despite the presence of a "Keep Glyphs" custom parameter, use the `--no-subset` flag. + +## Options for TrueType outlines + +* `--keep-overlaps`: By default, `fontmake` performs overlap removal on TrueType outlines, except when producing interpolatable or variable fonts. This flag directs `fontmake` to skip the overlap removal preprocessing step. + +* `--overlaps-backend booleanOperations|pathops`: Chooses the library for overlap removal. Skia's pathops library is faster but requires an additional library to be installed, and also appears to [fail on some glyphs](https://github.com/google/fonts/issues/3365), hence the default is the `booleanOperations` library. + +* `--no-optimize-gvar`: When compiling a variable font, the variation information is stored in a table called the `gvar` table inside the binary. OpenType allows fonts to omit some variations in the outlines if the variation information can be inferred from the surrounding points - for example, points along a line will often change at a rate determined by the average of the variations of their neighbours. Omitting variations for such points makes the font size smaller, so `fontmake` performs this optimization by default: this is called "Interpolation of Untouched Points", or IUP. This flag turns off the IUP optimization. + +* `--keep-direction`: Generally speaking, filled outlines in a TrueType font should have their points arranged in clockwise order and counter outlines should have their points in anti-clockwise order; design tools tend to order contours the other way around, so `fontmake` reverses the outlines when generating TrueType fonts. This flag keeps the outline direction as specified in the font source. + +* `--conversion-error ERROR`: When TrueType outlines are converted to binary, the curves are converted from cubic Béziers in the design sources to quadratic Bézier splines. However, as this conversion involves a degree reduction, it is not completely accurate, and hence the quadratic curves approximate the cubic originals. This flag controls the maximum permissible error, measured in ems. the default is 0.001, or one unit at 1000upm. Larger values will result in smaller font sizes, particularly for CJK fonts, but at the cost of fidelity to the original curves. + +* `--no-generate-GDEF`: As part of generating explicit feature files, `fontmake` uses the glyph categories in the source file to create a `table GDEF { ... } GDEF;` statement in the generated feature file; this is then compiled into the `GDEF` table of the font binaries. However, if the feature file in your source *also* contains a `table GDEF` statement, the font will fail to compile. In this case, you can add the `--no-generate-GDEF` flag to turn off writing an additional `table GDEF` statement in the generated feature file. + +## Options for CFF outlines + +* `--cff-round-tolerance FLOAT`: Controls the way that point coordinates are rounded in the CFF table. The default value of 0.5 rounds points to the nearest integer. Setting this value to 0 disables all coordinate rouding. + +* `--optimize-cff VALUE`: By default, the CFF table is compressed in two ways: in *specialization*, drawing operations are chosen which most efficiently express the contour. For example, where there is a horizontal line, it is more efficient to use the specialized `hlineto` drawing operator instead of the more general `lineto` operator, as the `lineto` operator takes two parameters (`dx dy`) and `dy` will always be zero in the case of horizontal lines, whereas `hlineto` only takes a `dx` parameter. + +Additionally, there is *subroutinization*, which places common sequences of operations into subroutines; this is somewhat similar to components, but at a lower level - for example, a stem with a serif which occurs in multiple glyphs might be subroutinized. + +This flag controls the degree of compression: 0 disables all optimizations; 1 applies specialization but disables subroutinization; and 2, the default, applies both specialization and subroutinization. You may want this flag if you are debugging CFF tables and want to compare the drawing operators more directly against the source outlines. + +* `--subroutinizer compreffor|cffsubr`: The work of CFF subroutinization, as described above, is one of the many things in `fontmake` that are outsourced to a separate Python library. The two libraries used are `compreffor` (the default for CFF1 - indeed, it only supports CFF1) and `cffsubr` (the default for CFF2). If you want to see whether `cffsubr` compresses the font better, you can use this flag to change the library used for subroutinization. + +## Options for instance generation + +* `-i `: `-i` was introduced in the Basic Usage section for interpolating masters and generating instances. The flag may also be followed by an argument which is a string or regular expression; if this is provided, then only those instances which match the string will be generated. For example,`-i "Noto Sans Bold"`; `-i ".* UI Condensed"`. + +* `--use-mutatormath`: When generating instances from a designspace file, there are (again) two possible Python libraries which perform the interpolation: fontmake's internal `instantiator` module, and `mutatormath`. `instantiator` is a deliberately minimal implementation which works in most cases, but it does not support extrapolation (instances whose coordinates are placed outside of the range of the masters) or anisotropic locations (axes which have different degrees of variation on the X axis to the Y axis; these are not possible in OpenType variable fonts, but can be used to generate static instances in Fontlab VI and some Robofont extensions). + +* `-M`, `--masters-as-instances`: This flag causes `fontmake` to also create instance binaries for each master defined in the font, even if they are not explicitly exported as instances by default. + +* `--round-instances`: This option rounds glyph outlines when generating instances. (XXX Surely they're rounded to ints when they're written to the `glyf` table anyway. What does this actually do?) + +* `--expand-features-to-instances`: If any feature files within the design sources contain `include()` statements, and these statements contain a relative path, instances may fail to build because they are being compiled in a different directory to the original where the included feature files cannot be found. In that case, you should use this flag to expand all the `include()` statements before the instance is compiled. We know that you shouldn't have to do this by hand, and we will make it the default one day. + +* `--interpolate-binary-layout `: When `fontmake` generates instances, it creates a feature file for each master using feature writers, but it also creates an *interpolated* feature file using feature writers for static instances. But while feature writers can interpolate kerning and anchor positions, they do *not* interpolate explicit `pos` statements given in the source feature files - nor do they interpolate layout rules expressed in MonoType FontDame format. (See the `--mti-source` option.) In order to perform this interpolation, `fontmake` needs to build the binary master files and interpolate the GPOS tables directly, rather than the textual representation of layout rules. Hence, if you have explicit `pos` statements in the feature files of your masters and you need these to interpolate in instances, use this flag. + +## Outline Filtering + +As mentioned in the functional overview, `fontmake` has two "filtering" passes, a "preprocessing" pass on the UFO files which converts cubics to quadratics for TTF glyphs, removes overlaps, and so on, and a "postprocessing" pass on the output binary files. It is possible to add your own filters into this pipeline to further customize the font building process, and to achieve custom effects similar to Glyphs export filters. + +This can be done in two ways: either by writing, manually or automatically, entries into a `lib` key (`com.github.googlei18n.ufo2ft.filters`) in the `.designspace` or UFO file, or on the command line. For example, when converting from Glyphs to UFO, `fontmake` (via the `glyphsLib` library) adds the following entry to the UFO `lib.plist`: + +```xml + com.github.googlei18n.ufo2ft.filters + + + name + eraseOpenCorners + namespace + glyphsLib.filters + pre + + + +``` + +This calls the `EraseOpenCornersFilter` class from the Python module `glyphsLib.filters.eraseOpenCorners` as part of the `pre`-processing step, which converts any external open corners in the glyph outlines into plain corners. + +Any Python class inheriting from [`ufo2ft.filters.BaseFilter`](https://github.com/googlefonts/ufo2ft/blob/main/Lib/ufo2ft/filters/base.py) can be used as a filter, although the `namespace` must be provided, as in this case. Filters available through the `ufo2ft` library do not require a `namespace` key, as this library is the default source of filters. Filters can be further customized through optional arguments, as described below. + +To apply filters via a command-line, use the `--filter` argument with the following syntax: `--filter "python.package::ClassName(argument,argument)`; add the pseudo-argument `pre=True` to run the filter as a preprocessing step. For example, to use the `ufostroker` library to apply "noodling" effects to open paths in a source font, use `--filter 'ufostroker::StrokeFilter(Width=50,pre=True)`. + +### Included filters + +The `ufo2ft` library provides some default filters described below. Most of the filters are called automatically as part of `fontmake`'s ordinary pipeline, but some can be added manually. The filters are run in the following order: + +* (Any manually added pre-filters are called first.) + +* `ExplodeColorLayerGlyphs`: Called automatically to create glyphs out of color layers when constructing a `COLR` font with `colorPalettes` and `colorLayerMapping` lib keys. + +* `DecomposeComponents`: Called automatically when producing OTF outlines, and called on glyphs which have components *and* outlines when producing TTF binaries. + +* `FlattenComponents`: Called automatically to flatten nested components when the `-f` flag is passed to `fontmake`. + +* `RemoveOverlaps`: Called automatically to remove overlaps. + +* `CubicToQuadratic`: Called automatically when producing TTF binaries. + +* (Any manually added post-filters are called last.) + +Other filters available as part of `ufo2ft` are: + +* `DecomposeTransformedComponents`: Decomposes any components which have a non-identity transformation matrix (i.e. which are translated or scaled). For example, a `u` glyph from an `n` component flipped horizontally. Fonts constructed in this way can have rasterizing and hinting errors (see [here](https://github.com/googlefonts/fontmake/issues/253) and [here](https://github.com/googlefonts/fontbakery/issues/2011)). To fix fonts with these errors, add `--filter DecomposeTransformedComponentsFilter` to the `fontmake` command line. + +* `PropagateAnchors`: Creates additional anchors for composite glyphs based on the anchors of their components. + +* `SortContours`: Sorts the contours based on their bounding box size. Can be added manually to alleviate overlap removal bugs, but must be manually placed in the UFO lib so that it is executed between `DecomposeComponents` and `RemoveOverlaps`. + +* `Transformations`: Similar to the Glyphs "Transformations" filter, this allows for outlines to be scaled, translated or transformed on export. For example, to scale down and raise up the glyphs "A" and "B" of a font, add this to the lib file: + +```xml + com.github.googlei18n.ufo2ft.filters + + + name + transformations + kwargs + + OffsetX + 0 + OffsetY + 150 + ScaleX + 75 + ScaleY + 75 + + include + + A + B + + + +``` + +## Feature writing + +In a similar vein to the filter classes, `fontmake` allows you to customize the way that kerning and anchor rules in the font sources are turned into explicit rules in the autogenerated feature file. These generated rules are written by classes called feature writers. The feature writers can also be customized with a lib key, `com.github.googlei18n.ufo2ft.featureWriters`. + +For example, all feature writers take the `mode` option, which takes either the value `append` or `skip`. The default is `skip`, which will skip writing the feature if the feature is already explicitly present in the design sources' features file. + +> However, note that even in `skip` mode, if the existing feature code contains the magic string `# Automatic Code`, the feature code generated by fontmake will be inserted into the feature file at the location of the comment. + +To change this to `append` for the kern feature writer (i.e. to add generated kerning rules from the kerning table onto the end of the manually supplied `kern` feature), you would add the following lib key: + +```xml + com.github.googlei18n.ufo2ft.featureWriters + + + class + KernFeatureWriter + options + + mode + append + + + +``` + +There is also a `--feature-writer` option, analogous to `--filters`, allowing you to load custom feature writers on the command line. The special value `--feature-writer "None"` disables all automatic feature generation. + +`ufo2ft` provides three feature writer classes: + +* `GdefFeatureWriter` generates the `table GDEF { } GDEF;` statement, based on the categories of the glyphs (stored in the `public.openTypeCategories` lib key of the source font) and ligature caret anchors (anchors starting with `caret_` or `vcaret_`). It has no customizable parameters. It can be disabled with the `--no-generate-GDEF` flag. + +* `KernFeatureWriter` generates kerning features (or, for certain complex scripts, `dist` features) based on the kerning information in the design sources. It has two optional parameters in addition to `mode`: `ignoreMarks`, which defaults to `True`, will emit an `LookupFlag IgnoreMarks` in the generated `kern` feature; setting this to `False` will generate kern rules which do not ignore mark glyphs. Additionally, `quantization` can be set to an integer value to round the kern rules to the nearest multiple of its value, which can help with compressing the tables. + +* `MarkFeatureWriter` generates `mark` and `mkmk` features based on the anchor information in the design sources. It has one optional parameter, `quantization`, which rounds the anchor positions to the nearest multiple of its value, which makes anchors more likely to be shared in the `GPOS` table, potentially reducing its size at the expense of some fidelity. diff --git a/setup.py b/setup.py index 860b4384..4cb59f0d 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ needs_wheel = {"bdist_wheel"}.intersection(sys.argv) wheel = ["wheel"] if needs_wheel else [] -with open("README.rst", "r", encoding="utf-8") as f: +with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() extras_require = { @@ -45,6 +45,7 @@ "Compile fonts from sources (UFO, Glyphs) to binary (OpenType, TrueType)." ), long_description=long_description, + long_description_content_type="text/markdown", url="https://github.com/googlei18n/fontmake", license="Apache Software License 2.0", packages=find_packages("Lib"),