fontforge-variable-font 0.3.0__tar.gz → 0.4.0__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.
- {fontforge_variable_font-0.3.0/fontforge_variable_font.egg-info → fontforge_variable_font-0.4.0}/PKG-INFO +2 -1
- fontforge_variable_font-0.4.0/fontforgeVF/__init__.py +50 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforgeVF/__main__.py +12 -21
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforgeVF/delete.py +1 -5
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforgeVF/design_axes.py +1 -5
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforgeVF/export.py +6 -9
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforgeVF/instance.py +3 -2
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforgeVF/language.py +0 -7
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforgeVF/load.py +7 -28
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforgeVF/utils.py +2 -14
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0/fontforge_variable_font.egg-info}/PKG-INFO +2 -1
- fontforge_variable_font-0.4.0/fontforge_variable_font.egg-info/requires.txt +3 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/setup.cfg +2 -1
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/test/test_export.py +2 -1
- fontforge_variable_font-0.3.0/fontforgeVF/__init__.py +0 -6
- fontforge_variable_font-0.3.0/fontforge_variable_font.egg-info/requires.txt +0 -2
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/LICENSE +0 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/README.md +0 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforge_variable_font.egg-info/SOURCES.txt +0 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforge_variable_font.egg-info/dependency_links.txt +0 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforge_variable_font.egg-info/entry_points.txt +0 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/fontforge_variable_font.egg-info/top_level.txt +0 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/pyproject.toml +0 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/test/test_design_axes.py +1 -1
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/test/test_language.py +0 -0
- {fontforge_variable_font-0.3.0 → fontforge_variable_font-0.4.0}/test/test_utils.py +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fontforge_variable_font
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: A FontForge_plugin to create a variable font
|
|
5
5
|
Home-page: https://github.com/MihailJP/fontforge-variable-font
|
|
6
6
|
Author: MihailJP
|
|
@@ -17,6 +17,7 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: fonttools
|
|
19
19
|
Requires-Dist: fontmake
|
|
20
|
+
Requires-Dist: fontforge_plugin_helper
|
|
20
21
|
Dynamic: license-file
|
|
21
22
|
|
|
22
23
|
Fontforge Variable Font Plugin
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""FontForge plugin to create a variable font"""
|
|
2
|
+
|
|
3
|
+
from .delete import deleteVFInfo
|
|
4
|
+
from .design_axes import getAxisValue
|
|
5
|
+
from .export import exportVariableFont
|
|
6
|
+
from .language import languageCodeIterator, languageCodeLookup, languageCodeReverseLookup, getLanguageList
|
|
7
|
+
from .load import openVariableFont
|
|
8
|
+
from .utils import (
|
|
9
|
+
intOrFloat,
|
|
10
|
+
initPersistentDict,
|
|
11
|
+
vfInfoExists,
|
|
12
|
+
getVFValue,
|
|
13
|
+
setVFValue,
|
|
14
|
+
deleteEmptyDicts,
|
|
15
|
+
deleteVFValue,
|
|
16
|
+
setOrDeleteVFValue,
|
|
17
|
+
checkExtensionTtfOrWoff2,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
# delete
|
|
23
|
+
"deleteVFInfo",
|
|
24
|
+
|
|
25
|
+
# design_axes
|
|
26
|
+
"getAxisValue",
|
|
27
|
+
|
|
28
|
+
# export
|
|
29
|
+
"exportVariableFont",
|
|
30
|
+
|
|
31
|
+
# language
|
|
32
|
+
'languageCodeIterator',
|
|
33
|
+
'languageCodeLookup',
|
|
34
|
+
'languageCodeReverseLookup',
|
|
35
|
+
'getLanguageList',
|
|
36
|
+
|
|
37
|
+
# load
|
|
38
|
+
"openVariableFont",
|
|
39
|
+
|
|
40
|
+
# utils
|
|
41
|
+
"intOrFloat",
|
|
42
|
+
"initPersistentDict",
|
|
43
|
+
"vfInfoExists",
|
|
44
|
+
"getVFValue",
|
|
45
|
+
"setVFValue",
|
|
46
|
+
"deleteEmptyDicts",
|
|
47
|
+
"deleteVFValue",
|
|
48
|
+
"setOrDeleteVFValue",
|
|
49
|
+
"checkExtensionTtfOrWoff2",
|
|
50
|
+
]
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import fontforge
|
|
2
|
+
|
|
1
3
|
from fontforgeVF import (
|
|
2
4
|
delete,
|
|
3
5
|
design_axes,
|
|
@@ -5,25 +7,7 @@ from fontforgeVF import (
|
|
|
5
7
|
instance,
|
|
6
8
|
load
|
|
7
9
|
)
|
|
8
|
-
import
|
|
9
|
-
from typing import Literal, Callable
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def _addHook(
|
|
13
|
-
name: Literal['newFontHook', 'loadFontHook'],
|
|
14
|
-
hook: Callable[[fontforge.font], None]
|
|
15
|
-
):
|
|
16
|
-
assert isinstance(fontforge.hooks, dict)
|
|
17
|
-
if name in fontforge.hooks:
|
|
18
|
-
currentHook = fontforge.hooks[name]
|
|
19
|
-
|
|
20
|
-
def chainHook(font: fontforge.font):
|
|
21
|
-
currentHook(font)
|
|
22
|
-
hook(font)
|
|
23
|
-
|
|
24
|
-
fontforge.hooks[name] = chainHook
|
|
25
|
-
else:
|
|
26
|
-
fontforge.hooks[name] = hook
|
|
10
|
+
from fontforge_plugin_helper import addSystemHook
|
|
27
11
|
|
|
28
12
|
|
|
29
13
|
def fontforge_plugin_init(**kw):
|
|
@@ -50,6 +34,13 @@ def fontforge_plugin_init(**kw):
|
|
|
50
34
|
submenu="_Variable Font",
|
|
51
35
|
name="_Generate a variable font..."
|
|
52
36
|
)
|
|
37
|
+
|
|
38
|
+
fontforge.registerMenuItem(
|
|
39
|
+
divider=True,
|
|
40
|
+
context="Font",
|
|
41
|
+
submenu="_Variable Font",
|
|
42
|
+
)
|
|
43
|
+
|
|
53
44
|
fontforge.registerMenuItem(
|
|
54
45
|
callback=design_axes.designAxesMenu,
|
|
55
46
|
enable=None,
|
|
@@ -73,5 +64,5 @@ def fontforge_plugin_init(**kw):
|
|
|
73
64
|
)
|
|
74
65
|
|
|
75
66
|
if fontforge.hasUserInterface:
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
addSystemHook('loadFontHook', load.loadHook)
|
|
68
|
+
addSystemHook('newFontHook', load.newFontHook)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
from fontforgeVF import utils, language
|
|
2
|
-
from fontforgeVF.design_axes import designAxes, getAxisValue
|
|
3
|
-
import fontforge
|
|
4
|
-
import tempfile
|
|
5
1
|
from os import PathLike
|
|
2
|
+
import tempfile
|
|
3
|
+
|
|
4
|
+
import fontforge
|
|
5
|
+
from fontTools import ttLib
|
|
6
6
|
from fontTools.designspaceLib import (
|
|
7
7
|
DesignSpaceDocument,
|
|
8
8
|
SourceDescriptor,
|
|
@@ -11,12 +11,9 @@ from fontTools.designspaceLib import (
|
|
|
11
11
|
AxisLabelDescriptor,
|
|
12
12
|
InstanceDescriptor,
|
|
13
13
|
)
|
|
14
|
-
from fontTools import ttLib
|
|
15
|
-
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]
|
|
15
|
+
from . import utils, language
|
|
16
|
+
from .design_axes import designAxes, getAxisValue
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
def _getSourceFonts(defaultFont: fontforge.font, filterItalicRoman: bool | None = None) -> list[fontforge.font]:
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import fontforge
|
|
2
|
-
from fontforgeVF.utils import intOrFloat, checkExtensionTtfOrWoff2
|
|
3
|
-
from os import PathLike
|
|
4
|
-
from fontTools import ttLib
|
|
5
1
|
import faulthandler
|
|
6
|
-
from
|
|
2
|
+
from os import PathLike
|
|
7
3
|
|
|
4
|
+
import fontforge
|
|
5
|
+
from fontTools import ttLib
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
]
|
|
7
|
+
from .utils import intOrFloat, checkExtensionTtfOrWoff2
|
|
8
|
+
from fontforge_plugin_helper import addFontGenerateHook
|
|
12
9
|
|
|
13
10
|
|
|
14
11
|
def _checkAxisValue(ttf: ttLib.TTFont, axisValues: dict[str, int | float]):
|
|
@@ -401,29 +398,11 @@ def _generatePostHook(font: fontforge.font, target: str):
|
|
|
401
398
|
font.changed = changed
|
|
402
399
|
|
|
403
400
|
|
|
404
|
-
def _addHook(
|
|
405
|
-
font: fontforge.font,
|
|
406
|
-
name: Literal['generateFontPreHook', 'generateFontPostHook'],
|
|
407
|
-
hook: Callable[[fontforge.font, str], None]
|
|
408
|
-
):
|
|
409
|
-
assert isinstance(font.temporary, dict)
|
|
410
|
-
if name in font.temporary:
|
|
411
|
-
currentHook = font.temporary[name]
|
|
412
|
-
|
|
413
|
-
def chainHook(font: fontforge.font, target: str):
|
|
414
|
-
currentHook(font, target)
|
|
415
|
-
hook(font, target)
|
|
416
|
-
|
|
417
|
-
font.temporary[name] = chainHook
|
|
418
|
-
else:
|
|
419
|
-
font.temporary[name] = hook
|
|
420
|
-
|
|
421
|
-
|
|
422
401
|
def _addGenerateHook(font: fontforge.font):
|
|
423
402
|
if not isinstance(font.temporary, dict):
|
|
424
403
|
font.temporary = {}
|
|
425
|
-
|
|
426
|
-
|
|
404
|
+
addFontGenerateHook(font, 'generateFontPreHook', _generatePreHook)
|
|
405
|
+
addFontGenerateHook(font, 'generateFontPostHook', _generatePostHook)
|
|
427
406
|
|
|
428
407
|
|
|
429
408
|
def _loadHook_ttf(font: fontforge.font):
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import fontforge
|
|
2
|
-
import re
|
|
3
1
|
from os import PathLike
|
|
2
|
+
import re
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
__all__ = [
|
|
7
|
-
"intOrFloat",
|
|
8
|
-
"initPersistentDict",
|
|
9
|
-
"vfInfoExists",
|
|
10
|
-
"getVFValue",
|
|
11
|
-
"setVFValue",
|
|
12
|
-
"deleteEmptyDicts",
|
|
13
|
-
"deleteVFValue",
|
|
14
|
-
"setOrDeleteVFValue",
|
|
15
|
-
"checkExtensionTtfOrWoff2",
|
|
16
|
-
]
|
|
4
|
+
import fontforge
|
|
17
5
|
|
|
18
6
|
|
|
19
7
|
def intOrFloat(val):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fontforge_variable_font
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: A FontForge_plugin to create a variable font
|
|
5
5
|
Home-page: https://github.com/MihailJP/fontforge-variable-font
|
|
6
6
|
Author: MihailJP
|
|
@@ -17,6 +17,7 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: fonttools
|
|
19
19
|
Requires-Dist: fontmake
|
|
20
|
+
Requires-Dist: fontforge_plugin_helper
|
|
20
21
|
Dynamic: license-file
|
|
21
22
|
|
|
22
23
|
Fontforge Variable Font Plugin
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = fontforge_variable_font
|
|
3
|
-
version = 0.
|
|
3
|
+
version = 0.4.0
|
|
4
4
|
author = MihailJP
|
|
5
5
|
author_email = mihailjp@gmail.com
|
|
6
6
|
description = A FontForge_plugin to create a variable font
|
|
@@ -24,6 +24,7 @@ python_requires = >=3.10
|
|
|
24
24
|
install_requires =
|
|
25
25
|
fonttools
|
|
26
26
|
fontmake
|
|
27
|
+
fontforge_plugin_helper
|
|
27
28
|
|
|
28
29
|
[options.entry_points]
|
|
29
30
|
fontforge_plugin =
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|