85 Commits

Author SHA1 Message Date
Ryan Bugden
0f840042e1 Allow axisOrdering to be set to zero
Fixes https://github.com/fonttools/fonttools/issues/3710
2024-12-03 15:22:13 -05:00
Nathan Williis
c19b1c5148 Docs: move module docstrings to first line of file, as per PEP 257. 2024-09-02 17:18:41 +01:00
خالد حسني (Khaled Hosny)
534ceed9db
Merge pull request #3438 from fonttools/pyup-scheduled-update-2024-02-05
Scheduled weekly dependency update for week 05
2024-02-06 15:54:33 +02:00
Khaled Hosny
cf08265cd5 Black 2024-02-06 15:47:35 +02:00
Behdad Esfahbod
1e989abec4 [designspaceLib] Add "description" to <mappings> and <mapping>
Fixes https://github.com/fonttools/fonttools/issues/3435
2024-02-05 09:58:51 -07:00
Behdad Esfahbod
1418b4c916 [designspaceLib] Add a roundtripping __main__
Works as a normalizer as well.
2024-02-05 09:58:51 -07:00
Jany Belluz
6a16be3e3b [designspaceLib] Fix #3369 match Python type hints to the documentation 2023-12-06 12:02:39 +00:00
Behdad Esfahbod
a8f9fa98ec [designspaceLib/docs] varLib spelling 2023-05-30 22:36:00 -06:00
Behdad Esfahbod
1b7c0bf19b [designspaceLib/avar2] Adjust version to 5.1 when writing mappings 2023-05-30 22:23:42 -06:00
Behdad Esfahbod
d513e563ff [designspaceLib/avar2] Add XML docs 2023-05-30 22:16:46 -06:00
Behdad Esfahbod
90e8595ef0 [designspaceLib/avar2] Document 2023-05-28 16:58:30 -06:00
Behdad Esfahbod
ae2305196a [designspaceLib/avar2] Store axis name, not tag, in <dimension> 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
3a809dbbf3 [designspaceLib/avar2] Write out <mappings> element 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
50b1fb3f01 [designspaceLib/avar2] Rename elements to <mappings><mapping> 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
f27e843276 [designspaceLib/avar2] Flesh out AxisMapping API 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
0b57567c14 [designspaceLib/avar2] Add AxisMappingDescriptor 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
be9dacad74 [designspaceLib/avar2] Rename mapping to axisMappings 2023-05-28 15:14:25 -06:00
Behdad Esfahbod
50fc8218b3 [designspace/varLib] Hack to read avar2 mapping and build avar2 table
This just uses list of list of dictionaries. Should use proper objects.

https://github.com/fonttools/fonttools/issues/3049

https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2-in-designspace.md
2023-05-28 15:14:25 -06:00
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
Nikolaus Waxweiler
45c89c0700 Add DS.getAxisByTag and refactor getAxis 2022-11-14 19:15:47 +00:00
Jany Belluz
f19aa60e65
Merge pull request #2634 from fonttools/ds-avoid-isinstance
[designspaceLib] Check for descriptor types with hasattr()
2022-06-09 17:50:47 +01:00
Jany Belluz
737abf5020
[designspaceLib] Add DiscreteAxisDescriptor default in docstring 2022-06-08 10:03:04 +01:00
Jany Belluz
86cdcbb9e5 [designspaceLib] Add new classes to __all__ 2022-06-06 09:19:17 +01:00
Jany Belluz
ec4bcf54c9 Check for descriptor types with hasattr() to allow custom classes that don't inherit the default descriptors 2022-06-01 12:00:52 +01:00
Nikolaus Waxweiler
d8bf4c3123 Fix typo to actually transfer font references 2022-04-26 10:15:37 +01:00
Jany Belluz
35e560603e [designspaceLib] Add designspace 5 code 2022-04-14 15:03:58 +01:00
Simon Cozens
0f03e6529a
[docs] Fix sphinx warnings (#2453)
* Add default auto doc options

* Ensure all references are unique

* Use anonymous links to avoid duplicate references

* Remove default options, fix wrong module name

* Don’t index repeated class

* Remove repeated classes included through automodule

* Fix warnings

* We don’t use our own static directory

* Correctly format XML in docs

* Fix indentation

* Fix overline

* Bring TOC to top

* Fix definition list

* Offset definition lists and examples

* Fix erroneous markup

* Fix markup

* Already included in automodule

* Fix args markup

* Correct markup for example

* Don’t reindex repeated module

* Correct XML code block markup

* Fix markup errors, change example to doctest

* Correct list markup

* Make ttx docstring both valid RST and valid help output

* Various other boring markup fixes

* Fix example indenting

* Make docstring valid RST and valid help output

* Mock import for reportlab

* It’s ok if manual links don’t appear in toctrees

* Oops typo, I guess doctests are useful
2021-12-02 15:31:49 +00:00
Khaled Hosny
232b2ccbc4 Move the rest of py23 module to textTools
Change all imports to use textTools module, except the test_py23.py test
which is kept until we decide to remove the module (if ever).
2021-08-20 01:29:45 +02:00
Eigi
84d77e5c3a fix for issue #2299
translate leading backslashes of UNC path to forward slashes.
2021-05-09 18:59:34 +02:00
Just van Rossum
5fc65d7168
Misc py23 cleanups (#2243)
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00
Cosimo Lupo
ca3306da57
designspaceLib: add add{Axis,Source,Instance,Rule}Descriptor methods
as suggested by Just here:
https://github.com/fonttools/fonttools/pull/1860#issuecomment-601762751
2020-03-20 16:04:24 +00:00
Cosimo Lupo
2d27490c7d
designspaceLib: allow to construct descriptors from keyword args
like data classes
2020-03-20 16:04:23 +00:00
Just van Rossum
b8fafdd259
[WIP] [designspaceLib] designspace docs edits (#1750)
Various changes in the designspaceLib readme.rst
- added docs for DesignSpaceDocument object, methods and attributes
- removed comments on validation, localisation and generating UFO instances.
- added note that axis minimum, default and maximum are in userspace coordinates.
- added clarification to map input (userpace!) / output (designspace!) values.
- added note that sourceDescriptor location is in designspace coordinates.
- moved comment on rule subs to rule descriptor object.
- added proposed "processing" flag to rules element
- move note on sub element
- implementation differences
- varlib vs. mutatormath
- older versions
- rules and generating static ufo instances
- Updated the description of the `copyInfo` flag of the sourceDescriptor.
- Change the example import.
- Remove additional mention of copyInfo.
2019-11-07 19:30:51 +01:00
justvanrossum
f9b04572f6 fix error message, reformatted long line 2019-10-18 13:24:32 +02:00
justvanrossum
d42b7d74ca Implement <rules> attribute 'processing' according to spec update #1750, as well as the related doc.rulesProcessingLast flag 2019-10-18 13:20:28 +02:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Nikolaus Waxweiler
0b9ad5ab80 Add a default InstanceDescriptor.font attribute 2019-08-02 13:40:15 +01:00
Cosimo Lupo
175399ecbc
designspaceLib: add examples to loadSourceFonts docstring 2019-05-10 18:43:42 +01:00
Cosimo Lupo
44f74dc8bb
designspaceLib: add loadSourceFonts method with custom opener
Allows to load the SourceDescriptor.font attribute from its path, using a custom callable (e.g. defcon.Font or ttLib.TTFont, etc.).
2019-05-10 16:32:11 +01:00
Cosimo Lupo
b327287f97
designspaceLib: remove defaultLoc attribute, use up-to-date default location in findDefault
Fixes #1554
2019-04-08 16:59:01 +01:00
Nikolaus Waxweiler
754c1c6a2f Minor: Remove redundant comment 2019-03-10 23:03:08 +00:00
Nikolaus Waxweiler
5f7afa23b2 newDefaultLocation: Return location in design space 2019-03-10 22:20:00 +00:00
Nikolaus Waxweiler
c4899330c5 designspaceLib, findDefault: consider axis mapping 2019-03-10 22:12:06 +00:00
Cosimo Lupo
a979af2019 designspaceLib: use axis maps with normalizeLocation
fixes https://github.com/fonttools/fonttools/issues/1226
2019-02-27 15:17:24 -08:00
Nikolaus Waxweiler
dd40dac5e0 Remove InstanceDescriptor.mutedGlyphNames
Closes https://github.com/fonttools/fonttools/issues/1417.
2019-01-19 14:13:32 +00:00
Cosimo Lupo
48e72dab9b
varLib: use addMultilingualName for localised instance style names
designspaceLib: ensure instance localised names are set as unicode strings
2019-01-13 15:04:55 +00:00
Cosimo Lupo
acbc65c1a9
varLib: use addMultilingualName method to support localized axes 'labelname'
now that addMultilingualName method also adds mac names by default, we can use it in
varLib instead of addName.
The language identifiers are expected to be minimized, i.e. not contain default script/region
subtags -- until we implement the minimizeSubtags algorithm from ICU/CLDR:
https://github.com/fonttools/fonttools/issues/930
2019-01-13 13:39:15 +00:00
Cosimo Lupo
448b946636
varLib/designspaceLib: require font-less source to have a path; remove getSourcePath
simpler is better. Also, refactored updatePaths and added more tests to it.
2019-01-03 14:21:09 +00:00
Cosimo Lupo
e640806657
designspace: normalize platform path separator in getSourcePath 2019-01-02 16:11:32 +00:00
Cosimo Lupo
3558d4e537
Merge remote-tracking branch 'origin/master' into varlib-build-accept-ds-object 2019-01-02 14:12:56 +00:00