Skip to content

Commit

Permalink
Fix some more types in cmanimpango.pyx
Browse files Browse the repository at this point in the history
also update to `Cython>=3.0.2`
  • Loading branch information
naveen521kk committed Oct 12, 2023
1 parent afcdcc8 commit 69ba49d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
34 changes: 17 additions & 17 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 @@ -39,7 +39,7 @@ def text2svg(
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: float,
_: int, # for some there was a keyword here.
_, # 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 69ba49d

Please sign in to comment.