mfont 0.1.1__tar.gz → 0.1.3__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.
@@ -1,12 +1,20 @@
1
- Metadata-Version: 2.4
2
- Name: mfont
3
- Version: 0.1.1
4
- Summary: Add your description here
5
- Requires-Python: >=3.12
6
- Description-Content-Type: text/markdown
7
- Requires-Dist: matplotlib
8
-
9
-
10
- # v0.1.1
11
- 🧹 默认字体从 `lgx` 改为 宋体 + `roman`
12
- 字体来源 [AaaGss/Font_RomanSong](https://github.com/AaaGss/Font_RomanSong) 组合字体
1
+ Metadata-Version: 2.4
2
+ Name: mfont
3
+ Version: 0.1.3
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: matplotlib
8
+
9
+
10
+ `pip install mfont`
11
+
12
+ ```python
13
+ import mfont.load_font
14
+
15
+ ...
16
+ ```
17
+
18
+ # v0.1.2
19
+ 🧹 默认字体从 `lgx` 改为 宋体 + `roman`
20
+ 字体来源 [AaaGss/Font_RomanSong](https://github.com/AaaGss/Font_RomanSong) 组合字体
@@ -1,4 +1,12 @@
1
-
2
- # v0.1.1
3
- 🧹 默认字体从 `lgx` 改为 宋体 + `roman`
4
- 字体来源 [AaaGss/Font_RomanSong](https://github.com/AaaGss/Font_RomanSong) 组合字体
1
+
2
+ `pip install mfont`
3
+
4
+ ```python
5
+ import mfont.load_font
6
+
7
+ ...
8
+ ```
9
+
10
+ # v0.1.2
11
+ 🧹 默认字体从 `lgx` 改为 宋体 + `roman`
12
+ 字体来源 [AaaGss/Font_RomanSong](https://github.com/AaaGss/Font_RomanSong) 组合字体
@@ -0,0 +1,18 @@
1
+ [project]
2
+ name = "mfont"
3
+ version = "0.1.3"
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ dependencies = [
8
+ "matplotlib"
9
+ ]
10
+
11
+ [dependency-groups]
12
+ dev = [
13
+ "build",
14
+ "twine>=6.2.0",
15
+ ]
16
+
17
+ [tool.setuptools.package-data]
18
+ mfont = ["fonts/**/*"]
@@ -1,4 +1,4 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,12 +1,12 @@
1
- """
2
- 快速加载字体工具
3
-
4
- - mfont.load_font 加载 宋体 + roman - fonts from [https://github.com/AaaGss/Font_RomanSong]
5
- - mfont.load_font.load_lxg - 加载 LXGW 字体
6
- - mfont.load_font.load_heiti() # 加载方正黑体
7
- - mfont.load_font.reset_font() # 重新加载 LXGW 字体
8
- - mfont.load_font.switch(xxx) # 加载本地字体
9
-
10
- """
11
-
1
+ """
2
+ 快速加载字体工具
3
+
4
+ - mfont.load_font 加载 宋体 + roman - fonts from [https://github.com/AaaGss/Font_RomanSong]
5
+ - mfont.load_font.load_lxg - 加载 LXGW 字体
6
+ - mfont.load_font.load_heiti() # 加载方正黑体
7
+ - mfont.load_font.reset_font() # 重新加载 LXGW 字体
8
+ - mfont.load_font.switch(xxx) # 加载本地字体
9
+
10
+ """
11
+
12
12
  __version__ = "0.1.0"
@@ -1,49 +1,49 @@
1
- from pathlib import Path
2
-
3
- import matplotlib
4
- from matplotlib import font_manager
5
-
6
-
7
- FONT_DIR = Path(__file__).parent / "fonts"
8
-
9
- def _auto_configure(debug: bool=False):
10
- # font_dir_path = get_font_ttf_path()
11
- font_files = font_manager.findSystemFonts(fontpaths=str(FONT_DIR))
12
- # FONT_NAME = "LXGW WenKai GB Lite"
13
- FONT_NAME = "RomanSong"
14
-
15
- if debug:
16
- # 开发模式,打印字体名
17
- for fpath in font_files:
18
- fp = font_manager.FontProperties(fname=fpath)
19
- print(fp.get_name())
20
- font_manager.fontManager.addfont(fpath)
21
- FONT_NAME = fp.get_name()
22
- else:
23
- # 正式模式,只加载指定字体
24
- for fpath in font_files:
25
- font_manager.fontManager.addfont(fpath)
26
-
27
-
28
- matplotlib.rc('font', family=FONT_NAME)
29
- matplotlib.rc('axes', unicode_minus=False)
30
-
31
- def switch(fpath: str|Path):
32
- fp = font_manager.FontProperties(fname=fpath)
33
- font_manager.fontManager.addfont(path=fpath)
34
-
35
- matplotlib.rc('font', family=fp.get_name())
36
-
37
- def reset_font():
38
- _auto_configure()
39
-
40
- def load_lxg():
41
- FONT_NAME = "LXGW WenKai GB Lite"
42
- matplotlib.rc('font', family=FONT_NAME)
43
-
44
- def load_heiti():
45
- FONT_NAME = "FZHei-B01S"
46
- matplotlib.rc('font', family=FONT_NAME)
47
-
48
- _auto_configure()
49
-
1
+ from pathlib import Path
2
+
3
+ import matplotlib
4
+ from matplotlib import font_manager
5
+
6
+
7
+ FONT_DIR = Path(__file__).parent / "fonts"
8
+
9
+ def _auto_configure(debug: bool=False):
10
+ # font_dir_path = get_font_ttf_path()
11
+ font_files = font_manager.findSystemFonts(fontpaths=str(FONT_DIR))
12
+ # FONT_NAME = "LXGW WenKai GB Lite"
13
+ FONT_NAME = "RomanSong"
14
+
15
+ if debug:
16
+ # 开发模式,打印字体名
17
+ for fpath in font_files:
18
+ fp = font_manager.FontProperties(fname=fpath)
19
+ print(fp.get_name())
20
+ font_manager.fontManager.addfont(fpath)
21
+ FONT_NAME = fp.get_name()
22
+ else:
23
+ # 正式模式,只加载指定字体
24
+ for fpath in font_files:
25
+ font_manager.fontManager.addfont(fpath)
26
+
27
+
28
+ matplotlib.rc('font', family=FONT_NAME)
29
+ matplotlib.rc('axes', unicode_minus=False)
30
+
31
+ def switch(fpath: str|Path):
32
+ fp = font_manager.FontProperties(fname=fpath)
33
+ font_manager.fontManager.addfont(path=fpath)
34
+
35
+ matplotlib.rc('font', family=fp.get_name())
36
+
37
+ def reset_font():
38
+ _auto_configure()
39
+
40
+ def load_lxg():
41
+ FONT_NAME = "LXGW WenKai GB Lite"
42
+ matplotlib.rc('font', family=FONT_NAME)
43
+
44
+ def load_heiti():
45
+ FONT_NAME = "FZHei-B01S"
46
+ matplotlib.rc('font', family=FONT_NAME)
47
+
48
+ _auto_configure()
49
+
@@ -1,12 +1,20 @@
1
- Metadata-Version: 2.4
2
- Name: mfont
3
- Version: 0.1.1
4
- Summary: Add your description here
5
- Requires-Python: >=3.12
6
- Description-Content-Type: text/markdown
7
- Requires-Dist: matplotlib
8
-
9
-
10
- # v0.1.1
11
- 🧹 默认字体从 `lgx` 改为 宋体 + `roman`
12
- 字体来源 [AaaGss/Font_RomanSong](https://github.com/AaaGss/Font_RomanSong) 组合字体
1
+ Metadata-Version: 2.4
2
+ Name: mfont
3
+ Version: 0.1.3
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: matplotlib
8
+
9
+
10
+ `pip install mfont`
11
+
12
+ ```python
13
+ import mfont.load_font
14
+
15
+ ...
16
+ ```
17
+
18
+ # v0.1.2
19
+ 🧹 默认字体从 `lgx` 改为 宋体 + `roman`
20
+ 字体来源 [AaaGss/Font_RomanSong](https://github.com/AaaGss/Font_RomanSong) 组合字体
@@ -6,4 +6,7 @@ src/mfont.egg-info/PKG-INFO
6
6
  src/mfont.egg-info/SOURCES.txt
7
7
  src/mfont.egg-info/dependency_links.txt
8
8
  src/mfont.egg-info/requires.txt
9
- src/mfont.egg-info/top_level.txt
9
+ src/mfont.egg-info/top_level.txt
10
+ src/mfont/fonts/FangZhengHeiTiJianTi-1.ttf
11
+ src/mfont/fonts/LXGWWenKaiGBLite-Regular.ttf
12
+ src/mfont/fonts/RomanSong.ttf
@@ -1,9 +0,0 @@
1
- [project]
2
- name = "mfont"
3
- version = "0.1.1"
4
- description = "Add your description here"
5
- readme = "README.md"
6
- requires-python = ">=3.12"
7
- dependencies = [
8
- "matplotlib",
9
- ]