commit:     c64dee04ba719c720d61656f431e9da9b9ef94d3
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Thu Dec 10 14:20:55 2020 +0000
Commit:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
CommitDate: Fri Dec 11 15:20:16 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c64dee04

dev-python/ufo2ft: new package

Package-Manager: Portage-3.0.10, Repoman-3.0.2
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 dev-python/ufo2ft/Manifest                         |  1 +
 dev-python/ufo2ft/files/ufo2ft-exportedglyphs.diff | 20 ++++++
 dev-python/ufo2ft/files/ufo2ft-heightfallback.diff | 11 ++++
 dev-python/ufo2ft/metadata.xml                     | 75 ++++++++++++++++++++++
 dev-python/ufo2ft/ufo2ft-2.13.0.ebuild             | 43 +++++++++++++
 5 files changed, 150 insertions(+)

diff --git a/dev-python/ufo2ft/Manifest b/dev-python/ufo2ft/Manifest
new file mode 100644
index 00000000..99958e98
--- /dev/null
+++ b/dev-python/ufo2ft/Manifest
@@ -0,0 +1 @@
+DIST ufo2ft-2.13.0.zip 243638 BLAKE2B 
dba3c08ede255fc62e1d69308d7bdcad907ab3de2a8de1462d7cf3733e05e6c457a334f556a754ca9e646ff70ad9f7bd5423896cb0f963f60cd01d3ac43d9e06
 SHA512 
a236d68073e42471cf9f5794b19cd12dfe885c91e2236216f7112b7a2264bce95313699f19482c4ac2dc65d75ee9bd83a0a773e9ea87f6ed6c9e30929960b7e4

diff --git a/dev-python/ufo2ft/files/ufo2ft-exportedglyphs.diff 
b/dev-python/ufo2ft/files/ufo2ft-exportedglyphs.diff
new file mode 100644
index 00000000..cb5e5472
--- /dev/null
+++ b/dev-python/ufo2ft/files/ufo2ft-exportedglyphs.diff
@@ -0,0 +1,20 @@
+--- a/Lib/ufo2ft/filters/__init__.py
++++ b/Lib/ufo2ft/filters/__init__.py
+@@ -9,6 +9,7 @@ import importlib
+ from fontTools.misc.loggingTools import Timer
+ from ufo2ft.util import _LazyFontName, _GlyphSet
+ from ufo2ft.constants import FILTERS_KEY as UFO2FT_FILTERS_KEY  # keep 
previous name
++from glyphsLib.builder.constants import GLYPHLIB_PREFIX
+ 
+ 
+ logger = logging.getLogger(__name__)
+@@ -205,7 +206,8 @@ class BaseFilter(object):
+                 if glyphName in modified:
+                     continue
+                 glyph = glyphSet[glyphName]
+-                if include(glyph) and filter_(glyph):
++                if glyph.lib.get(GLYPHLIB_PREFIX+'Export', True) and \
++                    include(glyph) and filter_(glyph):
+                     modified.add(glyphName)
+ 
+         num = len(modified)

diff --git a/dev-python/ufo2ft/files/ufo2ft-heightfallback.diff 
b/dev-python/ufo2ft/files/ufo2ft-heightfallback.diff
new file mode 100644
index 00000000..53d7a001
--- /dev/null
+++ b/dev-python/ufo2ft/files/ufo2ft-heightfallback.diff
@@ -0,0 +1,11 @@
+--- a/Lib/ufo2ft/fontInfoData.py
++++ b/Lib/ufo2ft/fontInfoData.py
+@@ -251,6 +251,8 @@ staticFallbackData = dict(
+     copyright=None,
+     trademark=None,
+     italicAngle=0,
++    xHeight=0,
++    capHeight=0,
+     # not needed
+     year=None,
+     note=None,

diff --git a/dev-python/ufo2ft/metadata.xml b/dev-python/ufo2ft/metadata.xml
new file mode 100644
index 00000000..8d8c0285
--- /dev/null
+++ b/dev-python/ufo2ft/metadata.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+
+<pkgmetadata>
+  <upstream>
+    <remote-id type="github">googlefonts/ufo2ft</remote-id>
+    <remote-id type="pypi">ufo2ft</remote-id>
+  </upstream>
+  <longdescription lang="en">
+ufo2ft ("UFO to FontTools") is a fork of ufo2fdk whose goal is to generate 
OpenType font binaries from UFOs without the FDK dependency.
+
+The library provides two functions, compileOTF and compileTTF, which work 
exactly the same way:
+
+from defcon import Font
+from ufo2ft import compileOTF
+ufo = Font('MyFont-Regular.ufo')
+otf = compileOTF(ufo)
+otf.save('MyFont-Regular.otf')
+
+In most cases, the behavior of ufo2ft should match that of ufo2fdk, whose 
documentation is retained below (and hopefully is still accurate).
+Naming Data
+
+As with any OpenType compiler, you have to set the font naming data to a 
particular standard for your naming to be set correctly. In ufo2fdk, you can 
get away with setting two naming attributes in your font.info object for simple 
fonts:
+
+    familyName: The name for your family. For example, "My Garamond".
+    styleName: The style name for this particular font. For example, "Display 
Light Italic"
+
+ufo2fdk will create all of the other naming data based on thse two fields. If 
you want to use the fully automatic naming system, all of the other name 
attributes should be set to None in your font. However, if you want to override 
the automated system at any level, you can specify particular naming attributes 
and ufo2fdk will honor your settings. You don't have to set all of the 
attributes, just the ones you don't want to be automated. For example, in the 
family "My Garamond" you have eight weights. It would be nice to style map the 
italics to the romans for each weight. To do this, in the individual romans and 
italics, you need to set the style mapping data. This is done through the 
styleMapFamilyName and styleMapStyleName attributes. In each of your roman and 
italic pairs you would do this:
+
+My Garamond-Light.ufo
+
+    familyName = "My Garamond"
+    styleName = "Light"
+    styleMapFamilyName = "My Garamond Display Light"
+    styleMapStyleName = "regular"
+
+My Garamond-Light Italic.ufo
+
+    familyName = "My Garamond"
+    styleName = "Display Light Italic"
+    styleMapFamilyName = "My Garamond Display Light"
+    styleMapStyleName = "italic"
+
+My Garamond-Book.ufo
+
+    familyName = "My Garamond"
+    styleName = "Book"
+    styleMapFamilyName = "My Garamond Display Book"
+    styleMapStyleName = "regular"
+
+My Garamond-Book Italic.ufo
+
+    familyName = "My Garamond"
+    styleName = "Display Book Italic"
+    styleMapFamilyName = "My Garamond Display Book"
+    styleMapStyleName = "italic"
+
+etc.
+
+Additionally, if you have defined any naming data, or any data for that 
matter, in table definitions within your font's features that data will be 
honored.
+Feature generation
+
+If your font's features do not contain kerning/mark/mkmk features, ufo2ft will 
create them based on your font's kerning/anchor data.
+
+In addition to Adobe OpenType feature files, ufo2ft also supports the 
MTI/Monotype format. For example, a GPOS table in this format would be stored 
within the UFO at data/com.github.googlei18n.ufo2ft.mtiFeatures/GPOS.mti.
+Fallbacks
+
+Most of the fallbacks have static values. To see what is set for these, look 
at fontInfoData.py in the source code.
+
+In some cases, the fallback values are dynamically generated from other data 
in the info object. These are handled internally with functions.
+Merging TTX
+
+If the UFO data directory has a com.github.fonttools.ttx folder with TTX files 
ending with .ttx, these will be merged in the generated font. The index TTX 
(generated when using using ttx -s) is not required.
+  </longdescription>
+</pkgmetadata>

diff --git a/dev-python/ufo2ft/ufo2ft-2.13.0.ebuild 
b/dev-python/ufo2ft/ufo2ft-2.13.0.ebuild
new file mode 100644
index 00000000..40e7a788
--- /dev/null
+++ b/dev-python/ufo2ft/ufo2ft-2.13.0.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+PYTHON_COMPAT=( python3_7 )
+
+inherit distutils-r1
+
+SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.zip"
+#26 failed tests
+RESTRICT="test"
+KEYWORDS="~amd64"
+
+DESCRIPTION="A bridge from UFOs to FontTool objects"
+HOMEPAGE="https://github.com/googlefonts/ufo2ft";
+
+LICENSE="MIT"
+SLOT="0"
+
+PATCHES=( "${FILESDIR}/${PN}-exportedglyphs.diff" )
+
+RDEPEND="
+       >=dev-python/booleanOperations-0.9.0[${PYTHON_USEDEP}]
+       >=dev-python/compreffor-0.4.6[${PYTHON_USEDEP}]
+       >=dev-python/cu2qu-1.6.6[${PYTHON_USEDEP}]
+       dev-python/defcon[${PYTHON_USEDEP}]
+       >=dev-python/fonttools-4.4.0[${PYTHON_USEDEP}]
+       >=dev-python/skia-pathops-0.2.0[${PYTHON_USEDEP}]
+       >=dev-python/ufoLib2-0.5.1[${PYTHON_USEDEP}]
+"
+DEPEND="
+       ${RDEPEND}
+       test? (
+               dev-python/glyphsLib[${PYTHON_USEDEP}]
+       )
+"
+BDEPEND="
+       app-arch/unzip
+       dev-python/setuptools_scm[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests pytest

Reply via email to