Skip to content

Commit

Permalink
Add annotations.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
knutnergaard committed Sep 2, 2024
1 parent 28a7464 commit 9959124
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Lib/fontParts/base/annotations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# pylint: disable=C0103, C0114

from __future__ import annotations
from typing import Dict, List, Tuple, TypeVar, Union

from fontTools.pens.basePen import AbstractPen
from fontTools.pens.pointPen import AbstractPointPen

# ------------
# Type Aliases
# ------------

# Builtins

T = TypeVar('T')
CollectionType = Union[List[T], Tuple[T, ...]]
IntFloatType = Union[int, float]

# FontTools

PenType = AbstractPen
PointPenType = AbstractPointPen

# FontParts

BoundsType = Tuple[IntFloatType, IntFloatType, IntFloatType, IntFloatType]
CharacterMappingType = Dict[int, Tuple[str, ...]]
ColorType = Tuple[IntFloatType, IntFloatType, IntFloatType, IntFloatType]
CoordinateType = Tuple[IntFloatType, IntFloatType]
FactorType = Union[IntFloatType, Tuple[float, float]]
KerningKeyType = Tuple[str, str]
KerningDictType = Dict[KerningKeyType, IntFloatType]
ReverseComponentMappingType = Dict[str, Tuple[str, ...]]
ScaleType = Tuple[IntFloatType, IntFloatType]
TransformationMatrixType = Tuple[
IntFloatType, IntFloatType, IntFloatType,
IntFloatType, IntFloatType, IntFloatType
]

0 comments on commit 9959124

Please sign in to comment.