-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glyphs do not render on Firefox 66 or Chrome 74 on MacOS 10.14.4 #50
Comments
empirically this works... diff --git a/layerize.js b/layerize.js
index 99399d6..ae9e886 100644
--- a/layerize.js
+++ b/layerize.js
@@ -589,13 +589,13 @@ function processFile(fileName, data) {
ligatures.push({unicodes: unicodes, components: layers});
// create the placeholder glyph for the ligature (to be mapped to a set of color layers)
fs.writeFileSync(targetDir + "/glyphs/u" + unicodes.join("_") + ".svg",
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" enable-background="new 0 0 64 64"></svg>');
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><rect width="36" height="36"/></svg>');
codepoints.push('"u' + unicodes.join("_") + '": -1');
}
unicodes.forEach(function(u) {
// make sure we have a placeholder glyph for the individual character, or for each component of the ligature
fs.writeFileSync(targetDir + "/glyphs/u" + u + ".svg",
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" enable-background="new 0 0 64 64"></svg>');
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><rect width="36" height="36"/></svg>');
codepoints.push('"u' + u + '": ' + parseInt(u, 16));
});
}); ...but it feels rather wrong (and i'm unsure if the correct bounding box should be being used, rather than putting them all in a fixed grid). |
Proper bounding boxes are also required for typesetting Twemoji into PDF by ConTeXt as noted in http://tracker.luatex.org/view.php?id=1012#c1716 |
I rebuild the font and try this file. |
This works perfect for me! Do you have the modified source code? Thanks. 感谢 |
Would love to know what was changed too. |
https://github.com/mozilla/twemoji-colr/files/5939135/twemoji-colrv0.ttf.zip works on Mac Mojave Chrome v79 |
Here's a COLRv0 Twemoji Font updated to Emoji 14.0 I built it using a version of Google's NanoEmoji tool. |
…eports a zero size for a COLR0 glyph This issue is seen in the font from https://github.com/mozilla/twemoji-colr/. Indeed, this issue: mozilla/twemoji-colr#50 which dates back to 2019 is still active (so over 3 and half years) where some browsers do not render anything either for the glyphs. This code does the work around that if the size is reported as 0 for a COLR0 glyph, then we derived the layout offsets and size entirely from the union of the bounding boxes of the layers. Seems to work.
…eports a zero size for a COLR0 glyph This issue is seen in the font from https://github.com/mozilla/twemoji-colr/. Indeed, this issue: mozilla/twemoji-colr#50 which dates back to 2019 is still active (so over 3 and half years) where some browsers do not render anything either for the glyphs. This code does the work around that if the size is reported as 0 for a COLR0 glyph, then we derived the layout offsets and size entirely from the union of the bounding boxes of the layers. Seems to work.
Trying both the latest release and a self-built copy of the TTF, the glyphs seem to render as blanks on FF & Chrome on macOS. Safari 12.1 however works.
Poking inside the TTF using Glyph.app shows that generated glyphs seem to have no geometry on the regular base layer; only on the colour layers. Defining some geometry on the base layer seems to fix it (e.g. a bounding box, or a copy of the biggest colour layer).
I'm a bit unclear on what the right fix is for this, or how it has ended up breaking so badly. Is it to calculate a bounding box and put it in the regular layer? or something else?
The text was updated successfully, but these errors were encountered: