Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Linux problem. #220

Closed
bensquire opened this issue Feb 6, 2015 · 2 comments
Closed

Linux problem. #220

bensquire opened this issue Feb 6, 2015 · 2 comments
Labels

Comments

@bensquire
Copy link

Firstly, thanks for this task-runner, if I can overcome this problem its going to save me a lot of time! That said, whenever I try to generate my webfont on our Linux based Jenkins environment, I get the following error:

Running "webfont:markup" (webfont) task
/var/lib/jenkins/workspace/futureproofs-webapp-dev/node_modules/grunt-contrib-compass/node_modules/tmp/lib/tmp.js:261
  throw err;
        ^
RangeError: Offset/length out of range.
    at ByteBuffer.writeBytes (/var/lib/jenkins/workspace/futureproofs-webapp-dev/node_modules/grunt-webfont/node_modules/ttf2woff/lib/byte_buffer.js:153:12)
    at ttf2woff (/var/lib/jenkins/workspace/futureproofs-webapp-dev/node_modules/grunt-webfont/node_modules/ttf2woff/index.js:234:7)
    at /var/lib/jenkins/workspace/futureproofs-webapp-dev/node_modules/grunt-webfont/tasks/engines/node.js:72:16
    at /var/lib/jenkins/workspace/futureproofs-webapp-dev/node_modules/grunt-webfont/tasks/engines/node.js:65:6
    at /var/lib/jenkins/workspace/futureproofs-webapp-dev/node_modules/grunt-webfont/tasks/engines/node.js:198:4
    at ChildProcess.<anonymous> (/var/lib/jenkins/workspace/futureproofs-webapp-dev/node_modules/grunt-webfont/node_modules/exec/exec.js:90:5)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Socket.<anonymous> (child_process.js:969:11)
    at Socket.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)
Build step 'Execute shell' marked build as failure
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /var/lib/jenkins/workspace/futureproofs-webapp-dev/coverage/PhantomJS 1.9.8 (Linux) to /var/lib/jenkins/jobs/futureproofs-webapp-dev/htmlreports/Code_coverage
Recording test results

The same grunt task works perfectly on OSX, below is the webfont part of my grunt task.

        webfont: {

            options: {
                types: ['woff'],
                hash: false,
                styles: 'font',
                syntax: 'bem',
                stylesheet: 'scss',
                htmlDemo: true,
                engine: 'node'
            },

            markup: {
                src: 'resources/fonts/markup/bsi/*.svg',
                dest: '<%= yeoman.app %>/fonts/',
                destCss: '<%= yeoman.app %>/styles/general/fonts/',
                options: {
                    hashes: false,
                    relativeFontPath: '../fonts/',
                    font: 'markup-bsi',
                    templateOptions: {
                        baseClass: 'markup-bsi-',
                        classPrefix: 'markup-bsi-',
                        mixinPrefix: 'markup-bsi-'
                    },
                    codepoints: {
                        'margin-general-comment': 0xE602,
                        'margin-general-comment-insert': 0xE601,
                        'margin-bold': 0xE60B,
                        'margin-delete': 0xE60A,
                        'margin-insert': 0xE609,
                        'margin-italic': 0xE608,
                        'margin-lowercase': 0xE611,
                        'margin-move': 0xE607,
                        'margin-new-paragraph': 0xE60F,
                        'margin-non-italic': 0xE60E,
                        'margin-query': 0xE606,
                        'margin-replace': 0xE604,
                        'margin-tack-back': 0xE603,
                        'margin-tack-over': 0xE60C,
                        'margin-unbold': 0xE600,
                        'margin-underline': 0xE605,
                        'margin-uppercase': 0xE610,


                        'page-insert': 0xE701
                    }
                }
            }
        }

interestingly if I run the job a 2nd time I get this:

 Running "webfont:markup" (webfont) task
 Font markup-bsi wasn’t changed since last run.

but I have no idea were this stored font is as its not in:

<%= yeoman.app %>/fonts/

Any help would be greatly appreciated.
Thanks

Ben

Update:

  • It does seem to be generating the SCSS/HTML on the 1st pass

Update 2:

  • Some details, its Ubuntu 14.04, webfont 0.5.1, ttfautohint 0.97
@bensquire
Copy link
Author

I think i've cracked this. After looking at the previous issues I noticed that ttfautohint 0.97 is buggy... I followed this tutorial to upgrade it:

http://mac-blog.org.ua/grunt-webfont-windows/

more specifically:

sudo apt-get install -y autoconf automake bison flex git libtool perl build-essential libharfbuzz-dev pkg-config libfreetype6-dev libfreetype6

git clone git://repo.or.cz/ttfautohint.git
cd ttfautohint
git checkout v1.1
./bootstrap
./configure --with-qt=no --with-doc=no
make
sudo make install
cd ..
rm -rfv ttfautohint/
sudo ln -s /usr/local/bin/ttfautohint /usr/bin/

Since you have installation notes on the landing page, maybe its worth mentioning that the default ttfautohint for ubuntu is bjorked.

Thanks
Ben

@sapegin
Copy link
Owner

sapegin commented Feb 6, 2015

There are lots of different Linux systems with (most probably) different versions of ttfautohint so this would be useless (and I hope soon obsolete) information. But I’ve mentioned version 0.97 in installation instructions.

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

No branches or pull requests

2 participants