svg-ultralight 0.52.1__py3-none-any.whl → 0.52.3__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.

@@ -64,7 +64,6 @@ enough to lay out text on a business card.
64
64
 
65
65
  from __future__ import annotations
66
66
 
67
- import copy
68
67
  import math
69
68
  from typing import TYPE_CHECKING
70
69
 
@@ -113,7 +112,7 @@ class PaddedText(BoundElement):
113
112
  :param lpad: Left padding.
114
113
  """
115
114
  self.elem = elem
116
- self.unpadded_bbox = copy.copy(bbox)
115
+ self.unpadded_bbox = bbox
117
116
  self.base_tpad = tpad
118
117
  self.rpad = rpad
119
118
  self.base_bpad = bpad
@@ -425,13 +425,7 @@ class FTFontInfo:
425
425
  coordinates (+y is down).
426
426
  """
427
427
  min_x, min_y, max_x, max_y = self.get_char_bounds(char)
428
- return BoundingBox(
429
- min_x,
430
- min_y,
431
- max_x - min_x,
432
- max_y - min_y,
433
- transformation=(1, 0, 0, -1, 0, 0),
434
- )
428
+ return BoundingBox(min_x, -max_y, max_x - min_x, max_y - min_y)
435
429
 
436
430
  def get_text_bounds(self, text: str) -> tuple[int, int, int, int]:
437
431
  """Return bounds of a string as xmin, ymin, xmax, ymax.
@@ -490,13 +484,7 @@ class FTFontInfo:
490
484
  coordinates (+y is down).
491
485
  """
492
486
  min_x, min_y, max_x, max_y = self.get_text_bounds(text)
493
- return BoundingBox(
494
- min_x,
495
- min_y,
496
- max_x - min_x,
497
- max_y - min_y,
498
- transformation=(1, 0, 0, -1, 0, 0),
499
- )
487
+ return BoundingBox(min_x, -max_y, max_x - min_x, max_y - min_y)
500
488
 
501
489
  def get_lsb(self, char: str) -> float:
502
490
  """Return the left side bearing of a character."""
@@ -579,7 +567,7 @@ class FTTextInfo:
579
567
  """
580
568
  bbox = self.font.get_text_bbox(self.text)
581
569
  bbox.transform(scale=self.scale)
582
- return bbox
570
+ return BoundingBox(*bbox.values())
583
571
 
584
572
  @property
585
573
  def ascent(self) -> float:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: svg-ultralight
3
- Version: 0.52.1
3
+ Version: 0.52.3
4
4
  Summary: a sensible way to create svg files with Python
5
5
  Author: Shay Hill
6
6
  Author-email: Shay Hill <shay_public@hotmail.com>
@@ -8,12 +8,12 @@ svg_ultralight/bounding_boxes/supports_bounds.py,sha256=8rIklGICIx-DXELN7FjDwrzO
8
8
  svg_ultralight/bounding_boxes/type_bound_collection.py,sha256=ct8BLjqyHSCNhOGG0eYuubdOajI2KVo1nbTP3JxXZ00,2756
9
9
  svg_ultralight/bounding_boxes/type_bound_element.py,sha256=gXsHCSJ6lxIGODm1oJ5yYAPzuIi7NkBIIzD_GX-cgo8,2322
10
10
  svg_ultralight/bounding_boxes/type_bounding_box.py,sha256=r3XcdW_U8VvRauylw54aMwPsmC6A3HY72rz_sTcd1Uo,13359
11
- svg_ultralight/bounding_boxes/type_padded_text.py,sha256=LXVsdCU7j_TzVEx652WKQLICFeYn_Zqjw6KCP6p1nzo,14740
11
+ svg_ultralight/bounding_boxes/type_padded_text.py,sha256=WFpz9ebHn3NIMdqO3-Qowbvq0w227jNKW6y_Y6Usg-g,14717
12
12
  svg_ultralight/constructors/__init__.py,sha256=fb-A50G3YTZNMQXpxcCl_QAcfssS0Us065_kdJRybDQ,313
13
13
  svg_ultralight/constructors/new_element.py,sha256=hVQG7WBHQoTUmGiZNtVadGOitdTFBrHOQeVKKVOWGaA,3526
14
14
  svg_ultralight/font_tools/__init__.py,sha256=b_VSvk5aODzS2wv48EMU2sey_mxq1o1SL8ecWTdy4kc,78
15
15
  svg_ultralight/font_tools/comp_results.py,sha256=KR6RtVGWjGGfHX2d_-XRx_Jr9CQ36kPbQxLVK1yzgTI,10421
16
- svg_ultralight/font_tools/font_info.py,sha256=RkxhxMdhuIDNDn8OUfEOTRPf9Y2PoYdxoBRFp70KQes,29521
16
+ svg_ultralight/font_tools/font_info.py,sha256=9nSj8qjzbT3bEe2Qgr-Rtfzb6RyFFCiXHbvv4Oyfxw0,29332
17
17
  svg_ultralight/image_ops.py,sha256=cwR038ECUuiceIrk-9Peh5Ijp4tzjuaV5Y1cvYOt4TI,5454
18
18
  svg_ultralight/inkscape.py,sha256=_aQ42ZQ1JP9TFdHmtxgCRsXvxfZPpdZWTGKEea9BgIU,9336
19
19
  svg_ultralight/layout.py,sha256=yiTAYtSsYywdCObIdjkK3A4fiEYLNPqD3BOQKxfj6gQ,12514
@@ -29,6 +29,6 @@ svg_ultralight/strings/__init__.py,sha256=iaRwr9AF9bPDkG3XvgGRSf8JPAS2GQ8ds9yCNp
29
29
  svg_ultralight/strings/svg_strings.py,sha256=XlXQ5RqueGrROXBI4VzR2cK7e1NdNhYx5S84bgyqFUQ,3132
30
30
  svg_ultralight/transformations.py,sha256=YyhehH0Hlui2U9t7hjwgHgRyHzUR7UCMSSo-G85J-bo,4784
31
31
  svg_ultralight/unit_conversion.py,sha256=Y32GZ5TLkvjDHM2kBw52M8ZxDNlpVSlDkSdRa1S_X-A,8985
32
- svg_ultralight-0.52.1.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
33
- svg_ultralight-0.52.1.dist-info/METADATA,sha256=HZfZfYDByPXr1IUnuTRSThw4fZdYPQJYrFKrrZvybvg,8691
34
- svg_ultralight-0.52.1.dist-info/RECORD,,
32
+ svg_ultralight-0.52.3.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
33
+ svg_ultralight-0.52.3.dist-info/METADATA,sha256=PBzABIpTX2P_ymZKO0SIEgsRgtv_0RipPT9QujuUftk,8691
34
+ svg_ultralight-0.52.3.dist-info/RECORD,,