Open fabiangreffrath opened 4 years ago
The error says that the.features contain an "aalt" feature block that references a "locl" feature but the latter is not defined among the features. Check if that's the case and if so remove the reference to locl inside aalt block. The interpolation issues in mutatormath indicates that many of the glyphs are not interpolation compatible. Either you make them compatible, or you do not use the "-i" option and only build the masters, without generating instances.
Thanks for your reply! Please note that I don't have any control over the font, I merely realized it is currently impossible to build it from its glyphs source using fontmake. Is there anything that could be done to mitigate this issue on the fontmake/ufo2ft side?
The undefined locl in the aalt feature block must be fixed in the sources in order to compile the OpenType features. If the font only has discrete masters with outlines that are not designed to build interpolated instances or variable font, then you can still compile them but without passing the --interpolate option.
Indeed, it seems the following change is necessary to generate the fonts without -i
:
--- a/src/mononoki.glyphs
+++ b/src/mononoki.glyphs
@@ -37,7 +37,7 @@ name = Languagesystems;
features = (
{
automatic = 1;
-code = "feature locl;\012feature frac;\012feature ordn;\012";
+code = "";
name = aalt;
}
);
Now if we could get generating the interpolated instances to work, that would be perfect...
Thank you very much already!
Either you make them compatible
@anthrotype Could you please provide a hint what is required to make glyphs "interpolation compatible"? What does one have to do to achieve this?
The short version is that you have to make outlines, anchors and components (and their order) match across all masters. All outlines must have the same amount of points and the same type of points, only their position may be different. There is no open-source app which makes this easy I think, so you have to manually inspect the glyphs that fontmake complains about.
but maybe the font he is trying to build with -i
was not designed to be interpolatable to begin with, and only has a bunch of unrelated "masters" with "instances" sitting at the same location as their respective masters, thus not meant to be interplated in between them.
If this is the case, then 1) either you do not pass -i
and you're happy with the result, or 2) you wait for the new fontmake instantiator (https://github.com/googlefonts/fontmake/pull/555) which will not flag such non-interpolatable instances as errors (as long as they really are identical to their masters, except for some extra metadata).
Thank you very much for your replies! I'll probably stick with solution (1) then, i.e. build only masters without instances.
Does it make a difference if I pass the -M
option and install the font files from instance_ttf
or if I don't pass that option and install the font files from master_ttf
?
no, they should be the same
Sorry to bug you again, but there is still something odd with the resulting TTF fonts when building from the glyphs source. Take a look at the GTK+ font chooser: There are two Bold variants and one of them is identical to the Regular variant:
Also, how do it make sure the font is identified as monospaced?
What's the output of fc-list?
Re monospace, try this: https://github.com/madmalik/mononoki/issues/23
What's the output of fc-list?
$ fc-list | grep mononoki
/usr/share/fonts/truetype/mononoki/mononoki-Italic.ttf: mononoki:style=Italic
/usr/share/fonts/truetype/mononoki/mononoki-Regular.ttf: mononoki:style=Regular
/usr/share/fonts/truetype/mononoki/mononoki-Bold.ttf: mononoki:style=Bold
/usr/share/fonts/truetype/mononoki/mononoki-BoldItalic.ttf: mononoki,mononoki Bold:style=Bold Italic,Italic
Re monospace, try this: madmalik/mononoki#23
Thanks! It seems the first part of the solution is already been taken care of:
$ grep -r IsFixedPitch -- master_ufo/*.ufo/*
master_ufo/mononoki-BoldItalic.ufo/fontinfo.plist: <key>postscriptIsFixedPitch</key>
master_ufo/mononoki-Bold.ufo/fontinfo.plist: <key>postscriptIsFixedPitch</key>
master_ufo/mononoki-Italic.ufo/fontinfo.plist: <key>postscriptIsFixedPitch</key>
master_ufo/mononoki-Regular.ufo/fontinfo.plist: <key>postscriptIsFixedPitch</key>
But the width for the individual glyphs vary quite a lot:
$ grep '^width = [[:digit:]]\+' -- src/mononoki.glyphs | sort | uniq
width = 1150;
width = 250;
width = 493;
width = 560;
width = 563;
width = 565;
width = 567;
width = 575;
width = 577;
width = 579;
width = 580;
width = 585;
width = 587;
width = 588;
width = 590;
width = 600;
width = 75;
This is the diff between the output of sc-scan
between the fonts built from the UFO sources (which do not show this strange behavior, and the ones built from the Glyphs source:
--- /home/fabian/mononoki-ufo.txt 2019-08-07 09:16:30.514025412 +0200
+++ /home/fabian/mononoki-glyphs.txt 2019-08-07 09:17:53.186157154 +0200
@@ -1,13 +1,13 @@
master_ttf/mononoki-BoldItalic.ttf
-Pattern has 24 elts (size 32)
- family: "mononoki"(s)
- familylang: "en"(s)
- style: "BoldItalic"(s)
- stylelang: "en"(s)
- fullname: "mononoki BoldItalic"(s)
+Pattern has 23 elts (size 32)
+ family: "mononoki"(s) "mononoki Bold"(s)
+ familylang: "en"(s) "en"(s)
+ style: "Bold Italic"(s) "Italic"(s)
+ stylelang: "en"(s) "en"(s)
+ fullname: "mononoki Bold Italic"(s)
fullnamelang: "en"(s)
slant: 100(i)(s)
- weight: 200(f)(s)
+ weight: 80(f)(s)
width: 100(f)(s)
foundry: "NONE"(s)
file: "master_ttf/mononoki-BoldItalic.ttf"(s)
@@ -32,7 +32,6 @@
(s)
lang: aa|av|ay|bg|bi|br|bs|ca|ce|ch|co|cs|cy|da|de|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|io|is|it|kum|lb|lez|lt|mg|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ru|sel|sk|sl|sma|smj|so|sq|ss|st|sv|sw|tk|tl|tn|ts|uz|vo|vot|wa|wen|xh|yap|zu|an|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|li|ms|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(s)
fontversion: 65602(i)(s)
- capability: "otlayout:DFLT"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "mononoki-BoldItalic"(s)
@@ -42,7 +41,7 @@
master_ttf/mononoki-Bold.ttf
-Pattern has 24 elts (size 32)
+Pattern has 23 elts (size 32)
family: "mononoki"(s)
familylang: "en"(s)
style: "Bold"(s)
@@ -50,7 +49,7 @@
fullname: "mononoki Bold"(s)
fullnamelang: "en"(s)
slant: 0(i)(s)
- weight: 200(f)(s)
+ weight: 80(f)(s)
width: 100(f)(s)
foundry: "NONE"(s)
file: "master_ttf/mononoki-Bold.ttf"(s)
@@ -75,7 +74,6 @@
(s)
lang: aa|av|ay|bg|bi|br|bs|ca|ce|ch|co|cs|cy|da|de|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|io|is|it|kum|lb|lez|lt|mg|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ru|sel|sk|sl|sma|smj|so|sq|ss|st|sv|sw|tk|tl|tn|ts|uz|vo|vot|wa|wen|xh|yap|zu|an|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|li|ms|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(s)
fontversion: 65602(i)(s)
- capability: "otlayout:DFLT"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "mononoki-Bold"(s)
@@ -85,7 +83,7 @@
master_ttf/mononoki-Italic.ttf
-Pattern has 24 elts (size 32)
+Pattern has 23 elts (size 32)
family: "mononoki"(s)
familylang: "en"(s)
style: "Italic"(s)
@@ -118,7 +116,6 @@
(s)
lang: aa|av|ay|bg|bi|br|bs|ca|ce|ch|co|cs|cy|da|de|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|io|is|it|kum|lb|lez|lt|mg|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ru|sel|sk|sl|sma|smj|so|sq|ss|st|sv|sw|tk|tl|tn|ts|uz|vo|vot|wa|wen|xh|yap|zu|an|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|li|ms|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(s)
fontversion: 65602(i)(s)
- capability: "otlayout:DFLT"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "mononoki-Italic"(s)
@@ -128,7 +125,7 @@
master_ttf/mononoki-Regular.ttf
-Pattern has 24 elts (size 32)
+Pattern has 23 elts (size 32)
family: "mononoki"(s)
familylang: "en"(s)
style: "Regular"(s)
@@ -161,7 +158,6 @@
(s)
lang: aa|av|ay|bg|bi|br|bs|ca|ce|ch|co|cs|cy|da|de|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|io|is|it|kum|lb|lez|lt|mg|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ru|sel|sk|sl|sma|smj|so|sq|ss|st|sv|sw|tk|tl|tn|ts|uz|vo|vot|wa|wen|xh|yap|zu|an|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|li|ms|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(s)
fontversion: 65602(i)(s)
- capability: "otlayout:DFLT"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "mononoki-Regular"(s)
@fabiangreffrath try rebuinding using the latest fontmake 2.0b1 (use --pre
when you upgrade with pip since it's a pre-release). You should be able now to pass -i
option (provided there are no truly interpolated instances, but only instances at the same locations as the masters). It may be that the instances defined in the .glyphs file contain extra metadata that is not applied when only building the masters (I haven't looked at the mononoki sources).
The feature code is broken though. It seems incomplete. Glyphs seems to export it fine though. The special hex glyphs are not going to work.
@anthrotype and @madig Thank you very much! I am now building the fonts from their UFO sources and the resulting TTF files do not show the strange behavior I reported above. Also, forcefully setting all glyph widths to 575 (or 1150, respectively) was enough to recognize the fonts as monospaced.
Congratulations :) You still might want to run your changes by the original designer (and mention the broken features, but he/she probably already knows), mass-changing widths is a sledgehammer method :)
I have reported the issues upstream, thanks!
Hi there,
it is currently impossible to build the mononoki fonts [1] from their sources, because of an error in the ufo2ft step:
This is with the following Debian packages:
ii fontmake 1.8.0-1 all Compile fonts from UFO or Glyphs to OTF/TTF ii python3-ufo2ft 2.6.0-1 all Bridge from UFOs to fonttools objects ii python3-fonttools 3.35.1-1 all Converts OpenType and TrueType fonts to and from XML (Python 3 Library)
[1] https://github.com/madmalik/mononoki/tree/master