Skip to content

Commit

Permalink
Merge pull request #105 from mkashirin/patch-1
Browse files Browse the repository at this point in the history
Fix types for various functions
  • Loading branch information
naveen521kk authored Oct 12, 2023
2 parents 3aa5502 + 69ba49d commit 83d5bf6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
56 changes: 28 additions & 28 deletions manimpango/cmanimpango.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class TextSetting:
"""Formatting for slices of a :class:`manim.mobject.svg.text_mobject.Text` object."""
def __init__(
self,
start:int,
end:int,
font:str,
slant,
weight,
line_num=-1,
color: str=None,
start: int,
end: int,
font: str,
slant: str,
weight: str,
line_num = -1,
color: str = None,
):
self.start = start
self.end = end
Expand All @@ -28,18 +28,18 @@ class TextSetting:


def text2svg(
settings:list,
size:int,
line_spacing:int,
disable_liga:bool,
file_name:str,
START_X:int,
START_Y:int,
width:int,
height:int,
orig_text:str,
settings: list,
size: float,
line_spacing: float,
disable_liga: bool,
file_name: str,
START_X: int,
START_Y: int,
width: int,
height: int,
orig_text: str,
pango_width: typing.Union[int, None] = None,
) -> int:
) -> str:
"""Render an SVG file from a :class:`manim.mobject.svg.text_mobject.Text` object."""
cdef cairo_surface_t* surface
cdef cairo_t* cr
Expand Down Expand Up @@ -180,24 +180,24 @@ class MarkupUtils:
@staticmethod
def text2svg(
text: str,
font: str,
font: str | None,
slant: str,
weight: str,
size: int,
_: int, # for some there was a keyword here.
size: float,
_, # for some there was a keyword here.
disable_liga: bool,
file_name: str,
START_X: int,
START_Y: int,
width: int,
height: int,
*, # keyword only arguments below
justify: bool = None,
indent: float = None,
line_spacing: float = None,
alignment: Alignment = None,
pango_width: typing.Union[int, None] = None,
) -> int:
justify: bool | None = None,
indent: float | int | None = None,
line_spacing: float | None = None,
alignment: Alignment | None = None,
pango_width: int | None = None,
) -> str:
"""Render an SVG file from a :class:`manim.mobject.svg.text_mobject.MarkupText` object."""
cdef cairo_surface_t* surface
cdef cairo_t* context
Expand Down Expand Up @@ -264,7 +264,7 @@ class MarkupUtils:
pango_layout_set_alignment(layout, alignment.value)

font_desc = pango_font_description_new()
if font_desc==NULL:
if font_desc == NULL:
cairo_destroy(context)
cairo_surface_destroy(surface)
g_object_unref(layout)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["Cython>=0.29.25,<3.0", "setuptools>=59.2.0", "wheel"]
requires = ["Cython>=3.0.2", "setuptools>=59.2.0", "wheel"]

[tool.isort]
# from https://black.readthedocs.io/en/stable/compatible_configs.html
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest-cov>=4.0,<5.0
pytest>=7.0.0,<8.0.0
Cython>=0.29.32,<0.30.0
Cython>=3.0.2
coverage>=6.5.0,<7.0.0
setuptools>=59.2.0

0 comments on commit 83d5bf6

Please sign in to comment.