hossam 0.0.9__py3-none-any.whl → 0.3.10__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.
Binary file
hossam/__init__.py CHANGED
@@ -1,3 +1,37 @@
1
1
  from .data_loader import load_data, load_info
2
+ from matplotlib import pyplot as plt
3
+ from matplotlib import font_manager as fm
4
+ from importlib.resources import files, as_file
5
+ from importlib.metadata import version
6
+ import warnings
2
7
 
3
- __all__ = ['load_data', 'load_info']
8
+ try:
9
+ __version__ = version('hossam')
10
+ except Exception:
11
+ __version__ = 'develop'
12
+ __all__ = ['load_data', 'load_info']
13
+
14
+ my_dpi = 200 # 이미지 선명도(100~300)
15
+ default_font_size = 6
16
+
17
+ def _init_korean_font():
18
+ """
19
+ 패키지에 포함된 한글 폰트를 기본 폰트로 설정합니다.
20
+ """
21
+ font_file = 'NotoSansKR-Regular.ttf'
22
+ try:
23
+ # 패키지 리소스에서 폰트 파일 경로 확보
24
+ with as_file(files('hossam') / font_file) as font_path:
25
+ fm.fontManager.addfont(str(font_path))
26
+ fprop = fm.FontProperties(fname=str(font_path))
27
+ fname = fprop.get_name()
28
+ plt.rcParams['font.family'] = fname
29
+ plt.rcParams['font.size'] = default_font_size
30
+ plt.rcParams['axes.unicode_minus'] = False
31
+ return
32
+ except Exception as e:
33
+ warnings.warn(f"한글 폰트 초기화: 패키지 폰트 사용 실패 ({e}).")
34
+
35
+
36
+ # 모듈 임포트 시점에 폰트 초기화 수행
37
+ _init_korean_font()