svg-ultralight 0.32.0__py3-none-any.whl → 0.32.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of svg-ultralight might be problematic. Click here for more details.
- svg_ultralight/__init__.py +2 -0
- svg_ultralight/query.py +14 -1
- {svg_ultralight-0.32.0.dist-info → svg_ultralight-0.32.2.dist-info}/METADATA +1 -1
- {svg_ultralight-0.32.0.dist-info → svg_ultralight-0.32.2.dist-info}/RECORD +6 -6
- {svg_ultralight-0.32.0.dist-info → svg_ultralight-0.32.2.dist-info}/WHEEL +0 -0
- {svg_ultralight-0.32.0.dist-info → svg_ultralight-0.32.2.dist-info}/top_level.txt +0 -0
svg_ultralight/__init__.py
CHANGED
|
@@ -20,6 +20,7 @@ from svg_ultralight.constructors.new_element import (
|
|
|
20
20
|
new_sub_element,
|
|
21
21
|
update_element,
|
|
22
22
|
)
|
|
23
|
+
from svg_ultralight.import_svg import import_svg
|
|
23
24
|
from svg_ultralight.inkscape import (
|
|
24
25
|
write_pdf,
|
|
25
26
|
write_pdf_from_svg,
|
|
@@ -57,6 +58,7 @@ __all__ = [
|
|
|
57
58
|
"format_number",
|
|
58
59
|
"format_numbers",
|
|
59
60
|
"format_numbers_in_string",
|
|
61
|
+
"import_svg",
|
|
60
62
|
"mat_apply",
|
|
61
63
|
"mat_dot",
|
|
62
64
|
"mat_invert",
|
svg_ultralight/query.py
CHANGED
|
@@ -146,6 +146,19 @@ def get_bounding_box(
|
|
|
146
146
|
return tuple(bboxes)
|
|
147
147
|
|
|
148
148
|
|
|
149
|
+
def _replace_text(text_elem: EtreeElement, new_text: str) -> None:
|
|
150
|
+
"""Replace the text in a text element.
|
|
151
|
+
|
|
152
|
+
:param text_elem: an etree element with a text tag
|
|
153
|
+
:param new_text: the new text to insert
|
|
154
|
+
|
|
155
|
+
If the text element has tspans, replace each tspan.text with new_text.
|
|
156
|
+
"""
|
|
157
|
+
text_elem.text = new_text
|
|
158
|
+
for sub_elem in text_elem:
|
|
159
|
+
sub_elem.text = new_text
|
|
160
|
+
|
|
161
|
+
|
|
149
162
|
def pad_text(
|
|
150
163
|
inkscape: str | Path, text_elem: EtreeElement, capline_reference_char: str = "M"
|
|
151
164
|
) -> PaddedText:
|
|
@@ -166,7 +179,7 @@ def pad_text(
|
|
|
166
179
|
_ = rmargin_ref.attrib.pop("id", None)
|
|
167
180
|
_ = capline_ref.attrib.pop("id", None)
|
|
168
181
|
rmargin_ref.attrib["text-anchor"] = "end"
|
|
169
|
-
capline_ref
|
|
182
|
+
_replace_text(capline_ref, capline_reference_char)
|
|
170
183
|
id2bbox = map_ids_to_bounding_boxes(inkscape, text_elem, rmargin_ref, capline_ref)
|
|
171
184
|
|
|
172
185
|
bbox = id2bbox[text_elem.attrib["id"]]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
svg_ultralight/__init__.py,sha256=
|
|
1
|
+
svg_ultralight/__init__.py,sha256=k6oHfgxlQLUJmIhkQdBthMTvDqKFsWIp_ZaXxC1bwGM,2250
|
|
2
2
|
svg_ultralight/animate.py,sha256=fE-zRU_uFrZIL9W78fcGz7qmrts8fz5UoWEy7b4xb44,1144
|
|
3
3
|
svg_ultralight/import_svg.py,sha256=TVLbinch2g0RN-OlWyGXoQEO6vc2I_LsMXpOchwTJzE,1548
|
|
4
4
|
svg_ultralight/inkscape.py,sha256=M8yTxXOu4NlXnhsMycvEJiIDpnDeiZ_bZakJBM38ZoU,9152
|
|
@@ -7,7 +7,7 @@ svg_ultralight/main.py,sha256=6oNkZfD27UMdP-oYqp5agS_IGcYb8NkUZwM9Zdyb3SA,7287
|
|
|
7
7
|
svg_ultralight/metadata.py,sha256=Mxgxrxe1Ar4kp2wTT29aadxgHNFaaNLABo29jStiWDg,4201
|
|
8
8
|
svg_ultralight/nsmap.py,sha256=y63upO78Rr-JJT56RWWZuyrsILh6HPoY4GhbYnK1A0g,1244
|
|
9
9
|
svg_ultralight/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
svg_ultralight/query.py,sha256=
|
|
10
|
+
svg_ultralight/query.py,sha256=nsw7L_gH-EPf5LaNu5jtVPihq-qhKs1O2psMU3sTUXU,7732
|
|
11
11
|
svg_ultralight/root_elements.py,sha256=pt9J6mPrnoTAZVF6vKTZoM_o947I8UCj6MbGcD2JUCk,2869
|
|
12
12
|
svg_ultralight/string_conversion.py,sha256=WEmpf75RJmJ2lfJluagAz2wPsz6wM8XvTEwkq4U0vEc,7353
|
|
13
13
|
svg_ultralight/transformations.py,sha256=64BN_UupvOZk4nbiKLKv09P3j0TPFhH6mKro_3QBqeY,3945
|
|
@@ -23,7 +23,7 @@ svg_ultralight/constructors/__init__.py,sha256=YcnO0iBQc19aL8Iemw0Y452MBMBIT2AN5
|
|
|
23
23
|
svg_ultralight/constructors/new_element.py,sha256=VtMz9sPn9rMk6rui5Poysy3vezlOaS-tGIcGbu-SXmY,3406
|
|
24
24
|
svg_ultralight/strings/__init__.py,sha256=Zalrf-ThFz7b7xKELx5lb2gOlBgV-6jk_k_EeSdVCVk,295
|
|
25
25
|
svg_ultralight/strings/svg_strings.py,sha256=RYKMxOHq9abbZyGcFqsElBGLrBX-EjjNxln3s_ibi30,1296
|
|
26
|
-
svg_ultralight-0.32.
|
|
27
|
-
svg_ultralight-0.32.
|
|
28
|
-
svg_ultralight-0.32.
|
|
29
|
-
svg_ultralight-0.32.
|
|
26
|
+
svg_ultralight-0.32.2.dist-info/METADATA,sha256=iXnT_qxV0Qg9tp3XAtv1b7TlxV-xkiYnAkCm700McgA,8871
|
|
27
|
+
svg_ultralight-0.32.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
28
|
+
svg_ultralight-0.32.2.dist-info/top_level.txt,sha256=se-6yqM_0Yg5orJKvKWdjQZ4iR4G_EjhL7oRgju-fdY,15
|
|
29
|
+
svg_ultralight-0.32.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|