Open Greatness7 opened 5 months ago
I was ultimately able to get this to compile by working around some of the bugs in the code:
1) Don't be on a Windows system, the build scripts are not compatible despite this not being mentioned anywhere in the readme.
2) Fix the python script as above.
3) Fix icons-webfont/.build/build-outline.mjs
by wrapping the glob
function in a promisify
.
4) Move compile-options.json
to one folder above the working directory that your script will be ran from. I had to put it in the /packages/
folder to be recognized, contrary to what the readme suggests. The code responsible for this is here.
5) Run npm run build:webfont
(again contradictory to the readme).
6) If you're including many icons, expect to wait a long time, likely hours. The build script sequentially spins up a new python instance for every single icon. Doing these in parallel would be a welcome improvement.
7) You will still get some errors and the script will ultimately fail, but this failure happens late enough that the .ttf
already exists, so I did not care to investigate further.
Seems this is still not fixed - got the same problems while compiling fonts. In addition, after fixing already mentioned issues by @Greatness7 (import sys, compile-options.json placement), I see another problem:
Error: Undefined variable.
╷
46 │ .#{$ti-prefix}-123:before { content: $ti-icon-number-123; }
│ ^^^^^^^^^^^^^^^^^^^
╵
dist/tabler-icons-outline.scss 46:38 root stylesheet
ELIFECYCLE Command failed with exit code 65.
ELIFECYCLE Command failed with exit code 65.
/usr/src/app/tabler-icons/packages/icons-webfont:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL @tabler/icons-webfont@3.9.0 build: `pnpm run copy && pnpm run build:prepare && pnpm run build:outline && pnpm run build:webfont && pnpm run build:css`
Exit status 65
It looks like aliases.json
conflict with compile-options.json
"includeIcons" array. For outlined & filled types it seems to correctly only attempt to generate only specified "includeIcons" values. However, for "all" type it tries to generate merged "includeIcons" and values from aliases.json
file, even though I don't need those.
Quick semi-fix here is to just add all aliases.json
values to "includeIcons" array OR remove aliases from aliases.json
file, i.e.:
{
"outline": {
},
"filled": {
}
}
then build command finished succesfully.
Hello, I'm wanting to compile the icon font but the instructions seem to be out of date.
The readme says to run
npm run build-iconfont
, but this script is not defined. Maybe it wantsnpm run build:webfont
? I am however wanting to get attf
out of it and not awoff
, it is not clear what command should be ran to do so.Another issue I had is that the
includeIcons
paremeter specified incompile-options.json
seems to be ignored. Or perhaps it is only being respected by some parts of the build process and not others. Despite only specifying a small handful of icons in my json, running thebuild:webfont
script seems to be executingfix-outline.py
on every possible icon which takes several hours to complete.The aforementioned script also had some errors which I had to fix locally, I've submitted a PR for that part.