bdusell / webfont-generator

Locally convert fonts to web formats and generate CSS rules
MIT License
190 stars 34 forks source link

Error making the webfont #1

Closed Revod closed 8 years ago

Revod commented 8 years ago

Hi, thanks for your repo, I try to execute

./generate-webfonts -o assets BrandonText-Black.otf

and get

revod@Revod:~/Descargas/webfont-generator$ ./generate-webfonts -o assets BrandonText-Black.otf
Error: no se ha encontrado o cargado la clase principal ConvertFont
Traceback (most recent call last):
  File "./generate-webfonts", line 157, in <module>
    main()
  File "./generate-webfonts", line 135, in main
    sfntly_formats
  File "./generate-webfonts", line 34, in sfntly_convert
    raise RuntimeError('sfntly conversion failed')
RuntimeError: sfntly conversion failed

why?

bdusell commented 8 years ago

Did you run make beforehand? If the file src/java/ConvertFont.class is missing I get the same error:

Error: Could not find or load main class ConvertFont
Traceback (most recent call last):
  File "./generate-webfonts", line 157, in <module>
    main()
  File "./generate-webfonts", line 135, in main
    sfntly_formats
  File "./generate-webfonts", line 34, in sfntly_convert
    raise RuntimeError('sfntly conversion failed')
RuntimeError: sfntly conversion failed
Revod commented 8 years ago

Im newbie in this, and not understanding much the explanation of the readme, I download the external Dependencies but later? can you explain again that process please?

bdusell commented 8 years ago

No problem. Basically there are two steps:

  1. Run the make command in the cloned repo. This will automatically download most of the third-party libraries and compile them.
  2. Install FontForge.

Running make takes care of everything except installing FontForge. Besides FontForge you shouldn't need to install anything yourself.

Revod commented 8 years ago

I Have installed FontForge but I still see that error, and when I type make in the cloned repo get:

revod@Revod:~/Descargas/webfont-generator$ make
svn checkout http://sfntly.googlecode.com/svn/trunk/ sfntly && { mkdir -p .make/ && touch .make/sfntly-src; }
/bin/bash: svn: no se encontró la orden
make: *** [.make/sfntly-src] Error 127

try too with the sudo but get the same

bdusell commented 8 years ago

You do not have SVN installed. You will need to install SVN in order to check out the sfntly repo.

Revod commented 8 years ago

Done, thanks so much for you help. Its possible to change the code of the repo or add to generate base64-encoded?, and generate webfont's based on a fonts in specific folder and add the css lines in 1 css file?

bdusell commented 8 years ago

Perhaps. If you need to combine the css files you could always concatenate the output files or append them to your main css file:

cat assets/*.css >> build/main.css

Providing base64 encoding sounds doable. Feel free to open another issue.

Revod commented 8 years ago

Thanks for you help. Hope to see the base64 encoding soon. I'm "Watching" your repo.

bdusell commented 8 years ago

@Revod I've added base64 encoding in the latest release. There's a new setup script setup.sh which should be more intuitive to use.

Also, you now have the option of sending the CSS code to stdout. To convert all fonts in a directory and concatenate the CSS rules, you could do something like this:

find your-font-dir/ -name '*.otf' -exec ./bin/generate-webfonts -o assets/ --css - '{}' ';' > main.css
Revod commented 8 years ago

wow this is amazing, I will check the update in a moment. thanks for that. the -name is for?

bdusell commented 8 years ago

It selects all files ending in .otf. -name is part of Unix find: http://linux.die.net/man/1/find.