mirror of
https://github.com/twardoch/fonttools-opentype-feature-freezer.git
synced 2024-10-03 16:27:17 +03:00
Building: v1.32.0
This commit is contained in:
parent
0d031eb488
commit
b26418d7c4
@ -8,7 +8,7 @@ _Note: This tool actually remaps the `cmap` table of the font by applying the sp
|
||||
|
||||
This tool comes in two versions: **OTFeatureFreezer**: a simple GUI (graphical) app for macOS and Windows that you can download and run without any special perparations, and **pyftfeatfreeze**: a CLI (command-line) app that required Python 3.6 or newer to be installed on your computer.
|
||||
|
||||
Current version: **[1.32.0](https://github.com/twardoch/fonttools-opentype-feature-freezer/blob/master/README.md#changelog)**
|
||||
Current version: **[1.32](https://github.com/twardoch/fonttools-opentype-feature-freezer/blob/master/README.md#changelog)**
|
||||
|
||||
- [Download and install](https://twardoch.github.io/fonttools-opentype-feature-freezer/)
|
||||
- [Documentation](https://github.com/twardoch/fonttools-opentype-feature-freezer/blob/master/README.md#documentation)
|
||||
@ -184,8 +184,8 @@ This tool is written for Python 3.6+, and uses [fontTools/TTX](https://github.co
|
||||
|
||||
### Changelog
|
||||
|
||||
- **1.32.0**: Changes the `-s` (script) option so that if it’s not provided, the remapping is in all scripts.
|
||||
- **1.31.0**: Changes the `-S` (suffix) option so that if it’s not provided, no sufix is added, and added the GUI apps.
|
||||
- **1.32**: Changes the `-s` (script) option so that if it’s not provided, the remapping is in all scripts.
|
||||
- **1.31**: Changes the `-S` (suffix) option so that if it’s not provided, no sufix is added, and added the GUI apps.
|
||||
- Previously, this tool was published as a sub-tool in a [fonttools-utils](https://github.com/twardoch/fonttools-utils/tree/master/pyftfeatfreeze) repo
|
||||
- The other tools of the `fonttools-utils` repo are now at [fonttools-ttxjson](https://github.com/twardoch/fonttools-ttxjson) and [mac-os-x-system-font-replacer](https://github.com/twardoch/mac-os-x-system-font-replacer)
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import re
|
||||
import biplist
|
||||
import os.path
|
||||
|
||||
@ -17,7 +18,17 @@ import os.path
|
||||
|
||||
# .. Useful stuff ..............................................................
|
||||
|
||||
application = defines.get('app', os.path.join('build', 'dist-mac', 'OTFeatureFreezer.app'))
|
||||
def get_version(*args):
|
||||
ver = ""
|
||||
verstrline = open(os.path.join('..', 'opentype_feature_freezer', '__init__.py'), "rt").read()
|
||||
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
|
||||
mo = re.search(VSRE, verstrline, re.M)
|
||||
if mo:
|
||||
ver = mo.group(1)
|
||||
return ver
|
||||
|
||||
application = defines.get('app', os.path.join(
|
||||
'build', 'dist-mac', 'OTFeatureFreezer.app'))
|
||||
appname = os.path.basename(application)
|
||||
|
||||
|
||||
@ -34,11 +45,10 @@ def icon_from_app(app_path):
|
||||
# .. Basics ....................................................................
|
||||
|
||||
# Uncomment to override the output filename
|
||||
# filename = 'test.dmg'
|
||||
filename = "../download/OTFeatureFreezer.dmg"
|
||||
|
||||
# Uncomment to override the output volume name
|
||||
# volume_name = 'Test'
|
||||
|
||||
volume_name = 'OTFeatureFreezer %s' % (get_version())
|
||||
|
||||
# Volume format (see hdiutil create -help)
|
||||
format = defines.get('format', 'UDBZ')
|
||||
|
@ -23,7 +23,7 @@ LicenseFile=..\LICENSE
|
||||
; Uncomment the following line to run in non administrative install mode (install for current user only.)
|
||||
;PrivilegesRequired=lowest
|
||||
OutputDir=build\dist-win
|
||||
OutputBaseFilename=setup_featfreeze
|
||||
OutputBaseFilename=setup_featfreeze_{#MyAppVersion}
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
WizardStyle=modern
|
||||
|
@ -146,7 +146,7 @@ function buildmac() {
|
||||
--distpath="$cwd/build/dist-mac" \
|
||||
--workpath="$cwd/build" \
|
||||
-y "pyinstaller-mac.spec"
|
||||
dmgbuild -s "dmgbuild_settings.py" "OTFeatureFreezer" "../download/OTFeatureFreezer.dmg"
|
||||
dmgbuild -s "dmgbuild_settings.py" "" ""
|
||||
#rm -rf "$cwd/build/dist-mac"
|
||||
}
|
||||
|
||||
@ -160,7 +160,9 @@ function buildwin() {
|
||||
pp "## Building Win EXE installer"
|
||||
wine "$ISSEXE" /dMyAppVersion="$VER" featfreeze.iss /Q
|
||||
pp "## Building Win ZIP"
|
||||
rm -rf "../download/OTFeatureFreezer.zip" && zip -j "../download/OTFeatureFreezer.zip" "build/dist-win/setup_featfreeze.exe"
|
||||
rm -rf "../download/OTFeatureFreezer.zip" && zip -j \
|
||||
"../download/OTFeatureFreezer.zip" \
|
||||
"build/dist-win/setup_featfreeze_$VER.exe"
|
||||
}
|
||||
|
||||
function build() {
|
||||
|
@ -1,13 +1,24 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
|
||||
import re
|
||||
import gooey
|
||||
from PyInstaller.building.api import EXE, PYZ, COLLECT
|
||||
from PyInstaller.building.build_main import Analysis
|
||||
from PyInstaller.building.datastruct import Tree
|
||||
from PyInstaller.building.osx import BUNDLE
|
||||
|
||||
def get_version(*args):
|
||||
ver = ""
|
||||
verstrline = open(os.path.join('..', 'opentype_feature_freezer', '__init__.py'), "rt").read()
|
||||
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
|
||||
mo = re.search(VSRE, verstrline, re.M)
|
||||
if mo:
|
||||
ver = mo.group(1)
|
||||
return ver
|
||||
|
||||
version = get_version()
|
||||
|
||||
gooey_root = os.path.dirname(gooey.__file__)
|
||||
gooey_languages = Tree(os.path.join(
|
||||
gooey_root, 'languages'), prefix='gooey/languages')
|
||||
@ -63,6 +74,8 @@ app = BUNDLE(
|
||||
info_plist={
|
||||
'NSPrincipalClass': 'NSApplication',
|
||||
'NSAppleScriptEnabled': False,
|
||||
'NSHighResolutionCapable': 'True'
|
||||
'NSHighResolutionCapable': 'True',
|
||||
'CFBundleShortVersionString': version,
|
||||
'CFBundleSupportedPlatforms': ['MacOSX'],
|
||||
}
|
||||
)
|
||||
|
@ -1,12 +1,13 @@
|
||||
[tool.poetry]
|
||||
name = "opentype-feature-freezer"
|
||||
version = "1.32.0"
|
||||
version = "1.32.2"
|
||||
description = "Turns OpenType features 'on' by default in a font: reassigns the font's Unicode-to-glyph mapping fo permanently 'freeze' the 1-to-1 substitution features, and creates a new font."
|
||||
authors = [
|
||||
"Adam Twardoch <adam@twardoch.com>",
|
||||
"Nikolaus Waxweiler <nikolaus.waxweiler@daltonmaag.com>",
|
||||
]
|
||||
license = "Apache-2.0"
|
||||
readme = "README.md"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.6"
|
||||
|
@ -5,7 +5,7 @@ from typing import List, Mapping, MutableMapping, Optional, Set
|
||||
|
||||
import fontTools.ttLib as ttLib
|
||||
|
||||
__version__ = "1.32.0"
|
||||
__version__ = "1.32.2"
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -47,7 +47,8 @@ class RemapByOTL:
|
||||
try:
|
||||
self.ttx = ttLib.TTFont(self.inpath, 0, recalcBBoxes=False)
|
||||
except Exception as e:
|
||||
logger.warning("[_openFontTTX] TTX cannot open %s: %s", self.inpath, e)
|
||||
logger.warning(
|
||||
"[_openFontTTX] TTX cannot open %s: %s", self.inpath, e)
|
||||
self.success = False
|
||||
self.ttx = None
|
||||
|
||||
@ -67,7 +68,8 @@ class RemapByOTL:
|
||||
"# Scripts and languages:\n%s"
|
||||
% ("\n".join(sorted(list(set(self.reportLangSys)))))
|
||||
)
|
||||
print("# Features:\n-f %s" % (",".join(sorted(list(set(self.reportFeature))))))
|
||||
print("# Features:\n-f %s" %
|
||||
(",".join(sorted(list(set(self.reportFeature))))))
|
||||
|
||||
def _saveFontTTX(self):
|
||||
self.success = True
|
||||
@ -97,7 +99,8 @@ class RemapByOTL:
|
||||
self.filterByScript = self.options.script
|
||||
self.filterByLangSys = self.options.lang
|
||||
if "GSUB" not in self.ttx:
|
||||
logger.warning("No 'GSUB' table found in %s, nothing to do!", self.inpath)
|
||||
logger.warning(
|
||||
"No 'GSUB' table found in %s, nothing to do!", self.inpath)
|
||||
self.success = True
|
||||
return
|
||||
|
||||
@ -124,7 +127,8 @@ class RemapByOTL:
|
||||
def filterLookupList(self):
|
||||
self.success = True
|
||||
self.filterByFeatures = self.options.features.split(",")
|
||||
logger.info("[filterLookupList] Features to apply: %s", self.filterByFeatures)
|
||||
logger.info("[filterLookupList] Features to apply: %s",
|
||||
self.filterByFeatures)
|
||||
if "GSUB" not in self.ttx:
|
||||
self.success = True
|
||||
return
|
||||
@ -192,7 +196,8 @@ class RemapByOTL:
|
||||
self.subs1[i] = sub_out_first
|
||||
|
||||
if len(self.subs0) != len(self.subs1):
|
||||
raise RuntimeError("Internal error: Substitution mapping out of sync.")
|
||||
raise RuntimeError(
|
||||
"Internal error: Substitution mapping out of sync.")
|
||||
|
||||
# Zip the above mappings together.
|
||||
for sub_in, sub_out in zip(self.subs0, self.subs1):
|
||||
@ -214,7 +219,8 @@ class RemapByOTL:
|
||||
if self.options.names:
|
||||
self.names.append(sub_out)
|
||||
|
||||
logger.info("[applySubstitutions] Remap: '%s' -> '%s'", sub_in, sub_out)
|
||||
logger.info(
|
||||
"[applySubstitutions] Remap: '%s' -> '%s'", sub_in, sub_out)
|
||||
|
||||
def remapCmaps(self):
|
||||
self.success = True
|
||||
@ -296,7 +302,8 @@ class RemapByOTL:
|
||||
|
||||
logger.info("[renameFont] New family name: '%s'", family_name_new)
|
||||
logger.info("[renameFont] New full name: '%s'", full_name_new)
|
||||
logger.info("[renameFont] New PostScript name: '%s'", postscript_name_new)
|
||||
logger.info("[renameFont] New PostScript name: '%s'",
|
||||
postscript_name_new)
|
||||
|
||||
return self.success
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user