Conversation
|
Caution: The |
|
Twemoji 15.1.0 is out ~12 hours ago; Updated accordingly. |
|
@win98se Hi, I’m wondering if you could help me with building the font on your branch. I’m getting this error without any indication of where it’s happening: Is there an npm version mismatch or some dependency is broken there? Did you try running this recently? |
I met the same issue when packaging it in archlinuxcn. |
|
Works fine for me on Ubuntu 22.04 with Node 21 when running |
My nodejs version is 22.3.0 and npm version is 10.8.1. I'm on Arch Linux. |
|
I see grunt-webfonts use fontforge, its version is 20230101-4. |
|
I have no problems building with Ubuntu 24.04, Node.js 22.3.0 and npm 10.8.1. @Tricertops Please mention your build environment (such as operating system/distro, versions of Node.js and npm) as well. |
|
@CoelacanthusHex Please try to install the packages, @Tricertops Please also try the above steps I've mentioned if you're also using Arch Linux. |
Ok. python-setuptools is missing.
|
|
@win98se Thanks! It seems like the package I’m on macOS 14.5, node.js 22.3.0, npm 10.8.1, python 3.12. However, I’m also facing another issue that I tried to fix, but didn’t find a way: Traceback (most recent call last):
File "[redacted]/TwemojiMozilla/fixDirection.py", line 1, in <module>
import fontforge
ModuleNotFoundError: No module named 'fontforge'
make: *** [build/Twemoji Mozilla.ttf] Error 1I definitely have Do you have any ideas? I’m not really skilled in python 🤷🏻♂️ |
Ah, it seems to be an environment problem. In your case, try to edit the |
|
@win98se That works, thank you very much! |
|
Twemoji v16.0.1 was released around 3 months ago. Could you refresh this PR on 16.0.1? https://github.com/jdecked/twemoji/releases/tag/v16.0.1 |
Done, thank you for notifying. 👍 |
|
Twemoji 17.0.1 is out ~6.5 hours ago; Updated accordingly. |
|
I met a build failure when try to build 17.0.1. It failed when parse 1f6d8.svg |
|
If opt out 1f6d8.svg 1fa8e.svg 1facd.svg 1fac8.svg 1faea.svg, it will build success. it may be caused by those files use some feature which xml2js library doesn't support. |
Can confirm, thank you for your info. I think I have found the problems of these 5 SVGs (they're using styles instead of directly filling colors to paths), will try to find workarounds a.s.a.p.. |
|
@CoelacanthusHex Please check whether my latest commit works. |
Yeah. It works! |
|
Hello! If it's not a problem, could I have the built.ttf file? I can't figure out how to build it despite the instructions... |
I have read your previous comment through e-mail, it seems you're using Microsoft Windows. In my opinion, it is extremely troublesome both installing and configuring Node.js, FontForge and fontTools on native Windows. I recommend you to use Windows Subsystem for Linux (WSL) instead; On Ubuntu (which is WSL's default distribution), the steps on README.md are already conclusive (you'll also need to install Node.js beforehand).
Sure, here it is; However it's safer to use an official release or your own generated font file. |
|
Twemoji 17.0.2 is out ~8 hours ago; Updated accordingly and removed the 2025-11-04 workarounds. |
It seems that every emoji font that includes number emojis has this problem if you prioritize emoji fonts over normal text fonts (personally I don't think it's Twemoji-exclusive). The general practice is to specify all normal text fonts before emoji fonts, so that emoji fonts are only used for actual emojis and not snatching displays of number characters. In case you're using CSS, you may also specify the emoji font to only display for the full range of emojis. |
|
@win98se I think that if you view the glyphs of it, you will see that it is supposed to have the digits, but instead it has nothing. |
I've found a method to manually only include wanted glyph range when generating a subset of a font (in this case, Twemoji Mozilla): # Source - https://stackoverflow.com/a/68066743
# Posted by Carson
# Retrieved 2025-11-29, License - CC BY-SA 4.0
import fontTools.subset
from pathlib import Path
import os
SOURCE_FILE = Path('Twemoji Mozilla.ttf')
def main():
output_file = Path('temp') / Path(SOURCE_FILE.stem + '.ttf')
output_file.parent.mkdir(parents=True, exist_ok=True)
args = [SOURCE_FILE,
f"--output-file={output_file}",
"--unicodes=U+00A9-E007F",
]
fontTools.subset.main([str(_) for _ in args])
os.startfile(output_file.parent)
if __name__ == "__main__":
main()In https://wakamaifondue.com/beta/, it will be shown that glyphs for Please try to generate your own Twemoji Mozilla and your desired subset of it, then test whether you're satisfied with the results. |
fonttools only has the way to specify the character you want to keep, but for the case you want to give the chars you want to remove. I have a script to generate the complement set, #!/usr/bin/python
# SPDX-FileCopyrightText: Coelacanthus
# SPDX-License-Identifier: MPL-2.0
import string
import itertools
import argparse
from typing import List, Iterable, Set, Tuple, Union
total_range: Set[int] = set(range(0x0, 0x10FFFF + 1))
def is_hex(s: str) -> bool:
# all() return True for empty
if not s:
return False
hex_digits = set(string.hexdigits)
return all(c in hex_digits for c in s)
def ranges(i: Set[int]) -> Iterable[Union[Tuple[int, int], int]]:
for a, b in itertools.groupby(enumerate(i), lambda pair: pair[1] - pair[0]):
c: List[Tuple[int, int]] = list(b)
if c[0][1] == c[-1][1]:
yield c[0][1]
else:
yield c[0][1], c[-1][1]
def range_to_str(i: Union[Tuple[int, int], int]) -> str:
match i:
case (x, y):
return "{:04X}-{:04X}".format(x, y)
case x:
return "{:04X}".format(x)
def read_ranges_from_file(file: str) -> Set[int]:
result: Set[int] = set()
with open(file, "r") as f:
for line in f.readlines():
li = line.strip()
if not li.startswith("#"):
if "-" in li:
a, b = li.split("-")
result.update(range(int(a, base=16), int(b, base=16) + 1))
elif is_hex(li):
result.add(int(li, base=16))
return result
def main() -> None:
parser = argparse.ArgumentParser(
prog="Complement",
description="This program will generate complement set of two set, if input only one, will output the complement of 0x10FFFF",
)
parser.add_argument("--flat", action='store_true')
parser.add_argument("filename1")
parser.add_argument("filename2", nargs="?", default=None)
args = parser.parse_args()
if args.filename2:
a: Set[int] = read_ranges_from_file(args.filename1)
b: Set[int] = read_ranges_from_file(args.filename2)
else:
a: Set[int] = total_range
b: Set[int] = read_ranges_from_file(args.filename1)
out: Set[int] = sorted(a - b)
if args.flat:
print("\n".join(map(range_to_str, sorted(list(out)))))
else:
print("\n".join(map(range_to_str, ranges(out))))
if __name__ == "__main__":
main()And you can invoke fontTools.subset use
|
|
@CoelacanthusHex @win98se I'm sorry but I don't know what this all is that you wrote, and how to use it. Is it for some special tool that's for fonts, or on a website? What is the website you've provided? It seems to be some kind of font viewer, but sadly doesn't seem to show all glyphs, and indeed it shows that for digits, the font file I've talked about (" ) shows (under "Number — Decimal Digit") as if it supports digits, but actually has them empty:
Why isn't there a decent UI based font editor nowadays, either on PC or online? One that shows properly all the glyphs, allows to edit, delete and add them to existing ones? |

Will fix #73, #72, #69 & #68; Also includes workarounds for jdecked/twemoji@dbb2a10#commitcomment-124376242.
Notes: