8291 Commits

Author SHA1 Message Date
Simon Cozens
ecc764ecc0
[docs] Document cu2qu library (#1937)
[docs] Document cu2qu library

Reorganise the documentation so that everything is in one place and users are more clearly pointed to the modules which are likely to be useful for their purposes. (I still think it’s worth having at least a brief reference to ``cu2qu.cli`` in there, as a way of reminding users that there is a command-line implementation.) Docstrings are provided for non-API methods where I could understand them - trusting these will be useful for future maintainers.
2020-05-15 10:53:41 +01:00
Cosimo Lupo
3d705b29de
add 'fontTools' package to default pytest testpaths
so that it will run the embedded doctests when simply invoking 'pytest' with no arguments

see https://github.com/fonttools/fonttools/pull/1957#issuecomment-629116982
2020-05-15 10:42:59 +01:00
Cosimo Lupo
d3bd81335e
Merge pull request #1958 from anthrotype/tox-skip-missing-interpreters
tox: add skip_missing_interpreters=true
2020-05-15 10:30:06 +01:00
Cosimo Lupo
0c3efde05e
developer.rst: minor editorial change [skip ci] 2020-05-15 10:23:34 +01:00
Cosimo Lupo
c1f6b4d0f1
tox: add skip_missing_interpreters=true
https://tox.readthedocs.io/en/latest/config.html#conf-skip_missing_interpreters

Runing `tox` with no options runs the tests agaist all the python
environments listed in the `tox.ini`'s `envlist` (currently 3.6, 3.7 and 3.8).

Before this change, if any of these versions was not available, tox would exit with an error. Now it will simply continue (with a warning).

This can be useful when on a developer box, one might only have a subset of all our supported interpreters installed but we don’t want to mark the build as failed because of it.

Note that on the CI I am passing the opposite command line switch to override this setting, because there I want to make sure none of the specified interpreters is skipped.
2020-05-15 10:06:35 +01:00
Simon Cozens
8d32a24710
[docs] Source documentation for cffLib (#1935)
* [docs] Source documentation for cffLib

* Address feedback
2020-05-14 17:04:34 +01:00
Cosimo Lupo
847c31c4f2
Merge pull request #1786 from anthrotype/ufo-minor-format-version
ufoLib: support UFO formatVersionMinor and GLIF formatMinor
2020-05-14 12:09:06 +01:00
Cosimo Lupo
f4752fd412
Merge remote-tracking branch 'origin/master' into ufo-minor-format-version 2020-05-14 11:01:39 +01:00
Simon Cozens
f3f2793444
[docs] Document fontTools.merge (#1949)
[docs] Document fontTools.merge
2020-05-14 10:06:13 +01:00
Nikolaus Waxweiler
37beca3a33
Merge pull request #1954 from fonttools/fix-test_addRuleDescriptor
Fix test_addRuleDescriptor
2020-05-13 16:36:19 +01:00
Nikolaus Waxweiler
b07940421d Fix test_addRuleDescriptor
Use API correctly.
2020-05-13 15:45:27 +01:00
Cosimo Lupo
abf70934bc
Merge pull request #1952 from anthrotype/fix-merge-os2-mixed-versions
[merge] Fix merging different versions of OS/2 table
2020-05-13 14:33:01 +01:00
Cosimo Lupo
b6601f61ec
merge: handle OS/2 attributes only present in subsequent versions
Also, implement merging version 5 (by taking the min/max of the optical
point sizes), and rename `usMaxContex` to the correct name `usMaxContext`.
The typo was fixed in the OS/2 table some time ago, but we forgot to
also update the merge module.

Fixes #1865
2020-05-13 13:12:31 +01:00
Cosimo Lupo
669b1395cb
merge_test: test merging all possible OS/2 versions with one another 2020-05-13 13:07:17 +01:00
Simon Cozens
c89c9487f1
[docs] encodings library (#1940)
Document the ``encodings.codecs`` part which might be useful to some people, and add a brief note about MacRoman.
2020-05-13 10:22:06 +01:00
Cosimo Lupo
842289c00e
Merge pull request #1944 from anthrotype/fix-subset-context-format-3
subset: fix AttributeError while subsetting Context{Subst,Pos} Format 3
2020-05-13 10:19:10 +01:00
Simon Cozens
ca8703f653
[docs] Document feaLib (#1941)
[docs] Document feaLib

* Rearrange docs by user intention, highlighting the things you can do with each component.
* Remove reference to lexer and error modules from documentation tree, since they’re not user-facing.
* I’ve added docstrings to the parser even though we only provide access to the user-facing part of the API in the main documentation, just to clarify what some of the more obscure methods do and provide links to the spec.
* AST *is* user-facing if you’re building your own feature files in code, so all classes are documented with the user in mind.
2020-05-12 23:11:17 +01:00
Simon Cozens
089f24da6b
Ensure all fonttools CLI tools have help documentation (#1948)
Note UI change : `fonttools varLib.models` now takes prefixed options `-d` or `-l` instead of guessing the intended feature from the number of arguments.

We have a number of command line tools which are somewhat opaque. (varLib.models in particular was very confusing.) This ensures that they all use argparse to have a consistent interface, and all have --help documentation which at least details their parameters, and hopefully therefore gives more of a clue about what they do. Those which use logging have had a command-line logging parameter added.
2020-05-12 15:11:30 +01:00
Simon Cozens
a114ec2c20
[docs] Reorganise colorLib docs (#1936)
Does not add any new documentation (there is already some documentation for user-facing functions). It just makes colorLib.builder the top-level documentation entry, because that’s the part the user needs to care about.
2020-05-12 11:19:17 +01:00
Simon Cozens
94cb1759f7
[docs] Document afmLib (#1933) 2020-05-12 11:18:36 +01:00
Simon Cozens
2cef07af80
[doc] Add help options to fonttools CLI (#1920)
This adds a `help` verb (and `--help` option) to the `fonttools` command line tool. Submodules will be listed in the help text if they have an importable `main` function with a docstring, and `main`'s docstring will be used as the one-line description for the help text.
2020-05-12 06:31:13 +01:00
Simon Cozens
b299bfb389
[feaLib] Support multiple lookups per glyph position (#1905)
This allows for more than one "lookup ..." chaining statements at each glyph position in a chaining contextual substitution or positioning rule: e.g.

    sub a b c' lookup lookup1 lookup lookup2 d;

The corresponding change in the Adobe OpenType Feature File Specification (and implementation in makeotf) happened in adobe-type-tools/afdko#1132.
2020-05-12 06:28:25 +01:00
Cosimo Lupo
0a26a8d287
glifLib: document default when formatVersion=None 2020-05-11 18:50:45 +01:00
Cosimo Lupo
8bbf30d569
subset_test: add subset of Iosekva-Medium.ttf with ContextSubstFormat3 2020-05-11 18:32:32 +01:00
Just van Rossum
a53bb37d8e
Merge pull request #1938 from justvanrossum/meta-comment
[ttLib.table._m_e_t_a] if data happens to be ascii, emit comment in TTX
2020-05-11 18:47:56 +02:00
Cosimo Lupo
890c5061b5
subset: fix issue subsetting Context{Subst,Pos}Format3
Fixes https://github.com/fonttools/fonttools/issues/1879

In ChainContext{Subst,Pos}Format3, the array of input coverages is called
InputCoverage, whereas in non-Chain Context{Subst,Pos}Format3 subtables it
is called simply Coverage.
2020-05-11 13:32:18 +01:00
Cosimo Lupo
b81d13952a
Merge pull request #1932 from simoncozens/pscharstring-repeated-init
[misc.psCharStrings] Use inheritance to avoid repeated code in initializer
2020-05-11 11:15:54 +01:00
Cosimo Lupo
74867c6ddb
Merge pull request #1931 from simoncozens/fix-typo
Fix typo in loggingTools variable name
2020-05-11 11:15:16 +01:00
Cosimo Lupo
8853d56567
Merge pull request #1930 from simoncozens/python3-inheritance
Use Python3 inheritance style for super.___init__
2020-05-11 11:14:31 +01:00
Cosimo Lupo
5128715565
Merge pull request #1929 from simoncozens/woff2-repeated-init
Use inheritance to avoid repeated code in WOFF2FlavorData initializer
2020-05-11 11:12:52 +01:00
Cosimo Lupo
07e3cf7ef6
Merge pull request #1928 from simoncozens/unused-loop-variable
Use _ to denoted unused loop variable
2020-05-11 11:10:57 +01:00
Cosimo Lupo
798608b371
Merge pull request #1927 from simoncozens/no-mktemp
Don’t use deprecated mktemp, use mkstemp instead
2020-05-11 11:10:10 +01:00
Just van Rossum
d6bb38c7e6
[otlLib.builder] Add function to build STAT table from high-level description (#1926)
* added a function to build a STAT table: `fontTools.otlLib.builder.buildStatTable()`
* make `varLib._add_stat()` a client of `buildStatTable()`
2020-05-09 16:08:11 +02:00
justvanrossum
0dc0222f59 if the binary data happens to be ascii, emit a comment with an ascii representation 2020-05-08 10:37:01 +02:00
Simon Cozens
50c77c138e
Merge pull request #1934 from simoncozens/agl-docs
[docs] Document agl.py
2020-05-08 07:03:42 +01:00
Simon Cozens
bd39b85c9d Typos 2020-05-07 21:58:41 +01:00
Simon Cozens
a59166bbb6
Merge pull request #1914 from simoncozens/documentation
Tidy up top-level documentation and README
2020-05-07 21:45:58 +01:00
Simon Cozens
9b6fed82ca [docs] Document agl.py 2020-05-07 21:31:44 +01:00
Simon Cozens
b69052de47 [misc.psCharStrings] Use inheritance to avoid repeated code in initializer 2020-05-07 21:21:40 +01:00
Simon Cozens
f52eabeefe Fix typo in loggingTools variable name 2020-05-07 21:18:29 +01:00
Simon Cozens
eda4a2717e Use Python3 inheritance style for super.___init__
Avoids cases where super() argument is not enclosing class: https://help.semmle.com/wiki/display/PYTHON/First+argument+to+super%28%29+is+not+enclosing+class
2020-05-07 21:09:20 +01:00
Simon Cozens
253de13377 Use inheritance to avoid repeated code in WOFF2FlavorData initializer 2020-05-07 21:04:52 +01:00
Simon Cozens
46c8f90da8 Use _ to denoted unused loop variable 2020-05-07 21:00:28 +01:00
Simon Cozens
43cdc50e82 Don’t use deprecated mktemp, use mkstemp instead 2020-05-07 20:58:48 +01:00
Cosimo Lupo
c1cbc28568
Merge pull request #1915 from fonttools/pyup-scheduled-update-2020-05-04
Scheduled weekly dependency update for week 18
2020-05-07 17:08:35 +01:00
Cosimo Lupo
82faf2addc
ufoLib_test: fix test on pypy3
shutil.rmtree doesn't like pathlib Paths on pypy3 for some reasosn
https://travis-ci.org/github/fonttools/fonttools/jobs/684236676#L592
2020-05-07 16:53:39 +01:00
Cosimo Lupo
b617ac798e
glifLib_test: add tests for GLIF format version as tuple 2020-05-07 16:53:38 +01:00
Cosimo Lupo
b82abbc10e
ufoLib_test: add tests for new formatVersion as tuple 2020-05-07 16:53:38 +01:00
Cosimo Lupo
c57e843d1f
UFOReader: close underlying fs object if UFOLibError raised in constructor 2020-05-07 16:53:38 +01:00
Cosimo Lupo
57f4904363
ufoLib/glifLib: use TupleEnum instead of namedtuple for {UFO,GLIF}FormatVersion
Also add dedicated Unsupported{UFO,GLIF}Format exceptions in
fontTools.ufoLib.errors module
2020-05-07 16:53:38 +01:00