Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FontCustom/fontcustom
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: jdell64/fontcustom
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 7 commits
  • 2 files changed
  • 3 contributors

Commits on Jul 27, 2015

  1. should work on windows now

    netaura committed Jul 27, 2015

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    578612c View commit details
  2. Merge branch 'windows'

    netaura committed Jul 27, 2015
    Copy the full SHA
    c9a6ce8 View commit details

Commits on Jul 29, 2015

  1. Copy the full SHA
    e715ab4 View commit details
  2. Merge branch 'windows'

    netaura committed Jul 29, 2015
    Copy the full SHA
    05f277c View commit details

Commits on Jun 21, 2017

  1. Copy the full SHA
    d90ddfe View commit details
  2. moar windows support

    jdell64 committed Jun 21, 2017
    Copy the full SHA
    5214ddd View commit details
  3. Update base.rb

    missing a dollar sign
    jdell64 authored Jun 21, 2017
    Copy the full SHA
    c79a398 View commit details
Showing with 16 additions and 10 deletions.
  1. +2 −3 README.md
  2. +14 −7 lib/fontcustom/base.rb
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ Add `gem 'fontcustom'` to your gem file.
```
bundle
```
Create a `fontcustom.yml` file with something like this:
Create a `fontcustom.yml` file with something like this:
```yml
# config/fontcustom.yml

@@ -148,8 +148,7 @@ For example, if you added a file called 'cars54' icon would look something like
```html
<i class="icon-cars54"</i>
```

Now the font is adjustable to css 'font-size' and 'color'.
Now the font is adjustable to css 'font-size' and 'color'.

**Save CSS and fonts to different locations**

21 changes: 14 additions & 7 deletions lib/fontcustom/base.rb
Original file line number Diff line number Diff line change
@@ -3,8 +3,11 @@
module Fontcustom
class Base
include Utility


private $which_command

def initialize(raw_options)
set_which_command
check_fontforge
check_woff2
manifest = '.fontcustom-manifest.json'
@@ -13,6 +16,14 @@ def initialize(raw_options)
@manifest = Fontcustom::Manifest.new(manifest, @options)
end

def set_which_command
if !Gem.win_platform?
which_command = 'which'
else # on windows
which_command = 'where'
end
end

def compile
current = checksum
previous = @manifest.get(:checksum)[:previous]
@@ -31,18 +42,14 @@ def compile
private

def check_fontforge
if !Gem.win_platform?
fontforge = `which fontforge`
else
fontforge = `where fontforge`
end
fontforge = `#{which_command} fontforge`
if fontforge == "" || fontforge == "fontforge not found"
raise Fontcustom::Error, "Please install fontforge first. Visit <http://fontcustom.com> for instructions."
end
end

def check_woff2
woff2 = `which woff2_compress`
woff2 = `#{which_command} 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