drawlib 0.1.4__tar.gz → 0.1.5__tar.gz

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 drawlib might be problematic. Click here for more details.

Files changed (57) hide show
  1. {drawlib-0.1.4 → drawlib-0.1.5}/PKG-INFO +1 -1
  2. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/__init__.py +1 -1
  3. drawlib-0.1.5/drawlib/v0_1/private/core/fonts.py +330 -0
  4. drawlib-0.1.5/drawlib/v0_1/private/core/theme.py +414 -0
  5. drawlib-0.1.5/drawlib/v0_1/private/core/theme_officials.py +437 -0
  6. drawlib-0.1.5/drawlib/v0_1/private/core/theme_styles.py +1506 -0
  7. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core/util.py +2 -2
  8. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core_canvas/base.py +20 -131
  9. drawlib-0.1.5/drawlib/v0_1/private/core_canvas/canvas.py +260 -0
  10. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core_canvas/image.py +2 -2
  11. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core_canvas/line.py +10 -10
  12. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core_canvas/original_arrow.py +9 -4
  13. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core_canvas/original_polygon.py +65 -28
  14. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core_canvas/patches.py +89 -36
  15. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core_canvas/text.py +8 -4
  16. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/icons/phosphor.py +2 -2
  17. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/icons/util.py +2 -2
  18. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/smartarts/sourcecode.py +1 -27
  19. {drawlib-0.1.4 → drawlib-0.1.5}/pyproject.toml +1 -1
  20. drawlib-0.1.4/drawlib/v0_1/private/core/fonts.py +0 -324
  21. drawlib-0.1.4/drawlib/v0_1/private/core/theme.py +0 -1993
  22. drawlib-0.1.4/drawlib/v0_1/private/core_canvas/canvas.py +0 -88
  23. {drawlib-0.1.4 → drawlib-0.1.5}/LICENSE.txt +0 -0
  24. {drawlib-0.1.4 → drawlib-0.1.5}/README.md +0 -0
  25. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/.pylintrc +0 -0
  26. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/__main__.py +0 -0
  27. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/apis.py +0 -0
  28. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/assets/__init__.py +0 -0
  29. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/assets/v0_1/__init__.py +0 -0
  30. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/assets/v0_1/fonticons/__init__.py +0 -0
  31. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/assets/v0_1/fonts/__init__.py +0 -0
  32. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/__init__.py +0 -0
  33. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/__main__.py +0 -0
  34. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/apis.py +0 -0
  35. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/__init__.py +0 -0
  36. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/arg_validator.py +0 -0
  37. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/command.py +0 -0
  38. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core/__init__.py +0 -0
  39. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core/colors.py +0 -0
  40. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core/dimage.py +0 -0
  41. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core/model.py +0 -0
  42. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core/model_validator.py +0 -0
  43. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/core_canvas/__init__.py +0 -0
  44. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/download.py +0 -0
  45. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/dutil.py +0 -0
  46. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/icons/__init__.py +0 -0
  47. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/logging.py +0 -0
  48. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/settings.py +0 -0
  49. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/smartarts/__init__.py +0 -0
  50. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/smartarts/cycle.py +0 -0
  51. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/smartarts/dsart.py +0 -0
  52. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/smartarts/groups.py +0 -0
  53. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/smartarts/pyramid.py +0 -0
  54. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/smartarts/table.py +0 -0
  55. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/smartarts/tree.py +0 -0
  56. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/tools.py +0 -0
  57. {drawlib-0.1.4 → drawlib-0.1.5}/drawlib/v0_1/private/util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: drawlib
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Python drawing library. Illustration as Code.
5
5
  Home-page: https://www.drawlib.com
6
6
  Author: Yuichi Ito
@@ -24,7 +24,7 @@ subpackages contains latest and old implementations.
24
24
  from typing import Final
25
25
 
26
26
  # please update here when you release new version
27
- VERSION = "0.1.4"
27
+ VERSION = "0.1.5"
28
28
 
29
29
  # might not be changed
30
30
  LIB_NAME: Final[str] = "drawlib"
@@ -0,0 +1,330 @@
1
+ # Copyright (c) 2024 Yuichi Ito (yuichi@yuichi.com)
2
+ #
3
+ # This software is licensed under the Apache License, Version 2.0.
4
+ # For more information, please visit: https://github.com/yuichi110/drawlib
5
+ #
6
+ # This software is provided "as is", without warranty of any kind,
7
+ # express or implied, including but not limited to the warranties of
8
+ # merchantability, fitness for a particular purpose and noninfringement.
9
+
10
+ """Font define module
11
+
12
+ Support font defines here.
13
+ Class ``Font`` and ``FontSourceCode`` are provided to uses.
14
+
15
+ """
16
+
17
+ from enum import Enum
18
+ import os
19
+ import drawlib.assets.v0_1.fonts
20
+ import dataclasses
21
+ from urllib.parse import urljoin
22
+ from typing import Optional, List, Tuple
23
+ from drawlib.v0_1.private.util import get_script_relative_path
24
+
25
+
26
+ def get_fontfile_tuple(path: str, md5_hash: str) -> Tuple[str, str, str]:
27
+ paths = [p for p in path.split("/") if p]
28
+
29
+ # font path
30
+ dir_path = os.path.dirname(drawlib.assets.v0_1.fonts.__file__)
31
+ font_path = os.path.join(dir_path, *paths)
32
+
33
+ # url
34
+ url = urljoin(
35
+ "https://raw.githubusercontent.com/yuichi110/drawlib_assets/main/assets/v0_1/fonts/",
36
+ "/".join(paths),
37
+ )
38
+
39
+ return (font_path, url, md5_hash)
40
+
41
+
42
+ class FontBase(Enum): ...
43
+
44
+
45
+ class Font(FontBase):
46
+ """Drawlib Fonts.
47
+
48
+ Drawlib avoid using system font since it depends on host OS.
49
+ Using only internal font files and user provided font file.
50
+
51
+ """
52
+
53
+ # sansserif
54
+ SANSSERIF_LIGHT = get_fontfile_tuple("cjk_japanese_noto_sans/light.otf", "88ce9ab7e76fed605c822b52605ac2fd")
55
+ SANSSERIF_REGULAR = get_fontfile_tuple("cjk_japanese_noto_sans/regular.otf", "6d57a40c6695bd46457315e2a9dc757a")
56
+ SANSSERIF_BOLD = get_fontfile_tuple("cjk_japanese_noto_sans/bold.otf", "64d01f4e75814352cc9dea68074f4067")
57
+
58
+ # serif
59
+ SERIF_LIGHT = get_fontfile_tuple("cjk_japanese_noto_serif/light.otf", "0def63d37c63f0945d1046dae5ab4d83")
60
+ SERIF_REGULAR = get_fontfile_tuple("cjk_japanese_noto_serif/regular.otf", "069123ca4dcbdee5cef81ef2f1d2ba8d")
61
+ SERIF_BOLD = get_fontfile_tuple("cjk_japanese_noto_serif/bold.otf", "ea7175c0325777d126622340f9c94a66")
62
+
63
+ # roboto
64
+ ROBOTO_LIGHT = get_fontfile_tuple("roboto/light.ttf", "881e150ab929e26d1f812c4342c15a7c")
65
+ ROBOTO_REGULAR = get_fontfile_tuple("roboto/regular.ttf", "8a36205bd9b83e03af0591a004bc97f4")
66
+ ROBOTO_BOLD = get_fontfile_tuple("roboto/bold.ttf", "b8e42971dec8d49207a8c8e2b919a6ac")
67
+
68
+
69
+ class FontRoboto(FontBase):
70
+ """Drawlib Fonts.
71
+
72
+ Drawlib avoid using system font since it depends on host OS.
73
+ Using only internal font files and user provided font file.
74
+
75
+ """
76
+
77
+ # roboto
78
+ ROBOTO_LIGHT = get_fontfile_tuple("roboto/light.ttf", "881e150ab929e26d1f812c4342c15a7c")
79
+ ROBOTO_REGULAR = get_fontfile_tuple("roboto/regular.ttf", "8a36205bd9b83e03af0591a004bc97f4")
80
+ ROBOTO_BOLD = get_fontfile_tuple("roboto/bold.ttf", "b8e42971dec8d49207a8c8e2b919a6ac")
81
+
82
+ # robotoserif
83
+ ROBOTO_SERIF_LIGHT = get_fontfile_tuple("roboto_serif/light.ttf", "4781a153250a8caf652b4f5b129c30ed")
84
+ ROBOTO_SERIF_REGULAR = get_fontfile_tuple("roboto_serif/regular.ttf", "2fde5a4a0cef2c19b4b6a30763322847")
85
+ ROBOTO_SERIF_BOLD = get_fontfile_tuple("roboto_serif/bold.ttf", "8ec6ab43edac2144cfd2494d522de733")
86
+
87
+ # robotomono
88
+ ROBOTO_MONO_LIGHT = get_fontfile_tuple("roboto_mono/light.ttf", "c9166464b1db95fc3cdf9b50fc7f98e2")
89
+ ROBOTO_MONO_REGULAR = get_fontfile_tuple("roboto_mono/regular.ttf", "5b04fdfec4c8c36e8ca574e40b7148bb")
90
+ ROBOTO_MONO_BOLD = get_fontfile_tuple("roboto_mono/bold.ttf", "90190d91283189e340b2a44fe560f2cd")
91
+
92
+ # condensed
93
+ ROBOTO_CONDENSED_LIGHT = get_fontfile_tuple("roboto_condensed/light.ttf", "68680c984f72eef7b2e2cf269382f2a6")
94
+ ROBOTO_CONDENSED_REGULAR = get_fontfile_tuple("roboto_condensed/regular.ttf", "f1123f4b3d926ac4f72cc8091a4b5d19")
95
+ ROBOTO_CONDENSED_BOLD = get_fontfile_tuple("roboto_condensed/bold.ttf", "0233b881b26ce6cc3884c6944940d11b")
96
+
97
+ # slab
98
+ ROBOTO_SLAB_LIGHT = get_fontfile_tuple("roboto_slab/light.ttf", "4c63608980b784c679bbadeb18d9acf4")
99
+ ROBOTO_SLAB_REGULAR = get_fontfile_tuple("roboto_slab/regular.ttf", "2100b4a02ebb94c0aa18cabd642ee507")
100
+ ROBOTO_SLAB_BOLD = get_fontfile_tuple("roboto_slab/bold.ttf", "2c44adc1ebd36820fd75012412e6f550")
101
+
102
+
103
+ class FontSanSerif(FontBase):
104
+ """Drawlib Fonts.
105
+
106
+ Drawlib avoid using system font since it depends on host OS.
107
+ Using only internal font files and user provided font file.
108
+
109
+ """
110
+
111
+ # lato
112
+ LATO_LIGHT = get_fontfile_tuple("sans_lato/light.ttf", "2bcc211c05fc425a57b2767a4cdcf174")
113
+ LATO_REGULAR = get_fontfile_tuple("sans_lato/regular.ttf", "122dd68d69fe9587e062d20d9ff5de2a")
114
+ LATO_BOLD = get_fontfile_tuple("sans_lato/bold.ttf", "24b516c266d7341c954cb2918f1c8f38")
115
+
116
+ # montserrat
117
+ MONTSERRAT_LIGHT = get_fontfile_tuple("sans_monstserrat/light.ttf", "94fbe93542f684134cad1d775947ca92")
118
+ MONTSERRAT_REGULAR = get_fontfile_tuple("sans_monstserrat/regular.ttf", "5e077c15f6e1d334dd4e9be62b28ac75")
119
+ MONTSERRAT_BOLD = get_fontfile_tuple("sans_monstserrat/bold.ttf", "ed86af2ed5bbaf879e9f2ec2e2eac929")
120
+
121
+ # oswald
122
+ OSWALD_LIGHT = get_fontfile_tuple("sans_oswald/light.ttf", "fb3af9a7ffb259726bb3cb30b74ab7dc")
123
+ OSWALD_REGULAR = get_fontfile_tuple("sans_oswald/regular.ttf", "b299a657c45aa257f1458b327f491bfb")
124
+ OSWALD_BOLD = get_fontfile_tuple("sans_oswald/bold.ttf", "c95751378db3c5c8bfd993b164e13422")
125
+
126
+ # poppins
127
+ POPPINS_LIGHT = get_fontfile_tuple("sans_poppins/light.ttf", "fcc40ae9a542d001971e53eaed948410")
128
+ POPPINS_REGULAR = get_fontfile_tuple("sans_poppins/regular.ttf", "093ee89be9ede30383f39a899c485a82")
129
+ POPPINS_BOLD = get_fontfile_tuple("sans_poppins/bold.ttf", "08c20a487911694291bd8c5de41315ad")
130
+
131
+ # raleways
132
+ RALEWAYS_LIGHT = get_fontfile_tuple("sans_raleways/light.ttf", "a36750fa9f5530b0c2760267df04ae37")
133
+ RALEWAYS_REGULAR = get_fontfile_tuple("sans_raleways/regular.ttf", "d95649da7dfb965a289ac29105ce8771")
134
+ RALEWAYS_BOLD = get_fontfile_tuple("sans_raleways/bold.ttf", "21c82294041b1504a5cbe4f566c8acd6")
135
+
136
+
137
+ class FontSerif(FontBase):
138
+ """Drawlib Fonts.
139
+
140
+ Drawlib avoid using system font since it depends on host OS.
141
+ Using only internal font files and user provided font file.
142
+
143
+ """
144
+
145
+ # courier
146
+ COURIER_REGULAR = get_fontfile_tuple("mono_courier/regular.ttf", "fba4686ed1d1b4ef05ab14db78805dbe")
147
+ COURIER_BOLD = get_fontfile_tuple("mono_courier/bold.ttf", "4acfa45d29d240044e0075a8e58f0862")
148
+
149
+ # merriweather
150
+ MERRIWEATHER_LIGHT = get_fontfile_tuple("serif_merriweather/light.ttf", "eccb6c6a243a3d44219648b6cdbc58ce")
151
+ MERRIWEATHER_REGULAR = get_fontfile_tuple("serif_merriweather/regular.ttf", "e2f219e63a575a41e10f991e9c95819a")
152
+ MERRIWEATHER_BOLD = get_fontfile_tuple("serif_merriweather/bold.ttf", "79ea53fed59f391498dfc6f2fbea97c2")
153
+
154
+ # platypi
155
+ PLATYPI_LIGHT = get_fontfile_tuple("serif_platypi/light.ttf", "113ff25ffa6c98594583200398ab5c71")
156
+ PLATYPI_REGULAR = get_fontfile_tuple("serif_platypi/regular.ttf", "a7f199dd97ff6567df8978b579213e3d")
157
+ PLATYPI_BOLD = get_fontfile_tuple("serif_platypi/bold.ttf", "344e0525c3f473c8959c66e1df44e2e1")
158
+
159
+ # playfairdisplay
160
+ PLAYFAIRDISPLAY_REGULAR = get_fontfile_tuple(
161
+ "serif_playfairdisplay/regular.ttf",
162
+ "1a28efdbd2876d90e554a67faabad24b",
163
+ )
164
+ PLAYFAIRDISPLAY_BOLD = get_fontfile_tuple("serif_playfairdisplay/bold.ttf", "9b38798112efb7cf6eca1de031cec4ca")
165
+
166
+
167
+ class FontJapanese(FontBase):
168
+ """Drawlib Fonts.
169
+
170
+ Drawlib avoid using system font since it depends on host OS.
171
+ Using only internal font files and user provided font file.
172
+
173
+ """
174
+
175
+ # sansserif
176
+ SANSSERIF_LIGHT = get_fontfile_tuple("cjk_japanese_noto_sans/light.otf", "88ce9ab7e76fed605c822b52605ac2fd")
177
+ SANSSERIF_REGULAR = get_fontfile_tuple("cjk_japanese_noto_sans/regular.otf", "6d57a40c6695bd46457315e2a9dc757a")
178
+ SANSSERIF_BOLD = get_fontfile_tuple("cjk_japanese_noto_sans/bold.otf", "64d01f4e75814352cc9dea68074f4067")
179
+
180
+ # serif
181
+ SERIF_LIGHT = get_fontfile_tuple("cjk_japanese_noto_serif/light.otf", "0def63d37c63f0945d1046dae5ab4d83")
182
+ SERIF_REGULAR = get_fontfile_tuple("cjk_japanese_noto_serif/regular.otf", "069123ca4dcbdee5cef81ef2f1d2ba8d")
183
+ SERIF_BOLD = get_fontfile_tuple("cjk_japanese_noto_serif/bold.otf", "ea7175c0325777d126622340f9c94a66")
184
+
185
+ # mplus1p
186
+ MPLUS1P_LIGHT = get_fontfile_tuple("japanese_mplus_1p/light.ttf", "01fea1cae2979588652514d83e9c0423")
187
+ MPLUS1P_REGULAR = get_fontfile_tuple("japanese_mplus_1p/regular.ttf", "bfab3ff358a7fa14c5703ad49063cb16")
188
+ MPLUS1P_BOLD = get_fontfile_tuple("japanese_mplus_1p/bold.ttf", "aa140061f44d0dda19ab2573a0ad93d3")
189
+
190
+
191
+ class FontKorean(FontBase):
192
+ """Drawlib Fonts.
193
+
194
+ Drawlib avoid using system font since it depends on host OS.
195
+ Using only internal font files and user provided font file.
196
+
197
+ """
198
+
199
+ # sansserif
200
+ SANSSERIF_LIGHT = get_fontfile_tuple("cjk_japanese_noto_sans/light.otf", "88ce9ab7e76fed605c822b52605ac2fd")
201
+ SANSSERIF_REGULAR = get_fontfile_tuple("cjk_japanese_noto_sans/regular.otf", "6d57a40c6695bd46457315e2a9dc757a")
202
+ SANSSERIF_BOLD = get_fontfile_tuple("cjk_japanese_noto_sans/bold.otf", "64d01f4e75814352cc9dea68074f4067")
203
+
204
+ # serif
205
+ SERIF_LIGHT = get_fontfile_tuple("cjk_japanese_noto_serif/light.otf", "0def63d37c63f0945d1046dae5ab4d83")
206
+ SERIF_REGULAR = get_fontfile_tuple("cjk_japanese_noto_serif/regular.otf", "069123ca4dcbdee5cef81ef2f1d2ba8d")
207
+ SERIF_BOLD = get_fontfile_tuple("cjk_japanese_noto_serif/bold.otf", "ea7175c0325777d126622340f9c94a66")
208
+
209
+
210
+ class FontChinese(FontBase):
211
+ """Drawlib Fonts.
212
+
213
+ Drawlib avoid using system font since it depends on host OS.
214
+ Using only internal font files and user provided font file.
215
+
216
+ """
217
+
218
+ # sansserif
219
+ SANSSERIF_LIGHT = get_fontfile_tuple("cjk_japanese_noto_sans/light.otf", "88ce9ab7e76fed605c822b52605ac2fd")
220
+ SANSSERIF_REGULAR = get_fontfile_tuple("cjk_japanese_noto_sans/regular.otf", "6d57a40c6695bd46457315e2a9dc757a")
221
+ SANSSERIF_BOLD = get_fontfile_tuple("cjk_japanese_noto_sans/bold.otf", "64d01f4e75814352cc9dea68074f4067")
222
+
223
+ # serif
224
+ SERIF_LIGHT = get_fontfile_tuple("cjk_japanese_noto_serif/light.otf", "0def63d37c63f0945d1046dae5ab4d83")
225
+ SERIF_REGULAR = get_fontfile_tuple("cjk_japanese_noto_serif/regular.otf", "069123ca4dcbdee5cef81ef2f1d2ba8d")
226
+ SERIF_BOLD = get_fontfile_tuple("cjk_japanese_noto_serif/bold.otf", "ea7175c0325777d126622340f9c94a66")
227
+
228
+
229
+ class FontThai(FontBase):
230
+ """Drawlib Fonts.
231
+
232
+ Drawlib avoid using system font since it depends on host OS.
233
+ Using only internal font files and user provided font file.
234
+
235
+ """
236
+
237
+ # sansserif
238
+ SANSSERIF_LIGHT = get_fontfile_tuple("thai_noto_sans/light.ttf", "fa192df61c8ef9a6a204c6323fdae9dc")
239
+ SANSSERIF_REGULAR = get_fontfile_tuple("thai_noto_sans/regular.ttf", "a84996ee5e940db8c7c2e1375728ca68")
240
+ SANSSERIF_BOLD = get_fontfile_tuple("thai_noto_sans/bold.ttf", "1296256d14a6c704f87967dc06583a64")
241
+
242
+ # serif
243
+ SERIF_LIGHT = get_fontfile_tuple("thai_noto_serif/light.ttf", "70c158b4144d83cba0f7266952ddad2f")
244
+ SERIF_REGULAR = get_fontfile_tuple("thai_noto_serif/regular.ttf", "fe28175fbf4e79f1562d30f60933cab7")
245
+ SERIF_BOLD = get_fontfile_tuple("thai_noto_serif/bold.ttf", "dc10158f174b8141c810880b98ba5a5a")
246
+
247
+
248
+ class FontArabic(FontBase):
249
+ """Drawlib Fonts.
250
+
251
+ Drawlib avoid using system font since it depends on host OS.
252
+ Using only internal font files and user provided font file.
253
+
254
+ """
255
+
256
+ # sans
257
+ SANSSERIF_LIGHT = get_fontfile_tuple("arabic_noto_sans/light.ttf", "ffcfcc231a05032bca6e0819aa60eacb")
258
+ SANSSERIF_REGULAR = get_fontfile_tuple("arabic_noto_sans/regular.ttf", "75527903c6a793772b02807c5343f4c8")
259
+ SANSSERIF_BOLD = get_fontfile_tuple("arabic_noto_sans/bold.ttf", "cda675687ed1576b7bda072838c0ed5f")
260
+
261
+ # kufi
262
+ KUFI_LIGHT = get_fontfile_tuple("arabic_noto_kufi/light.ttf", "23517c64b528b3c744bfb3be94e58836")
263
+ KUFI_REGULAR = get_fontfile_tuple("arabic_noto_kufi/regular.ttf", "600b529eb4849a54dde020e3ea389de2")
264
+ KUFI_BOLD = get_fontfile_tuple("arabic_noto_kufi/bold.ttf", "34886bd59d48cf9113e1e9386bee615e")
265
+
266
+ # naskh
267
+ NASKH_REGULAR = get_fontfile_tuple("arabic_noto_naskh/regular.ttf", "08f2d6bfe92d3e78721a0e1746397344")
268
+ NASKH_BOLD = get_fontfile_tuple("arabic_noto_naskh/bold.ttf", "3e8ac1d70691caf5ddfd36fee8acce3d")
269
+
270
+
271
+ class FontMonoSpace(FontBase):
272
+ """Drawlib Fonts.
273
+
274
+ Drawlib avoid using system font since it depends on host OS.
275
+ Using only internal font files and user provided font file.
276
+
277
+ """
278
+
279
+ # robotomono
280
+ ROBOTO_MONO_LIGHT = get_fontfile_tuple("roboto_mono/light.ttf", "c9166464b1db95fc3cdf9b50fc7f98e2")
281
+ ROBOTO_MONO_REGULAR = get_fontfile_tuple("roboto_mono/regular.ttf", "5b04fdfec4c8c36e8ca574e40b7148bb")
282
+ ROBOTO_MONO_BOLD = get_fontfile_tuple("roboto_mono/bold.ttf", "90190d91283189e340b2a44fe560f2cd")
283
+
284
+ # courier
285
+ COURIER_REGULAR = get_fontfile_tuple("mono_courier/regular.ttf", "fba4686ed1d1b4ef05ab14db78805dbe")
286
+ COURIER_BOLD = get_fontfile_tuple("mono_courier/bold.ttf", "4acfa45d29d240044e0075a8e58f0862")
287
+
288
+ # source code pro
289
+ SOURCECODEPRO_LIGHT = get_fontfile_tuple("mono_source_han_code_jp/light.otf", "ef1eb2fa9ff7c02e8a3336a70826ad47")
290
+ SOURCECODEPRO_REGULAR = get_fontfile_tuple(
291
+ "mono_source_han_code_jp/regular.otf",
292
+ "abcdbd5449ad6a30d540221a12f4a0b5",
293
+ )
294
+ SOURCECODEPRO_BOLD = get_fontfile_tuple("mono_source_han_code_jp/bold.otf", "dff5826247909bb8e04b8bf3be893386")
295
+
296
+
297
+ class FontSourceCode(FontBase):
298
+ """Drawlib Fonts which good for source code.
299
+
300
+ Drawlib avoid using system font since it depends on host OS.
301
+ Using only internal font files and user provided font file.
302
+
303
+ """
304
+
305
+ ROBOTO_MONO = get_fontfile_tuple("roboto_mono/regular.ttf", "5b04fdfec4c8c36e8ca574e40b7148bb")
306
+ COURIER = get_fontfile_tuple("mono_courier/regular.ttf", "fba4686ed1d1b4ef05ab14db78805dbe")
307
+ SOURCECODEPRO = get_fontfile_tuple("mono_source_han_code_jp/regular.otf", "abcdbd5449ad6a30d540221a12f4a0b5")
308
+
309
+
310
+ @dataclasses.dataclass
311
+ class FontFile:
312
+ file: str
313
+
314
+ @property # type: ignore[no-redef]
315
+ def file(self) -> Optional[str]:
316
+ """getter of font_file"""
317
+
318
+ return self._file
319
+
320
+ @file.setter
321
+ def file(self, value: str) -> None:
322
+ """setter of font_file"""
323
+
324
+ if isinstance(value, property):
325
+ raise ValueError("font file not specified at class FontFile.")
326
+
327
+ path = get_script_relative_path(value)
328
+ if not os.path.exists(path):
329
+ raise FileNotFoundError(f'font file "{path}" does not exist.')
330
+ self._file = path