{"action":"created","issue":{"url":"https://api.github.com/repos/googlefonts/fontbakery/issues/1727","repository_url":"https://api.github.com/repos/googlefonts/fontbakery","labels_url":"https://api.github.com/repos/googlefonts/fontbakery/issues/1727/labels{/name}","comments_url":"https://api.github.com/repos/googlefonts/fontbakery/issues/1727/comments","events_url":"https://api.github.com/repos/googlefonts/fontbakery/issues/1727/events","html_url":"https://github.com/googlefonts/fontbakery/issues/1727","id":300280215,"number":1727,"title":"[Variable Fonts] Check fonttools.varLib.mutator can generate a static instance from a variable font","user":{"login":"m4rc1e","id":7525512,"avatar_url":"https://avatars0.githubusercontent.com/u/7525512?v=4","gravatar_id":"","url":"https://api.github.com/users/m4rc1e","html_url":"https://github.com/m4rc1e","followers_url":"https://api.github.com/users/m4rc1e/followers","following_url":"https://api.github.com/users/m4rc1e/following{/other_user}","gists_url":"https://api.github.com/users/m4rc1e/gists{/gist_id}","starred_url":"https://api.github.com/users/m4rc1e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m4rc1e/subscriptions","organizations_url":"https://api.github.com/users/m4rc1e/orgs","repos_url":"https://api.github.com/users/m4rc1e/repos","events_url":"https://api.github.com/users/m4rc1e/events{/privacy}","received_events_url":"https://api.github.com/users/m4rc1e/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"m4rc1e","id":7525512,"avatar_url":"https://avatars0.githubusercontent.com/u/7525512?v=4","gravatar_id":"","url":"https://api.github.com/users/m4rc1e","html_url":"https://github.com/m4rc1e","followers_url":"https://api.github.com/users/m4rc1e/followers","following_url":"https://api.github.com/users/m4rc1e/following{/other_user}","gists_url":"https://api.github.com/users/m4rc1e/gists{/gist_id}","starred_url":"https://api.github.com/users/m4rc1e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m4rc1e/subscriptions","organizations_url":"https://api.github.com/users/m4rc1e/orgs","repos_url":"https://api.github.com/users/m4rc1e/repos","events_url":"https://api.github.com/users/m4rc1e/events{/privacy}","received_events_url":"https://api.github.com/users/m4rc1e/received_events","type":"User","site_admin":false},"assignees":[{"login":"m4rc1e","id":7525512,"avatar_url":"https://avatars0.githubusercontent.com/u/7525512?v=4","gravatar_id":"","url":"https://api.github.com/users/m4rc1e","html_url":"https://github.com/m4rc1e","followers_url":"https://api.github.com/users/m4rc1e/followers","following_url":"https://api.github.com/users/m4rc1e/following{/other_user}","gists_url":"https://api.github.com/users/m4rc1e/gists{/gist_id}","starred_url":"https://api.github.com/users/m4rc1e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m4rc1e/subscriptions","organizations_url":"https://api.github.com/users/m4rc1e/orgs","repos_url":"https://api.github.com/users/m4rc1e/repos","events_url":"https://api.github.com/users/m4rc1e/events{/privacy}","received_events_url":"https://api.github.com/users/m4rc1e/received_events","type":"User","site_admin":false}],"milestone":null,"comments":12,"created_at":"2018-02-26T15:24:56Z","updated_at":"2018-03-20T19:44:59Z","closed_at":null,"author_association":"COLLABORATOR","body":"This test is needed because the GF Team want to generate font instances from variable fonts.\r\n\r\nOne of our variable test fonts, MarkaziText-VF.ttf (will email it to you @felipesanches ), failed in mutator with the following cli input\r\n\r\n```\r\n$./fonttools varLib.mutator MarkaziText-VF.ttf wght=500\r\n```\r\n\r\nWhich produced the following traceback\r\n```\r\nLocation: {'wght': 500.0}\r\nLoading variable font\r\nNormalized location: {'wght': 0.33331298828125}\r\nMutating glyf/gvar tables\r\nMutating GDEF/GPOS/GSUB tables\r\nBuilding interpolated tables\r\nRemoving variable tables\r\nSaving instance font MarkaziText-VF-instance.ttf\r\nERROR: Glyph 'uni0615' has negative advance width\r\nERROR: Glyph 'uniFBB4' has negative advance width\r\nERROR: Glyph 'uni0655' has negative advance width\r\nTraceback (most recent call last):\r\n  File \"./fonttools\", line 12, in <module>\r\n    sys.exit(main())\r\n  File \"/usr/local/google/home/nyshadhr/src/fonttools/Lib/fontTools/__main__.py\", line 29, in main\r\n    runpy.run_module(mod, run_name='__main__')\r\n  File \"/usr/lib/python2.7/runpy.py\", line 180, in run_module\r\n    fname, loader, pkg_name)\r\n  File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"/usr/local/google/home/nyshadhr/src/fonttools/Lib/fontTools/varLib/mutator.py\", line 156, in <module>\r\n    sys.exit(main())\r\n  File \"/usr/local/google/home/nyshadhr/src/fonttools/Lib/fontTools/varLib/mutator.py\", line 150, in main\r\n    varfont.save(outfile)\r\n  File \"/usr/local/google/home/nyshadhr/src/fonttools/Lib/fontTools/ttLib/ttFont.py\", line 166, in save\r\n    writer_reordersTables = self._save(tmp)\r\n  File \"/usr/local/google/home/nyshadhr/src/fonttools/Lib/fontTools/ttLib/ttFont.py\", line 205, in _save\r\n    self._writeTable(tag, writer, done, tableCache)\r\n  File \"/usr/local/google/home/nyshadhr/src/fonttools/Lib/fontTools/ttLib/ttFont.py\", line 615, in _writeTable\r\n    self._writeTable(masterTable, writer, done, tableCache)\r\n  File \"/usr/local/google/home/nyshadhr/src/fonttools/Lib/fontTools/ttLib/ttFont.py\", line 619, in _writeTable\r\n    tabledata = self.getTableData(tag)\r\n  File \"/usr/local/google/home/nyshadhr/src/fonttools/Lib/fontTools/ttLib/ttFont.py\", line 637, in getTableData\r\n    return self.tables[tag].compile(self)\r\n  File \"/usr/local/google/home/nyshadhr/src/fonttools/Lib/fontTools/ttLib/tables/_h_m_t_x.py\", line 96, in compile\r\n    % (self.tableTag, self.advanceName))\r\nfontTools.ttLib.TTLibError: 'hmtx' table can't contain negative advance widths\r\n```\r\nMore info in the following fonttools pr https://github.com/fonttools/fonttools/pull/1198\r\n\r\ncc @nyshadhr9 "},"comment":{"url":"https://api.github.com/repos/googlefonts/fontbakery/issues/comments/374731873","html_url":"https://github.com/googlefonts/fontbakery/issues/1727#issuecomment-374731873","issue_url":"https://api.github.com/repos/googlefonts/fontbakery/issues/1727","id":374731873,"user":{"login":"anthrotype","id":6939968,"avatar_url":"https://avatars3.githubusercontent.com/u/6939968?v=4","gravatar_id":"","url":"https://api.github.com/users/anthrotype","html_url":"https://github.com/anthrotype","followers_url":"https://api.github.com/users/anthrotype/followers","following_url":"https://api.github.com/users/anthrotype/following{/other_user}","gists_url":"https://api.github.com/users/anthrotype/gists{/gist_id}","starred_url":"https://api.github.com/users/anthrotype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthrotype/subscriptions","organizations_url":"https://api.github.com/users/anthrotype/orgs","repos_url":"https://api.github.com/users/anthrotype/repos","events_url":"https://api.github.com/users/anthrotype/events{/privacy}","received_events_url":"https://api.github.com/users/anthrotype/received_events","type":"User","site_admin":false},"created_at":"2018-03-20T19:44:59Z","updated_at":"2018-03-20T19:44:59Z","author_association":"CONTRIBUTOR","body":"Comparing the \"broken\" and the \"fixed\" fonts that you sent me, I see that in the broken one there are some glyphs in the gvar, for which the last four tuples -- which identify the left, right, top and bottom \"phantom points\" -- have a problem: the right's x coordinate is smaller than the left's x coodinate, hence the negative horizontal advance width computed by mutator (and the subsequent failure when compiling the hmtx).\r\n\r\n```diff\r\n--- /home/clupo/Downloads/MarkaziText-VF-broken.ttx\r\n+++ /home/clupo/Downloads/MarkaziText-VF-fixed.ttx\r\n@@ -1248,12 +1248,12 @@\r\n     <!-- Most of this table will be recalculated by the compiler -->\r\n     <tableVersion value=\"1.0\"/>\r\n     <fontRevision value=\"1.0\"/>\r\n-    <checkSumAdjustment value=\"0x767e98da\"/>\r\n+    <checkSumAdjustment value=\"0x5bf1d08c\"/>\r\n     <magicNumber value=\"0x5f0f3cf5\"/>\r\n     <flags value=\"00000000 00000011\"/>\r\n     <unitsPerEm value=\"2048\"/>\r\n     <created value=\"Thu Mar  9 22:12:49 2017\"/>\r\n-    <modified value=\"Tue Feb 13 09:01:00 2018\"/>\r\n+    <modified value=\"Mon Feb 26 11:39:27 2018\"/>\r\n     <xMin value=\"-341\"/>\r\n     <yMin value=\"-893\"/>\r\n     <xMax value=\"2485\"/>\r\n@@ -112145,7 +112145,7 @@\r\n         <delta pt=\"38\" x=\"-5\" y=\"1\"/>\r\n         <delta pt=\"39\" x=\"-5\" y=\"1\"/>\r\n         <delta pt=\"40\" x=\"0\" y=\"0\"/>\r\n-        <delta pt=\"41\" x=\"-6\" y=\"0\"/>\r\n+        <delta pt=\"41\" x=\"0\" y=\"0\"/>\r\n         <delta pt=\"42\" x=\"0\" y=\"0\"/>\r\n         <delta pt=\"43\" x=\"0\" y=\"0\"/>\r\n       </tuple>\r\n@@ -112189,7 +112189,7 @@\r\n         <delta pt=\"0\" x=\"19\" y=\"-36\"/>\r\n         <delta pt=\"1\" x=\"-32\" y=\"-36\"/>\r\n         <delta pt=\"2\" x=\"0\" y=\"0\"/>\r\n-        <delta pt=\"3\" x=\"-24\" y=\"0\"/>\r\n+        <delta pt=\"3\" x=\"0\" y=\"0\"/>\r\n         <delta pt=\"4\" x=\"0\" y=\"0\"/>\r\n         <delta pt=\"5\" x=\"0\" y=\"0\"/>\r\n       </tuple>\r\n@@ -112368,7 +112368,7 @@\r\n         <coord axis=\"wght\" value=\"1.0\"/>\r\n         <delta pt=\"0\" x=\"11\" y=\"-25\"/>\r\n         <delta pt=\"1\" x=\"0\" y=\"0\"/>\r\n-        <delta pt=\"2\" x=\"-39\" y=\"0\"/>\r\n+        <delta pt=\"2\" x=\"0\" y=\"0\"/>\r\n         <delta pt=\"3\" x=\"0\" y=\"0\"/>\r\n         <delta pt=\"4\" x=\"0\" y=\"0\"/>\r\n       </tuple>\r\n```\r\n\r\nYou could to check that in each gvar tuple the last four deltas for the phantom points are such that you don't get rightSideX < leftSideX "}}
{"actor":{"display_login":"anthrotype"}}