1729 Commits

Author SHA1 Message Date
Behdad Esfahbod
0677c0e705 [varStore] Another bugfix in optimize() 2023-05-24 13:18:58 -06:00
Behdad Esfahbod
e4281b07bc [varStore] Add test for optimize()
Doesn't hit all branches yet.
2023-05-24 12:51:24 -06:00
Cosimo Lupo
d017d2b173
use pytest importorskip to skip modules that depend on extra requirements
this should allow to run the basic test suite against the dependency-less core of fonttools library
2023-05-24 16:26:48 +01:00
Cosimo Lupo
77a35fe16d
Merge pull request #3119 from fonttools/glyph-data-format-option
fontBuilder: add glyphDataFormat=0; error with accidentally cubic outlines
2023-05-23 14:57:37 +01:00
Cosimo Lupo
57d5da2039
rename parameter validateGlyphFormat and reword docstring as per review 2023-05-23 14:41:16 +01:00
Cosimo Lupo
469c9ad963
add option to skip glyphDataFormat check for speed
If one is certain that the glyph data has compatible format and prefers not to wait for each glyph flag to checked...
2023-05-23 13:16:02 +01:00
Cosimo Lupo
9bb3b652b0
fontBuilder_test: test error with cubics but glyf format 0 2023-05-23 12:56:09 +01:00
خالد حسني (Khaled Hosny)
a537f97b44
Merge pull request #3114 from fonttools/subset-prune-MarkGlyphSetsDef
[subset] Prune GDEF.MarkGlyphSetsDef
2023-05-22 18:33:37 +03:00
Cosimo Lupo
c2c2cb0949
Merge pull request #3115 from fonttools/xml-reader-join-content-chunks
xmlReader: join consecutive text data that had been cut by buffered xml parser
2023-05-22 12:37:23 +01:00
Khaled Hosny
7b0e3643a0 [subset] Add test for pruning GDEF.MarkGlyphSetsDef 2023-05-22 14:30:15 +03:00
Cosimo Lupo
f7c1407703 Add test to reproduce DSIG split by XML buffered parser 2023-05-22 12:15:50 +01:00
Behdad Esfahbod
4c24a3e328 [varLib/merger] Fix merging of SinglePos with pos=0
Fixes https://github.com/fonttools/fonttools/issues/3111
2023-05-19 18:37:15 +02:00
Simon Cozens
65bc6105f7
[feaLib] Allow empty aalt features (#3110)
* Demote "feature has not been defined" to a warning

* Rework test

* Not my black
2023-05-17 15:08:08 +01:00
David Corbett
bd00fe24f1 feaLib: Test deduped multiple substitution lookups 2023-05-14 09:35:53 -04:00
Khaled Hosny
88885ba9fc feaLib: handle singleton class as a single glyph in multiple subst
This how GlyphsApp handles it and how it is handled in single
substitution.
2023-05-09 17:33:36 +03:00
خالد حسني (Khaled Hosny)
b6209e0510
Merge pull request #3103 from fonttools/multiple-subst-classes
feaLib: support multiple substitution with classes
2023-05-09 16:15:33 +03:00
Khaled Hosny
f642a2aac4 feaLib: support multiple substitution with classes
This is a GlyphsApp extension, (partially) documented [here][1], but it is a
useful one as it allows concise glyph insertion using decomposition
without having to maintain the list of glyphs in two places. E.g.

```fea
@upper = [A-Z];

lookup insert {
  sub @upper by @upper connector;
} insert;

feature ccmp {
  sub @upper' lookup insert x;
} ccmp;
```

As apposed to:

```fea
@upper = [A-Z];

lookup insert {
  sub A by A connector;
  sub B by B connector;
  sub C by C connector;
  sub D by D connector;
  sub E by E connector;
  sub F by F connector;
  sub G by G connector;
  sub H by H connector;
  sub I by I connector;
  sub J by J connector;
  sub K by K connector;
  sub L by L connector;
  sub M by M connector;
  sub N by N connector;
  sub O by O connector;
  sub P by P connector;
  sub R by R connector;
  sub S by S connector;
  sub T by T connector;
  sub U by U connector;
  sub V by V connector;
  sub W by W connector;
  sub X by X connector;
  sub Y by Y connector;
  sub Z by Z connector;
} insert;

feature ccmp {
  sub @upper' lookup insert x;
} ccmp;
```

1. http://handbook.glyphsapp.com/en/layout/multiple-substitution-with-classes/
2023-05-09 14:06:12 +03:00
Behdad Esfahbod
5b96fff9ce [featureVars] Process lookups for features other than rvrn last
Fixes https://github.com/fonttools/fonttools/issues/3097
2023-05-02 10:57:43 -06:00
Jens Kutilek
85c80be6b6
Fix missing composite instructions in ttx (#3092)
* Fix calculation of haveInstructions
* Add test
2023-04-25 16:21:24 +02:00
Cosimo Lupo
df42e9d1e4
ttLib_main.py: test directly __main__.main(), coverage-py doesn't collect in subprocess 2023-04-24 11:48:36 +01:00
Cosimo Lupo
cb5aa96702
add missing __main__.py file to ttLib package, plus some tests
Fixes https://github.com/fonttools/fonttools/issues/17
2023-04-24 11:22:53 +01:00
Behdad Esfahbod
57c7792477
[merge] Handle differing default/nominalWidthX in CFF (#3070)
* [merge] Handle None GDEF.table.MarkGlyphSetsDef

* [merge] Handle differing CFF nominal/defaultWidthX

Fixes https://github.com/fonttools/fonttools/issues/3069

* Update Lib/fontTools/merge/tables.py

Co-authored-by: Cosimo Lupo <clupo@google.com>

---------

Co-authored-by: Cosimo Lupo <clupo@google.com>
2023-04-19 12:14:41 -06:00
Colin M. Ford
52f522525a lastly, removing lib cruft from glyphs file 2023-04-06 11:04:47 -04:00
Colin M. Ford
ab7628b3f5 adding importerskip for glyphsapp tests 2023-04-06 10:58:31 -04:00
Colin M. Ford
e7c9616c48 Removing UFO cruft 2023-04-06 10:44:10 -04:00
Colin M. Ford
579d0dce31 one more try with black 2023-04-06 10:08:42 -04:00
Colin M. Ford
9656e3faf1 formatting with black to get lint to pass 2023-04-05 22:33:38 -04:00
Colin M. Ford
45d1d01f66 adding more tests for varlib.interpolatable 2023-04-05 20:48:34 -04:00
Colin M. Ford
7a86dd325e Rewriting varLib.interpolatable to allow for sparse masters + tests 2023-04-05 16:35:03 -04:00
Cosimo Lupo
8859d8669d
ttFont_test: add tests for unseekable input file with lazy=True 2023-03-21 18:15:02 +00:00
Cosimo Lupo
1d5feb81e5
ttFont_test: add reproducer for SpooledTemporaryFile has no seekable
Reproduces https://github.com/fonttools/fonttools/issues/3052
2023-03-21 18:08:21 +00:00
Cosimo Lupo
5abdd83318
Merge pull request #3043 from fonttools/fealib-more-avar
Apply `avar` also to variable locations
2023-03-16 12:35:51 +00:00
Cosimo Lupo
5d0432a813
Merge pull request #3029 from daltonmaag/wrap-glif-xml-errors
[glifLib] Wrap XML library exceptions with glifLib types when parsing glifs
2023-03-16 11:46:45 +00:00
Behdad Esfahbod
05872d6878
Merge pull request #2679 from fonttools/avar2
Avar2
2023-03-15 11:56:30 -06:00
Behdad Esfahbod
2edbbc1b32 [avar2] Test xml for equality 2023-03-15 11:46:57 -06:00
Behdad Esfahbod
b009e63733 [avar2] Use fl2fi in test 2023-03-15 11:40:24 -06:00
Nikolaus Waxweiler
cf43ff5d22 Apply avar to variable locations 2023-03-15 16:19:39 +00:00
Nikolaus Waxweiler
73e7aad1c3 Guard against missing avar entries 2023-03-15 16:18:47 +00:00
Nikolaus Waxweiler
c3a5e9ea1f Consult avar for normalizing user-space values in conditionsets 2023-03-15 09:16:06 +00:00
Behdad Esfahbod
1deed38b8d [avar2] Add compile test 2023-03-14 14:09:32 -06:00
Harry Dalton
70ca6dec9b Identify the culprit glif in read errors with a loose backport of PEP678
This commit annotates errors from GlyphSet.readGlyph() with the details
of the glyph that originated them (e.g. name, path to glif). This is
implemented with a loose backport of PEP678, to avoid adding a wrapper
error that would be less specific and would break API compatibility.

In addition, this commit adds a test to ensure that the new details are
present (specifically, in the case of parsing invalid XML).
2023-03-14 15:58:18 +00:00
Jens Kutilek
f1a75bacb2
Handle string input to Program.fromAssembly() (#3038)
* Add tests for fromAssembly() output (#3036)
* Handle string input to fromAssembly() (Fixes #3036)
* Fixups suggested by @anthrotype
* Add some more typing annotations
* Program.assembly always returns List[str] now
* Add annotation for bytecode
* Move code from setter to fromAssembly
* Remove property
* Fix attribute names
2023-03-14 14:51:16 +01:00
Khaled Hosny
fd6c81585f [otlib] Add a config option to write GPOS 7 lookups
See the inline comment and option documentation
2023-03-13 16:34:33 +02:00
Cosimo Lupo
3c9aa76893
Merge pull request #3027 from fonttools/colr-clipboxes
[COLRv1] Add method to automatically compute ClipBoxes, w/ optional quantization
2023-03-10 15:43:35 +00:00
Cosimo Lupo
c5e464ad8f
C_O_L_R_test: add tests for computeClipBoxes
using a subset from test_glyphs font from the googlefonts/color-fonts repository
2023-03-10 15:23:30 +00:00
Cosimo Lupo
d64ee127be
ttFont_test: another test for missing glyph name that doesn't match 'glyph\d+' pattern 2023-03-10 11:44:52 +00:00
Cosimo Lupo
d77c8901c8
ttFont_test: add test for getGlyphID 2023-03-10 11:37:07 +00:00
Harry Dalton
1f3380300b Wrap XML library exceptions with glifLib types when parsing glifs
This allows dependent projects to catch errors parsing glifs without
requiring logic to account for which XML library fonttools is using
internally (e.g. for implementing fonttools/ufoLib2#264).

This commit also adds tests to ensure that the exception we expose when
glifs have invalid syntax remains stable across future releases.
2023-03-09 16:11:32 +00:00
Behdad Esfahbod
43b16df8db [avar] Update test expectations 2023-03-08 11:10:07 -07:00
Behdad Esfahbod
2b5686205e [avar] Support previous API in compile/decompile
Using the otData mechanism with handcoded shim.
2023-03-08 09:29:58 -07:00