8000 Annotate ufoLib by knutnergaard · Pull Request #3875 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Annotate ufoLib #3875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b7a7d01
Escape control characters in `xmlWriter` and test.
knutnergaard Jun 22, 2025
09468e2
Update test to use `FontBuilder`.
knutnergaard Jun 22, 2025
4b8684e
Merge branch 'main' into ufoLib
knutnergaard Jun 25, 2025
686c5f4
Add type annotations module.
knutnergaard Jun 27, 2025
a783580
Add normalizer for `ufoLib.UFOFormatVersion`.
knutnergaard Jun 27, 2025
e9844d8
Reverse inadvertent changes.
knutnergaard Jun 27, 2025
c3bf4bc
annotate `ufoLib.__init__`.
knutnergaard Jun 27, 2025
8a7b2dd
Annotate `ufoLib.utils`.
knutnergaard Jun 27, 2025
ab79832
Move type variables to `annotations` module.
knutnergaard Jun 28, 2025
9848db4
Annotate `ufoLib.converters`.
knutnergaard Jun 28, 2025
34add16
Annotate `ufoLib.filenames`.
knutnergaard Jun 28, 2025
49ce261
Update type annotations.
knutnergaard Jun 29, 2025
dfd50a0
Annotate `ufoLib.glifLib`.
knutnergaard Jun 29, 2025
4184e32
Replace `typing.Set` with `set`.
knutnergaard Jun 29, 2025
8e3b4ed
Centralize type variables and fix mypy errors.
knutnergaard Jun 30, 2025
8dd4273
Annotate `ufoLib.kerning`.
knutnergaard Jun 30, 2025
88676a7
Annotate `ufoLib.validators`.
knutnergaard Jun 30, 2025
c0af06c
Remove unused imports.
knutnergaard Jul 1, 2025
4afc71d
Correct annotation and typo, remove unused normalizer.
knutnergaard Jul 1, 2025
6ffb9cf
Redistribute and centralize imports.
knutnergaard Jul 1, 2025
cad5762
Revert default `kerning` type.
knutnergaard Jul 1, 2025
e525812
Correct errors and centralize type variables.
knutnergaard Jul 1, 2025
a0bb9bb
Correct input to `xml...Parse`.
knutnergaard Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Lib/fontTools/annotations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Iterable, Optional, TypeVar, Union
from collections.abc import Callable, Sequence
from fs.base import FS
from os import PathLike
from xml.etree.ElementTree import Element as ElementTreeElement
from lxml.etree import _Element as LxmlElement

if TYPE_CHECKING:
from fontTools.ufoLib import UFOFormatVersion
from fontTools.ufoLib.glifLib import GLIFFormatVersion

Check warning on line 11 in Lib/fontTools/annotations.py

View check run for this annotation

Codecov / codecov/patch

Lib/fontTools/annotations.py#L10-L11

Added lines #L10 - L11 were not covered by tests


T = TypeVar("T") # Generic type
K = TypeVar("K") # Generic dict key type
V = TypeVar("V") # Generic dict value type

GlyphNameToFileNameFunc = Optional[Callable[[str, set[str]], str]]
ElementType = Union[ElementTreeElement, LxmlElement]
FormatVersion = Union[int, tuple[int, int]]
FormatVersions = Optional[Iterable[FormatVersion]]
GLIFFormatVersionInput = Optional[Union[int, tuple[int, int], "GLIFFormatVersion"]]
UFOFormatVersionInput = Optional[Union[int, tuple[int, int], "UFOFormatVersion"]]
IntFloat = Union[int, float]
KerningPair = tuple[str, str]
KerningDict = dict[KerningPair, IntFloat]
KerningGroups = dict[str, Sequence[str]]
KerningNested = dict[str, dict[str, IntFloat]]
PathStr = Union[str, PathLike[str]]
PathOrFS = Union[PathStr, FS]
Loading
Loading
0