Skip to content
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

Failed to build nerd font with font-patcher #289

Closed
atauzki opened this issue Dec 4, 2024 · 12 comments
Closed

Failed to build nerd font with font-patcher #289

atauzki opened this issue Dec 4, 2024 · 12 comments

Comments

@atauzki
Copy link

atauzki commented Dec 4, 2024

cmdline: python ./build.py --no-hinted --feat cv01,cv02
config:

{
  "$schema": "./source/schema.json",
  "family_name": "Maple Term NF33",
  "use_hinted": true,
  "pool_size": 4,
  "ligature": true,
  "feature_freeze": {
    "cv01": "ignore",
    "cv02": "ignore",
    "cv03": "ignore",
    "cv04": "ignore",
    "cv31": "ignore",
    "cv32": "ignore",
    "cv33": "ignore",
    "cv34": "ignore",
    "cv35": "ignore",
    "cv36": "ignore",
    "cv98": "ignore",
    "cv99": "ignore",
    "ss01": "ignore",
    "ss02": "ignore",
    "ss03": "ignore",
    "ss04": "ignore",
    "ss05": "ignore",
    "ss06": "ignore",
    "ss07": "ignore",
    "ss08": "ignore",
    "zero": "ignore"
  },
  "nerd_font": {
    "enable": true,
    "version": "3.3.0",
    "mono": false,
    "use_font_patcher": true,
    "glyphs": [
      "--complete"
    ],
    "extra_args": []
  },
  "cn": {
    "enable": false,
    "with_nerd_font": true,
    "fix_meta_table": true,
    "clean_cache": false,
    "narrow": false,
    "use_hinted": false,
    "use_static_base_font": true
  }
}

error log:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/home/hp/miniconda3/envs/maple/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/home/hp/miniconda3/envs/maple/lib/python3.11/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
           ^^^^^^^^^^^^^^^^
  File "/home/hp/Projects/maple-font/./build.py", line 656, in build_nf
    nf_font = get_ttfont(f)
              ^^^^^^^^^^^^^
  File "/home/hp/Projects/maple-font/./build.py", line 643, in build_nf_by_font_patcher
    font = TTFont(_path)
           ^^^^^^^^^^^^^
  File "/home/hp/miniconda3/envs/maple/lib/python3.11/site-packages/fontTools/ttLib/ttFont.py", line 145, in __init__
    file = open(file, "rb")
           ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'fonts/NF/MapleMonoNerdFont-ExtraBold.ttf'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/hp/Projects/maple-font/./build.py", line 1048, in <module>
    main()
  File "/home/hp/Projects/maple-font/./build.py", line 898, in main
    run_build(font_config.pool_size, _build_fn, build_option.output_ttf)
  File "/home/hp/Projects/maple-font/./build.py", line 788, in run_build
    p.map(fn, listdir(dir))
  File "/home/hp/miniconda3/envs/maple/lib/python3.11/multiprocessing/pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hp/miniconda3/envs/maple/lib/python3.11/multiprocessing/pool.py", line 774, in get
    raise self._value
FileNotFoundError: [Errno 2] No such file or directory: 'fonts/NF/MapleMonoNerdFont-ExtraBold.ttf'

generated font names:

-rw-r--r-- 1 hp hp 2382260 12月 4日 21:16 MapleTermNF33NerdFont-BoldItalic.ttf
-rw-r--r-- 1 hp hp 2361420 12月 4日 21:15 MapleTermNF33NerdFont-Bold.ttf
-rw-r--r-- 1 hp hp 2381764 12月 4日 21:15 MapleTermNF33NerdFont-ExtraBoldItalic.ttf
-rw-r--r-- 1 hp hp 2361116 12月 4日 21:15 MapleTermNF33NerdFont-ExtraBold.ttf
-rw-r--r-- 1 hp hp 2382908 12月 4日 21:16 MapleTermNF33NerdFont-ExtraLightItalic.ttf
-rw-r--r-- 1 hp hp 2361928 12月 4日 21:15 MapleTermNF33NerdFont-ExtraLight.ttf
-rw-r--r-- 1 hp hp 2382140 12月 4日 21:15 MapleTermNF33NerdFont-Italic.ttf
-rw-r--r-- 1 hp hp 2382704 12月 4日 21:15 MapleTermNF33NerdFont-LightItalic.ttf
-rw-r--r-- 1 hp hp 2361532 12月 4日 21:16 MapleTermNF33NerdFont-Light.ttf
-rw-r--r-- 1 hp hp 2382508 12月 4日 21:16 MapleTermNF33NerdFont-MediumItalic.ttf
-rw-r--r-- 1 hp hp 2361448 12月 4日 21:16 MapleTermNF33NerdFont-Medium.ttf
-rw-r--r-- 1 hp hp 2360928 12月 4日 21:16 MapleTermNF33NerdFont-Regular.ttf
-rw-r--r-- 1 hp hp 2382396 12月 4日 21:15 MapleTermNF33NerdFont-SemiBoldItalic.ttf
-rw-r--r-- 1 hp hp 2361460 12月 4日 21:16 MapleTermNF33NerdFont-SemiBold.ttf
-rw-r--r-- 1 hp hp 2382088 12月 4日 21:16 MapleTermNF33NerdFont-ThinItalic.ttf
-rw-r--r-- 1 hp hp 2361300 12月 4日 21:15 MapleTermNF33NerdFont-Thin.ttf
@atauzki
Copy link
Author

atauzki commented Dec 4, 2024

And the generated font name is also not right:
image

@subframe7536
Copy link
Owner

Thanks for reporting, I will fix it today.

subframe7536 added a commit that referenced this issue Dec 4, 2024
@subframe7536
Copy link
Owner

Fixed. And the built-in Nerd Font version is upgrade to 3.3.0

@atauzki
Copy link
Author

atauzki commented Dec 4, 2024

one glyph is missing vs patcher version. U+F1AF0
image
image

and 300 missing in PUA area:
image
image

@subframe7536
Copy link
Owner

subframe7536 commented Dec 4, 2024

Caused by

unicodes=range(0xE000, 0xF1AF0),

@atauzki
Copy link
Author

atauzki commented Dec 4, 2024

and 23fb-23fe,2630,2665, 276c, 276d
that's all.

@subframe7536
Copy link
Owner

I find that the Font-Patcher.zip contains a json file that have all the glyph names and unicode. I will determine the range from it

@subframe7536
Copy link
Owner

Fixed

@atauzki
Copy link
Author

atauzki commented Dec 4, 2024

still 20 less. should be outdated glyphs of nerd font?
image
image

@subframe7536
Copy link
Owner

Seems correct

image

@atauzki
Copy link
Author

atauzki commented Dec 4, 2024

should be removed icons. e.g. F0387 and F0388 is the same, and F0388 is removed.

@atauzki atauzki closed this as completed Dec 4, 2024
@subframe7536
Copy link
Owner

Relative upstream fix: ryanoasis/nerd-fonts#1758

So the glyph names will be correctly resolved in next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants