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

Works with Windows. #289

Merged
merged 4 commits into from
Jun 12, 2017
Merged

Works with Windows. #289

merged 4 commits into from
Jun 12, 2017

Conversation

jdell64
Copy link
Contributor

@jdell64 jdell64 commented Jul 27, 2015

I created a few changes here:

  1. base.rb checks to see if you are on a Windows platform. It will run 'which' instead of 'where' if so.
  2. generate.py will check to see if the os.name is 'nt'. If it is, it will open 'sfnt2woff.exe' instead of sfnt2woff. Note: mignw will not come back as 'nt' this should not cause any issues.
  3. sfnt2woff.exe is added to scripts folder.

@skolmer
Copy link

skolmer commented Jul 28, 2015

@jdell64 Thanks! @kaizau Please accept this pull request to add windows support to FontCustom

@jdell64
Copy link
Contributor Author

jdell64 commented Jul 29, 2015

I have updated it. Not sure how to get this code up here...

@jdell64 jdell64 closed this Jul 29, 2015
@jdell64 jdell64 reopened this Jul 29, 2015
@TWiStErRob TWiStErRob mentioned this pull request Jul 29, 2015
@jdell64
Copy link
Contributor Author

jdell64 commented Aug 4, 2015

I haven't heard anything back... did my new changes make it in?

@miguelcobain
Copy link

@jdell64 Can you help me installing this branch?

Now I just need to gem install fontcustom, but since these changes stil aren't on master, I need to install your branch.

Thanks for this PR! Unfortunately it isn't merged yet...

@jdell64
Copy link
Contributor Author

jdell64 commented Sep 25, 2015

Sure... You can just clone my repo wherever you installed your gems to.

On Friday, September 25, 2015, Miguel Andrade [email protected]
wrote:

@jdell64 https://github.com/jdell64 Can you help me installing this
branch?

Now I just need to gem install fontcustom, but since these changes stil
aren't on master, I need to install your branch.


Reply to this email directly or view it on GitHub
#289 (comment)
.

Richard J Tindell

Ps 102:18- "This will be written for the generation to come, That a people
yet to be created may praise the Lord."

@miguelcobain
Copy link

@jdell64 Thanks a lot! I ended up installing the normal fontcustom and replacing the directoy.
Hope this gets merged soon.

@jdell64
Copy link
Contributor Author

jdell64 commented Sep 25, 2015

Oh good.

Richard J Tindell

Ps 102:18- "This will be written for the generation to come, That a people
yet to be created may praise the Lord."

On Fri, Sep 25, 2015 at 9:59 AM, Miguel Andrade [email protected]
wrote:

@jdell64 https://github.com/jdell64 Thanks a lot! I ended up installing
the normal fontcustom and replacing the directoy.
Hope this gets merged soon.


Reply to this email directly or view it on GitHub
#289 (comment)
.

@guidobouman
Copy link

@kaizau @endtwist Time to merge this?

@JakeBeresford JakeBeresford merged commit dfbb108 into FontCustom:master Jun 12, 2017
@rasmusmilz
Copy link

rasmusmilz commented Jun 21, 2017

Happy to see this taken up again, as I'm just about to find a library that supports windows for SVG to font generation.
However i get this error when i try to run "fontcustom compile"
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/fontcustom-2.0.0/lib/fontcustom/base.rb:45:in ``': No such file or directory - which woff2_compress (Errno::ENOENT) from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/fontcustom-2.0.0/lib/fontcustom/base.rb:45:in check_woff2'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/fontcustom-2.0.0/lib/fontcustom/base.rb:9:in initialize' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/fontcustom-2.0.0/lib/fontcustom/cli.rb:83:in new'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/fontcustom-2.0.0/lib/fontcustom/cli.rb:83:in compile' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.4/lib/thor/command.rb:27:in run'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in invoke_command' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.4/lib/thor.rb:369:in dispatch'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.4/lib/thor/base.rb:444:in start' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/fontcustom-2.0.0/bin/fontcustom:5:in <top (required)>'
from C:/Ruby22-x64/bin/fontcustom:23:in load' from C:/Ruby22-x64/bin/fontcustom:23:in

'`

EDIT:
I have now done what @jdell64 suggested and copies the files from his repo to replace the gems, and it works perfect for a short term solution.
By looking at the files in jdells repo and this one, it looks like the merge are missing a lot of changes.

hope some one can fix this at some point

  • Rasmus

@jdell64
Copy link
Contributor Author

jdell64 commented Jun 21, 2017

Not sure why are you aren't getting the more helpful error message, but you are failing at this block of code:

def check_woff2
      woff2 = `which woff2_compress`
      if woff2 == "" || woff2 == "woff2_compress not found"
        fail Fontcustom::Error, "Please install woff2 first. Visit <https://github.com/google/woff2> for instructions."
      end
end

Either, you don't have woff2 installed, or I missed some windows compatibility issue. Do you have woff2 installed?

@rasmusmilz
Copy link

@jdell64 No i have not installed woff2.
Since you now added sfnt2woff to the scripts which should be a substitute for that, as far as I understand.

I have been looking a bit into the code and can see they (base.rb file) are very different in your branch(https://github.com/jdell64/fontcustom) and the master branch here. The code snippet you just copied is not present in your branch which makes sense since it should not check for something that will never exist on windows i guess?

@jdell64
Copy link
Contributor Author

jdell64 commented Jun 21, 2017

Hey, your right... that file is different... I have no idea what is going on here...

So I don't know about the woff2 requirement... If it is a requirement, then there probably needs to be something like:

    def check_woff2
        if !Gem.win_platform?
            woff2 = `which  woff2_compress `
        else
            woff2 = `where woff2_compress `
        end
      if woff2 == "" || woff2 == "woff2_compress not found"
        fail Fontcustom::Error, "Please install woff2 first. Visit <https://github.com/google/woff2> for instructions."
      end
    end

@rasmusmilz
Copy link

Yes, glad it's not just me who is confused!

But anyway thank you for the windows support.
I have been taking over a project which has been using fontcustom (on mac) which is now moved to a 100% windows env. and i haven't been able to find ANY other good svg to font libraries out there.
But yours seems to work good!

I hope at some point it will be merged correctly into the Master branch here.

@jdell64
Copy link
Contributor Author

jdell64 commented Jun 21, 2017

Looks like they added woff2 support... I think there should be a function to determine which which command (which or where) to run... let me make a PR for this.

@rasmusmilz
Copy link

@jdell64 I also found that your code is not generating the EOT file - even though it says its generated in the console. There was an issue with this on the FontCustom somewhere, but it's closed.

norydev pushed a commit to Silverfin-Engineering/fontcustom that referenced this pull request Mar 19, 2020
* works on windows
* updated readme
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

Successfully merging this pull request may close these issues.

7 participants