tbapi.api.models.font

 1from __future__ import annotations
 2from typing import TYPE_CHECKING
 3from tbapi.common.decorators import tb_class, tb_interface
 4from tbapi.common.converters import to_python_datetime, to_net_datetime
 5from datetime import datetime
 6from Tickblaze.Scripts.Api.Models import Font as _Font
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9from tbapi.api.enums.font_style import FontStyle
10from tbapi.api.enums.font_weight import FontWeight
11from Tickblaze.Scripts.Api.Enums import FontStyle as _FontStyle
12from Tickblaze.Scripts.Api.Enums import FontWeight as _FontWeight
13
14@tb_class(_Font)
15class Font():
16    """Represents a font with a family name, size, style, and weight."""
17
18    @overload
19    @staticmethod
20    def new(familyName: str = "Segoe UI", size: int = 12, style: FontStyle = FontStyle.Normal, weight: FontWeight = FontWeight.Regular) -> "Font":
21        """Constructor overload with arguments: familyName, size, style, weight"""
22        ...
23    @overload
24    @staticmethod
25    def new() -> "Font":
26        """Constructor overload with arguments: """
27        ...
28    @staticmethod
29    def new(*args, **kwargs):
30        """Generic factory method for Font. Use overloads for IDE type hints."""
31        return Font(*args, **kwargs)
32
33    @property
34    def family_name(self) -> str:
35        """Gets or sets the font family name."""
36        val = self._value.FamilyName
37        return val
38    @family_name.setter
39    def family_name(self, val: str):
40        tmp = self._value
41        tmp.FamilyName = val
42        self._value = tmp
43    @property
44    def size(self) -> int:
45        """Gets or sets the font size."""
46        val = self._value.Size
47        return val
48    @size.setter
49    def size(self, val: int):
50        tmp = self._value
51        tmp.Size = val
52        self._value = tmp
53    @property
54    def style(self) -> FontStyle:
55        """Gets or sets the font style."""
56        val = int(self._value.Style)
57        return FontStyle(val)
58    @style.setter
59    def style(self, val: FontStyle):
60        tmp = self._value
61        tmp.Style = _FontStyle(val.value if hasattr(val, "value") else int(val))
62        self._value = tmp
63    @property
64    def weight(self) -> FontWeight:
65        """Gets or sets the font weight."""
66        val = int(self._value.Weight)
67        return FontWeight(val)
68    @weight.setter
69    def weight(self, val: FontWeight):
70        tmp = self._value
71        tmp.Weight = _FontWeight(val.value if hasattr(val, "value") else int(val))
72        self._value = tmp
@tb_class(_Font)
class Font:
22@tb_class(_Font)
23class Font():
24    """Represents a font with a family name, size, style, and weight."""
25
26    @overload
27    @staticmethod
28    def new(familyName: str = "Segoe UI", size: int = 12, style: FontStyle = FontStyle.Normal, weight: FontWeight = FontWeight.Regular) -> "Font":
29        """Constructor overload with arguments: familyName, size, style, weight"""
30        ...
31    @overload
32    @staticmethod
33    def new() -> "Font":
34        """Constructor overload with arguments: """
35        ...
36    @staticmethod
37    def new(*args, **kwargs):
38        """Generic factory method for Font. Use overloads for IDE type hints."""
39        return Font(*args, **kwargs)
40
41    @property
42    def family_name(self) -> str:
43        """Gets or sets the font family name."""
44        val = self._value.FamilyName
45        return val
46    @family_name.setter
47    def family_name(self, val: str):
48        tmp = self._value
49        tmp.FamilyName = val
50        self._value = tmp
51    @property
52    def size(self) -> int:
53        """Gets or sets the font size."""
54        val = self._value.Size
55        return val
56    @size.setter
57    def size(self, val: int):
58        tmp = self._value
59        tmp.Size = val
60        self._value = tmp
61    @property
62    def style(self) -> FontStyle:
63        """Gets or sets the font style."""
64        val = int(self._value.Style)
65        return FontStyle(val)
66    @style.setter
67    def style(self, val: FontStyle):
68        tmp = self._value
69        tmp.Style = _FontStyle(val.value if hasattr(val, "value") else int(val))
70        self._value = tmp
71    @property
72    def weight(self) -> FontWeight:
73        """Gets or sets the font weight."""
74        val = int(self._value.Weight)
75        return FontWeight(val)
76    @weight.setter
77    def weight(self, val: FontWeight):
78        tmp = self._value
79        tmp.Weight = _FontWeight(val.value if hasattr(val, "value") else int(val))
80        self._value = tmp

Represents a font with a family name, size, style, and weight.

Font(*args, **kwargs)
162        def __init__(self, *args, **kwargs):
163            pass
@staticmethod
def new(*args, **kwargs):
36    @staticmethod
37    def new(*args, **kwargs):
38        """Generic factory method for Font. Use overloads for IDE type hints."""
39        return Font(*args, **kwargs)

Generic factory method for Font. Use overloads for IDE type hints.

family_name: str
41    @property
42    def family_name(self) -> str:
43        """Gets or sets the font family name."""
44        val = self._value.FamilyName
45        return val

Gets or sets the font family name.

size: int
51    @property
52    def size(self) -> int:
53        """Gets or sets the font size."""
54        val = self._value.Size
55        return val

Gets or sets the font size.

61    @property
62    def style(self) -> FontStyle:
63        """Gets or sets the font style."""
64        val = int(self._value.Style)
65        return FontStyle(val)

Gets or sets the font style.

71    @property
72    def weight(self) -> FontWeight:
73        """Gets or sets the font weight."""
74        val = int(self._value.Weight)
75        return FontWeight(val)

Gets or sets the font weight.