fontcustom 1.2.0 → 1.3.0.beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +16 -0
  3. data/CONTRIBUTING.md +35 -15
  4. data/TODO.md +20 -0
  5. data/lib/fontcustom.rb +11 -24
  6. data/lib/fontcustom/base.rb +56 -0
  7. data/lib/fontcustom/cli.rb +13 -12
  8. data/lib/fontcustom/generator/font.rb +63 -65
  9. data/lib/fontcustom/generator/template.rb +81 -52
  10. data/lib/fontcustom/manifest.rb +42 -0
  11. data/lib/fontcustom/options.rb +93 -80
  12. data/lib/fontcustom/scripts/generate.py +116 -127
  13. data/lib/fontcustom/templates/_fontcustom-rails.scss +13 -18
  14. data/lib/fontcustom/templates/_fontcustom.scss +10 -18
  15. data/lib/fontcustom/templates/fontcustom-preview.html +17 -24
  16. data/lib/fontcustom/templates/fontcustom.css +10 -18
  17. data/lib/fontcustom/templates/fontcustom.yml +3 -3
  18. data/lib/fontcustom/utility.rb +145 -0
  19. data/lib/fontcustom/version.rb +1 -1
  20. data/lib/fontcustom/watcher.rb +1 -1
  21. data/spec/fixtures/generators/.fontcustom-manifest-corrupted.json +12 -5
  22. data/spec/fixtures/generators/.fontcustom-manifest-empty.json +0 -0
  23. data/spec/fixtures/generators/.fontcustom-manifest.json +49 -14
  24. data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.eot +0 -0
  25. data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.svg +56 -0
  26. data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.ttf +0 -0
  27. data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.woff +0 -0
  28. data/spec/fixtures/sandbox/.gitkeep +0 -0
  29. data/spec/fontcustom/base_spec.rb +58 -0
  30. data/spec/fontcustom/cli_spec.rb +15 -0
  31. data/spec/fontcustom/generator/font_spec.rb +50 -220
  32. data/spec/fontcustom/generator/template_spec.rb +30 -194
  33. data/spec/fontcustom/generator/template_spec.rb.off +215 -0
  34. data/spec/fontcustom/manifest_spec.rb +16 -0
  35. data/spec/fontcustom/options_spec.rb +206 -208
  36. data/spec/fontcustom/utility_spec.rb +163 -0
  37. data/spec/fontcustom/{watcher_spec.rb → watcher_spec.rb.off} +0 -0
  38. data/spec/spec_helper.rb +77 -19
  39. metadata +44 -54
  40. data/lib/fontcustom/templates/_fontcustom-bootstrap-ie7.scss +0 -22
  41. data/lib/fontcustom/templates/_fontcustom-bootstrap.scss +0 -63
  42. data/lib/fontcustom/templates/fontcustom-bootstrap-ie7.css +0 -22
  43. data/lib/fontcustom/templates/fontcustom-bootstrap.css +0 -63
  44. data/lib/fontcustom/util.rb +0 -62
  45. data/spec/fixtures/generators/mixed-output/fontcustom_cc5ce52f2ae4f9ce2e7ee8131bbfee1e.eot +0 -0
  46. data/spec/fixtures/generators/mixed-output/fontcustom_cc5ce52f2ae4f9ce2e7ee8131bbfee1e.svg +0 -102
  47. data/spec/fixtures/generators/mixed-output/fontcustom_cc5ce52f2ae4f9ce2e7ee8131bbfee1e.ttf +0 -0
  48. data/spec/fixtures/generators/mixed-output/fontcustom_cc5ce52f2ae4f9ce2e7ee8131bbfee1e.woff +0 -0
  49. data/spec/fontcustom/util_spec.rb +0 -82
@@ -1,22 +0,0 @@
1
- //
2
- // Icon Font: <%= @opts.font_name %>
3
- // Bootstrap IE7 Enabler
4
- //
5
-
6
- [class^="<%= @opts.css_prefix %>"],
7
- [class*=" <%= @opts.css_prefix %>"] {
8
- font-family: "<%= @opts.font_name %>";
9
- font-style: normal;
10
- font-weight: normal;
11
- }
12
-
13
- .btn.dropdown-toggle [class^="<%= @opts.css_prefix %>"],
14
- .btn.dropdown-toggle [class*=" <%= @opts.css_prefix %>"] {
15
- line-height: 1.4em;
16
- }
17
-
18
- .<%= @opts.css_prefix %>large {
19
- font-size: 1.3333em;
20
- }
21
- <% @glyphs.each_with_index do |name, index| %>
22
- .<%= @opts.css_prefix + name %> { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#x<%= (61696+index).to_s(16) %>;&nbsp;'); }<% end %>
@@ -1,63 +0,0 @@
1
- //
2
- // Icon Font: <%= @opts.font_name %>
3
- // Bootstrap Override
4
- //
5
-
6
- @font-face {
7
- font-family: "<%= @opts.font_name %>";
8
- src: url("<%= @font_path_alt %>.eot");
9
- src: url("<%= @font_path_alt %>.eot?#iefix") format("embedded-opentype"),
10
- url("<%= @font_path_alt %>.woff") format("woff"),
11
- url("<%= @font_path_alt %>.ttf") format("truetype"),
12
- url("<%= @font_path_alt %>.svg#<%= @opts.font_name %>") format("svg");
13
- font-weight: normal;
14
- font-style: normal;
15
- }
16
-
17
- [class^="<%= @opts.css_prefix %>"]:before, [class*=" <%= @opts.css_prefix %>"]:before {
18
- font-family: "<%= @opts.font_name %>";
19
- font-weight: normal;
20
- font-style: normal;
21
- display: inline-block;
22
- text-decoration: inherit;
23
- }
24
-
25
- a [class^="<%= @opts.css_prefix %>"], a [class*=" <%= @opts.css_prefix %>"] {
26
- display: inline-block;
27
- text-decoration: inherit;
28
- }
29
-
30
- .<%= @opts.css_prefix %>large:before {
31
- vertical-align: top;
32
- font-size: 1.333em;
33
- }
34
-
35
- .btn [class^="<%= @opts.css_prefix %>"], .btn [class*=" <%= @opts.css_prefix %>"] {
36
- line-height: 0.9em;
37
- }
38
-
39
- li [class^="<%= @opts.css_prefix %>"], li [class*=" <%= @opts.css_prefix %>"] {
40
- display: inline-block;
41
- width: 1.25em;
42
- text-align: center;
43
- }
44
-
45
- li .<%= @opts.css_prefix %>large[class^="<%= @opts.css_prefix %>"], li .<%= @opts.css_prefix %>large[class*=" <%= @opts.css_prefix %>"] {
46
- width: 1.875em;
47
- }
48
-
49
- li[class^="<%= @opts.css_prefix %>"], li[class*=" <%= @opts.css_prefix %>"] {
50
- margin-left: 0;
51
- list-style-type: none;
52
- }
53
-
54
- li[class^="<%= @opts.css_prefix %>"]:before, li[class*=" <%= @opts.css_prefix %>"]:before {
55
- text-indent: -2em;
56
- text-align: center;
57
- }
58
-
59
- li[class^="<%= @opts.css_prefix %>"].<%= @opts.css_prefix %>large:before, li[class*=" <%= @opts.css_prefix %>"].<%= @opts.css_prefix %>large:before {
60
- text-indent: -1.333em;
61
- }
62
- <% @glyphs.each_with_index do |name, index| %>
63
- .<%= @opts.css_prefix + name %>:before { content: "\<%= (61696+index).to_s(16) %>"; }<% end %>
@@ -1,22 +0,0 @@
1
- /*
2
- Icon Font: <%= @opts.font_name %>
3
- Bootstrap IE7 Enabler
4
- */
5
-
6
- [class^="<%= @opts.css_prefix %>"],
7
- [class*=" <%= @opts.css_prefix %>"] {
8
- font-family: "<%= @opts.font_name %>";
9
- font-style: normal;
10
- font-weight: normal;
11
- }
12
-
13
- .btn.dropdown-toggle [class^="<%= @opts.css_prefix %>"],
14
- .btn.dropdown-toggle [class*=" <%= @opts.css_prefix %>"] {
15
- line-height: 1.4em;
16
- }
17
-
18
- .<%= @opts.css_prefix %>large {
19
- font-size: 1.3333em;
20
- }
21
- <% @glyphs.each_with_index do |name, index| %>
22
- .<%= @opts.css_prefix + name %> { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#x<%= (61696+index).to_s(16) %>;&nbsp;'); }<% end %>
@@ -1,63 +0,0 @@
1
- /*
2
- Icon Font: <%= @opts.font_name %>
3
- Bootstrap Override
4
- */
5
-
6
- @font-face {
7
- font-family: "<%= @opts.font_name %>";
8
- src: url("<%= @font_path %>.eot");
9
- src: url("<%= @font_path %>.eot?#iefix") format("embedded-opentype"),
10
- url("<%= @font_path %>.woff") format("woff"),
11
- url("<%= @font_path %>.ttf") format("truetype"),
12
- url("<%= @font_path %>.svg#<%= @opts.font_name %>") format("svg");
13
- font-weight: normal;
14
- font-style: normal;
15
- }
16
-
17
- [class^="<%= @opts.css_prefix %>"]:before, [class*=" <%= @opts.css_prefix %>"]:before {
18
- font-family: "<%= @opts.font_name %>";
19
- font-weight: normal;
20
- font-style: normal;
21
- display: inline-block;
22
- text-decoration: inherit;
23
- }
24
-
25
- a [class^="<%= @opts.css_prefix %>"], a [class*=" <%= @opts.css_prefix %>"] {
26
- display: inline-block;
27
- text-decoration: inherit;
28
- }
29
-
30
- .<%= @opts.css_prefix %>large:before {
31
- vertical-align: top;
32
- font-size: 1.333em;
33
- }
34
-
35
- .btn [class^="<%= @opts.css_prefix %>"], .btn [class*=" <%= @opts.css_prefix %>"] {
36
- line-height: 0.9em;
37
- }
38
-
39
- li [class^="<%= @opts.css_prefix %>"], li [class*=" <%= @opts.css_prefix %>"] {
40
- display: inline-block;
41
- width: 1.25em;
42
- text-align: center;
43
- }
44
-
45
- li .<%= @opts.css_prefix %>large[class^="<%= @opts.css_prefix %>"], li .<%= @opts.css_prefix %>large[class*=" <%= @opts.css_prefix %>"] {
46
- width: 1.875em;
47
- }
48
-
49
- li[class^="<%= @opts.css_prefix %>"], li[class*=" <%= @opts.css_prefix %>"] {
50
- margin-left: 0;
51
- list-style-type: none;
52
- }
53
-
54
- li[class^="<%= @opts.css_prefix %>"]:before, li[class*=" <%= @opts.css_prefix %>"]:before {
55
- text-indent: -2em;
56
- text-align: center;
57
- }
58
-
59
- li[class^="<%= @opts.css_prefix %>"].<%= @opts.css_prefix %>large:before, li[class*=" <%= @opts.css_prefix %>"].<%= @opts.css_prefix %>large:before {
60
- text-indent: -1.333em;
61
- }
62
- <% @glyphs.each_with_index do |name, index| %>
63
- .<%= @opts.css_prefix + name %>:before { content: "\<%= (61696+index).to_s(16) %>"; }<% end %>
@@ -1,62 +0,0 @@
1
- ##
2
- # Needs access to @shell and an Options instance
3
- # (@opts in thor, @cli_options or self in Options)
4
- module Fontcustom
5
- module Util
6
- def check_fontforge
7
- fontforge = `which fontforge`
8
- if fontforge == "" || fontforge == "fontforge not found"
9
- raise Fontcustom::Error, "Please install fontforge. Visit <http://fontcustom.com> for instructions."
10
- end
11
- end
12
-
13
- def say_changed(status, changed)
14
- return if base(:quiet)
15
- message = changed.map { |file| relative_to_root(file) }
16
- @shell.say_status status, message.join("\n#{" " * 14}"), :green # magic number
17
- end
18
-
19
- def say_message(status, message, color = :yellow)
20
- return if base(:quiet) && status != :error
21
- @shell.say_status status, message, color
22
- end
23
-
24
- def expand_path(path)
25
- return path if path[0] == "/"
26
- File.expand_path File.join(base(:project_root), path)
27
- end
28
-
29
- def relative_to_root(path)
30
- path = path.sub(base(:project_root), "")
31
- path = path[1..-1] if path[0] == "/"
32
- path = "." if path.empty?
33
- path
34
- end
35
-
36
- def overwrite_file(file, content = "")
37
- File.open(file, "w") { |f| f.write(content) }
38
- # say_changed :update, [ file ]
39
- end
40
-
41
- def symbolize_hash(hash)
42
- hash.inject({}) { |memo, (k, v)| memo[k.to_sym] = v; memo }
43
- end
44
-
45
- private
46
-
47
- def base(sym)
48
- # Generators have @opts
49
- if @opts
50
- @opts.send sym
51
-
52
- # Options (before merge) uses @cli_options
53
- elsif @cli_options
54
- @cli_options[sym]
55
-
56
- # Options (after merge) has its own methods
57
- else
58
- send sym
59
- end
60
- end
61
- end
62
- end
@@ -1,102 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <!--
4
- 2012-11-26: Created.
5
- -->
6
- <svg xmlns="http://www.w3.org/2000/svg">
7
- <metadata>
8
- Created by FontForge 20120731 at Mon Nov 26 10:31:22 2012
9
- By Joshua Gross
10
- Created by Joshua Gross with FontForge 2.0 (http://fontforge.sf.net)
11
- </metadata>
12
- <defs>
13
- <font id="fontcustom" horiz-adv-x="1030" >
14
- <font-face
15
- font-family="Untitled1"
16
- font-weight="500"
17
- font-stretch="normal"
18
- units-per-em="1000"
19
- panose-1="2 0 6 3 0 0 0 0 0 0"
20
- ascent="800"
21
- descent="-200"
22
- bbox="14.9998 -200.706 1015.35 800.108"
23
- underline-thickness="50"
24
- underline-position="-100"
25
- unicode-range="U+F100-F10C"
26
- />
27
- <missing-glyph />
28
- <glyph glyph-name="uniF100" unicode="&#xf100;" horiz-adv-x="1028"
29
- d="M980.576 795.03c20.3633 0 32.7266 -12.1211 32.7266 -32.6064v-597.333c0 -20.4844 -12.3633 -32.8486 -32.7266 -32.8486h-735.273l-46.5449 -86.9092c-4 -7.63574 -13.4551 -10.3027 -20.8486 -6.18164l-47.3936 25.333c-7.39453 4 -10.1826 13.334 -6.18262 20.8486
30
- l25.0908 46.7881h-93.5752c-20.4854 0 -40.8486 12.3633 -40.8486 32.8486v597.454c0 20.4854 12.3633 32.6064 32.7275 32.6064h932.849zM217.788 774.061c-12.9697 0 -23.5156 -10.4238 -23.5156 -23.5146c0 -13.0918 10.667 -23.6367 23.5156 -23.6367
31
- s23.5146 10.7881 23.5146 23.7578s-10.666 23.3936 -23.5146 23.3936zM153.546 774.061c-13.0918 0 -23.5156 -10.4238 -23.3945 -23.5146c0 -13.0918 10.5459 -23.6367 23.3945 -23.6367c13.0908 0 23.6357 10.7881 23.6357 23.7578s-10.5449 23.3936 -23.6357 23.3936z
32
- M89.0605 774.061c-12.8486 0 -23.3936 -10.4238 -23.5146 -23.5146c0 -13.0918 10.666 -23.6367 23.5146 -23.6367c13.0908 0 23.6367 10.7881 23.6367 23.7578s-10.667 23.3936 -23.6367 23.3936zM951.97 178.788v0.121094h-0.242188v424h-882.788v-424.121h105.576
33
- l57.8174 107.151l-86.1816 46.5449c-4.72754 2.4248 -7.75781 7.15234 -8 12.6064c-0.242188 5.45508 2.18164 10.4248 6.5459 13.4551l260.121 178.061c4.84863 3.27246 10.7881 4.48438 16.2422 0.726562c4.96973 -2.78711 8 -8.24219 7.63672 -13.9395l-13.2129 -311.151
34
- c-0.121094 -5.09082 -3.03027 -10.0605 -7.63574 -12.6055c-4.72754 -2.78809 -10.3027 -2.78809 -14.9092 -0.243164l-86.3027 46.667l-36.2432 -67.2725h681.576zM951.97 640.606v56.7266h-882.788v-56.7266h882.788z" />
35
- <glyph glyph-name="uniF101" unicode="&#xf101;" horiz-adv-x="1027"
36
- d="M673.57 215.636l26.5713 -13.0371l16.6348 16.6348l166.999 -167.026l111.227 -82.7861l11.9434 -45.3789l-123.309 -124.015l-44.3682 11.9854l-83.6035 112.029l-176.714 176.714c19.9014 7.37598 38.1963 18.877 53.6406 34.3213l26.0186 26.0176l28.0381 28.0391z
37
- M871.791 -10.8857c-28.8271 0 -52.2021 -23.375 -52.2021 -52.2021s23.375 -52.1875 52.2021 -52.1875s52.1875 23.3604 52.1875 52.1875s-23.3604 52.2021 -52.1875 52.2021zM378.392 440.995l-25.8926 -25.8799c-15.708 -15.708 -27.084 -34.0996 -34.3076 -53.6689
38
- l-4.30469 4.30469c-22.5996 -11.3623 -45.4893 -18.1992 -66.8984 -18.1992c-118.271 0 -229.968 113.108 -231.407 231.379c0.0136719 0.457031 13.3545 13.6045 20.8838 21.1191c96.8193 -96.8477 77.8184 -86.9521 137.493 -86.9521
39
- c46.1123 0 121.647 74.4834 121.647 121.647c0 58.1387 7.83301 42.7354 -86.9385 137.521c7.2793 7.28027 20.6484 20.8281 21.1045 20.8281c118.229 1.41211 231.365 -113.053 231.365 -231.365c0.0146484 -15.2783 -3.72266 -31.5674 -10.0879 -48.0498
40
- l-2.85156 -2.85059l-28.6611 -28.6748l13.4932 -26.0049l-25.9619 13.5215zM984.304 697.866c36.6611 -36.6885 36.6611 -96.1553 0 -132.816l-295.316 -295.303c-5.35547 2.62988 -11.5283 3.83398 -17.8945 3.83398c-14.4199 0 -29.9062 -6.17285 -39.5664 -15.8467
41
- c-14.0049 -13.9912 -20.6484 -40.0508 -12.0537 -57.502l-26.0176 -26.0176c-18.3516 -18.3516 -42.3896 -27.54 -66.4424 -27.54c-24.0117 0 -48.0508 9.16113 -66.374 27.498l-6.83594 6.82324l-230.176 -230.189l-23.291 -61.9863l-127.778 -89.3047l-57.5576 57.3643
42
- l89.665 127.985l61.4736 23.25l230.3 230.272l-4.81641 4.81543c-36.6465 36.6611 -36.6465 96.1279 0.0283203 132.803l25.8652 25.8516c5.48047 -2.85156 11.833 -4.1377 18.4482 -4.1377c14.4199 0 29.9619 6.17188 39.6631 15.8867
43
- c14.1025 14.1162 20.7871 40.6045 11.7217 58.084l295.179 295.123c18.3096 18.3506 42.3623 27.5264 66.4004 27.5264c24.0254 0 48.0645 -9.16211 66.4014 -27.499z" />
44
- <glyph glyph-name="uniF102" unicode="&#xf102;" horiz-adv-x="885"
45
- d="M755.53 57.0703l-375.351 120.27v55.3701l375.351 -121.19v359.65h114.119v-652.54h-854.189v312.87l364.72 -117.65v54.9004l-365.18 117.7v54.7402l740.53 -239.351v55.2305zM789.649 495.77h48.7803c1.06055 46.29 -35.6895 123.211 -91.0596 152.891
46
- c1.08984 21.0703 -1.39062 47.2295 -11.0801 69.8496c-13.9805 33.8301 -50.75 55.8301 -87.5303 60.4404c-49.21 6 -77.3701 -14.6006 -102.6 -41.2402c-25.0605 -26.75 -69.8301 -21.6699 -93.5107 -7.08008c-23.6992 15.0801 -72.4697 33.2402 -116.149 -3.53027
47
- c-43.8301 -36.1494 -58.9199 -8.59961 -102.601 1.09082c-43.3896 9.50977 -103.21 -16.6201 -103.689 -81.54c2.46973 -68.9102 71.9902 -95.5107 109.67 -79.0703c37.7002 16.6201 52.7803 40.79 99.5303 2.62012c44.3096 -36.29 102.62 -15.0703 125.38 12.6299
48
- c21.9795 28.1504 64.7598 27.0596 90.9102 1.37012c25.6797 -26.1602 45.3691 -32.1406 81.54 -32.6201c29.6797 -0.44043 54.2793 14 73.5098 28.1602c40.1494 0.0195312 70.9102 -38.75 78.8994 -83.9707z" />
49
- <glyph glyph-name="uniF103" unicode="&#xf103;" horiz-adv-x="1019"
50
- d="M1004.39 -139.453c1.56348 -14.8223 -27.1943 -42.1133 -42.127 -42.085c-21.1602 -0.0136719 -51.6064 31.6914 -75.5352 61.502l-43.04 -43.0547c-49.1846 -49.1982 -129.273 -49.1846 -178.485 0.0283203l-167.912 167.912
51
- c-49.2129 49.1982 -49.2402 129.286 -0.0283203 178.499l40.7432 40.7568c4.49805 70.5527 -36.0654 97.0684 -104.307 93.498l-35.373 -35.3867c-49.1709 -49.1855 -129.273 -49.2129 -178.499 0.0273438l-167.913 167.912
52
- c-49.2119 49.2129 -49.2119 129.314 -0.0273438 178.499l44.3271 44.3281c-25.9902 22.3359 -50.9834 48.3398 -52.9492 66.9814c-1.56348 14.7949 27.2217 42.0996 42.1133 42.1133c18.9316 0 45.3096 -25.4229 67.7988 -52.1328l2.71191 2.69922
53
- c49.1992 49.1982 129.301 49.1982 178.514 -0.0146484l167.939 -167.926c49.2129 -49.2119 49.2129 -129.301 0 -178.513l-13.9219 -13.9092c67.0791 2.25586 97.373 -34.5977 107.24 -90.5781l5.57715 5.5918c49.1992 49.1982 129.314 49.1982 178.527 -0.0146484
54
- l167.898 -167.926c49.1982 -49.1982 49.1982 -129.286 0 -178.499l-5.49414 -5.49414c28.9521 -23.8867 60.0205 -53.9736 62.2217 -74.8154zM338.829 341.753v0l104.002 103.975c16.4131 16.3994 16.4131 43.0957 0 59.4951l-167.926 167.927
55
- c-16.3994 16.4131 -43.1094 16.4131 -59.5088 0l-103.975 -103.989c-16.4141 -16.3994 -16.4141 -43.0957 0 -59.5088l167.898 -167.898c16.4131 -16.4131 43.0947 -16.4131 59.5088 0zM784.178 -103.596l0.0136719 -0.0273438l103.975 103.975
56
- c16.4268 16.4268 16.4268 43.123 0 59.5225l-167.912 167.912c-16.4141 16.4414 -43.1094 16.4414 -59.5088 0.0146484l-103.989 -103.975c-16.4131 -16.4004 -16.4131 -43.082 0.0146484 -59.5234l167.898 -167.898c16.4268 -16.4131 43.0811 -16.4131 59.5088 0z" />
57
- <glyph glyph-name="uniF104" unicode="&#xf104;" horiz-adv-x="544"
58
- d="M216.39 674.99c0 -14.2305 8.58008 -26.4199 20.8301 -31.79v-37.6602h-83.3301v97.2197l83.3301 27.7803v-23.7598c-12.25 -5.37012 -20.8301 -17.5703 -20.8301 -31.79zM292.77 563.93l83.3408 -83.3301h-361.11l83.3301 83.3301h194.439zM515 661.1h-41.6699
59
- c-7.67969 0 -13.8896 6.20996 -13.8896 13.8906c0 7.67969 6.20996 13.8896 13.8896 13.8896h41.6699c7.67969 0 13.8896 -6.20996 13.8896 -13.8896c0 -7.68066 -6.20996 -13.8906 -13.8896 -13.8906zM452.52 755.02c-5.12988 0 -10.0293 2.84082 -12.4492 7.73047
60
- c-3.41992 6.87012 -0.600586 15.21 6.26953 18.6104l34.7305 17.1895c6.85938 3.41992 15.1895 0.580078 18.5996 -6.29004c3.38965 -6.87012 0.589844 -15.21 -6.29004 -18.6094l-34.7002 -17.1904c-1.97949 -0.979492 -4.08984 -1.44043 -6.16016 -1.44043zM487.21 549.99
61
- c-2.08008 0 -4.16992 0.459961 -6.13965 1.43945l-34.7305 17.1904c-6.87012 3.39941 -9.68945 11.7402 -6.26953 18.6104c3.39941 6.88965 11.6992 9.69922 18.6094 6.28906l34.7002 -17.1895c6.87988 -3.40039 9.67969 -11.7402 6.29004 -18.6104
62
- c-2.41992 -4.89941 -7.36035 -7.72949 -12.46 -7.72949zM417.77 688.88c7.68066 0 13.8906 -6.20996 13.8906 -13.8896c0 -7.68066 -6.20996 -13.8906 -13.8906 -13.8906h-104.029l94.2998 -43.9697c6.94043 -3.24023 9.9502 -11.5 6.70996 -18.46
63
- c-2.34961 -5.04004 -7.37012 -8.00977 -12.5996 -8.00977c-1.9502 0 -3.95996 0.419922 -5.86035 1.2998c0 0 -152.17 71.3096 -152.49 71.5205c-3.87012 2.46973 -6.58008 6.58984 -6.58008 11.5195c0 4.91992 2.7207 9.04004 6.58008 11.5098
64
- c0.320312 0.220703 152.49 71.5205 152.49 71.5205c1.90039 0.879883 3.91016 1.2998 5.86035 1.2998c5.23926 0 10.2598 -2.98047 12.5996 -8.02051c3.24023 -6.95996 0.230469 -15.2197 -6.70996 -18.46l-94.2998 -43.9697h104.029zM15 438.88h361.11v-638.88h-361.11
65
- v638.88zM195.56 22.2695c53.6904 0 97.21 43.5303 97.2207 97.2305c0 53.6904 -43.5303 97.2197 -97.2207 97.2197c-53.6895 0 -97.2197 -43.5293 -97.2197 -97.2197c0 -53.7002 43.5205 -97.2305 97.2197 -97.2305z" />
66
- <glyph glyph-name="uniF105" unicode="&#xf105;" horiz-adv-x="694"
67
- d="M679.106 795.959l-235.379 -415.746l193.266 0.207031l-621.993 -580.476l290.985 470.204l-194.442 -0.22168z" />
68
- <glyph glyph-name="uniF106" unicode="&#xf106;"
69
- d="M780.73 683.89l-2.61035 -3.88965h-531.48c-118.93 -80 -189.55 -223.7 -189.55 -372.28c0 -152.33 73.5098 -287.71 197.24 -377.72h521.28c123.739 90.0098 195.989 227.33 195.989 379.67c0 148.61 -71.9395 287.18 -190.869 374.22zM796.65 720v0
70
- c131.819 -79.9902 218.35 -243.89 218.35 -417.29c0 -176.93 -90.1699 -322.71 -226.54 -422.7h-546.99c-136.34 99.9902 -226.47 245.771 -226.47 422.7c0 173.4 86.5195 337.3 218.31 417.29h563.341zM298.14 270.01v240h60v-240h-60zM668.11 290v200h60.0293v-200
71
- h-60.0293zM515.01 130.01c49.6807 0 90 -20.0098 90 -60v-90.8594h-180.01v90.8594c0 39.9902 40.2695 60 90.0098 60z" />
72
- <glyph glyph-name="uniF107" unicode="&#xf107;" horiz-adv-x="570"
73
- d="M231 783.2c0 15.2002 36 0 36 0v-504.4c-21 -7.5 -36 -27.7002 -36 -51.3994c0 -30.1006 24.2002 -54.4004 54 -54.4004s54 24.2998 54 54.4004c0 23.6992 -15 43.8994 -36 51.3994v504.4s36 15.2002 36 0c0 -283.8 216 -486.601 216 -486.601l-134.6 -341.399h-270.801
74
- l-134.6 341.399s216 202.801 216 486.601zM51 -81.0996h468v-108.9h-468v108.9z" />
75
- <glyph glyph-name="uniF108" unicode="&#xf108;" horiz-adv-x="1023"
76
- d="M1008.39 599.593l-145.271 -145.243l97.7744 -97.7607l-440.629 -50.541l51.1221 440.034l96.875 -96.8477l145.257 145.258zM160.23 139.437l-97.7471 97.7607l440.629 50.5547l-51.1494 -440.048l-96.8477 96.8477l-145.229 -145.258l-194.886 194.913z
77
- M215.518 425.384l234.674 -81.2227l-263.542 21.6445zM466.425 459.678v-101.096l-32.4814 95.6982zM811.217 170.879l-234.673 81.2236l263.542 -21.6592zM560.324 136.571v101.097l32.4668 -95.6855z" />
78
- <glyph glyph-name="uniF109" unicode="&#xf109;"
79
- d="M347.005 315.126l-165.394 165.38l-166.611 -167.649l0.387695 486.59h487.323l-167.691 -166.874l164.729 -164.771zM848.763 119.12l166.583 167.663l-0.345703 -486.59h-487.364l167.704 166.875l-164.701 164.771l152.702 152.688z" />
80
- <glyph glyph-name="uniF10A" unicode="&#xf10a;"
81
- d="M1015 406.68c0 -20.54 -10.1201 -38.5996 -25.5 -49.8701c0.0195312 -0.0195312 0.0498047 -0.0400391 0.0703125 -0.0498047l-237.181 -183.319l90.7705 -290.16c-0.160156 -0.0205078 -0.290039 -0.100586 -0.450195 -0.120117
82
- c2.42969 -6.65039 3.96973 -13.7305 3.96973 -21.21c0 -34.2197 -27.7393 -61.9502 -61.9795 -61.9502c-17.25 0 -32.8203 7.05957 -44.0703 18.4297l-225.36 173.17l-233.689 -179.14c-0.110352 0.0898438 -0.25 0.160156 -0.360352 0.259766
83
- c-10.3994 -7.87988 -23.2197 -12.7197 -37.2695 -12.7197c-34.2305 0 -61.9805 27.7305 -61.9805 61.9502c0 9.28027 2.18066 17.9795 5.82031 25.8701l89.6104 286.83l-240.74 185.069c0.0800781 0.100586 0.120117 0.209961 0.189453 0.310547
84
- c-13.2793 11.3701 -21.8496 28.0293 -21.8496 46.8701c0 34.2197 27.7305 61.9697 61.9697 61.96c0.470703 0 0.910156 -0.129883 1.39062 -0.140625h281.37l94.5 283.41c0.0595703 -0.0195312 0.139648 -0.00976562 0.209961 -0.0195312
85
- c6.38965 27.4092 30.8496 47.8896 60.2295 47.8896c27.71 0 50.9102 -18.3301 58.8203 -43.4199c0.0498047 0 0.0996094 0.00976562 0.139648 0.00976562l95.9805 -287.87h286.13c-0.0498047 -0.109375 -0.0498047 -0.229492 -0.0898438 -0.349609
86
- c32.9893 -1.40039 59.3496 -28.3701 59.3496 -61.6904z" />
87
- <glyph glyph-name="uniF10B" unicode="&#xf10b;"
88
- d="M515 800c276.15 0 500 -223.85 500 -500c0 -276.09 -223.85 -500 -500 -500s-500 223.91 -500 500c0 276.15 223.85 500 500 500zM508.05 595.46c-25.0996 0 -45.4502 -20.3496 -45.4502 -45.46c0 -25.0898 20.3506 -45.4502 45.4502 -45.4502
89
- c25.1006 0 45.46 20.3604 45.46 45.4502c0 25.0996 -20.3594 45.46 -45.46 45.46zM695.56 300h-0.0292969v56.8301c0 8.37988 -3.79004 15.7295 -9.58008 20.9102l0.169922 0.189453l-113.63 102.271c-23.25 14.4297 -56.7598 3.84961 -86.2705 -25.6602l-113.64 -136.37
90
- l0.280273 -0.240234c-4.10059 -4.91992 -6.87012 -11.0098 -6.87012 -17.9297c0 -15.6904 12.7197 -28.4004 28.4102 -28.4004c8.7793 0 16.3301 4.2002 21.54 10.4707l0.279297 -0.240234l69.0898 82.9004v-75.8809l-131.939 -233.439l0.129883 -0.0703125
91
- c-2.80957 -4.92969 -4.5498 -10.6094 -4.5498 -16.71c0 -18.8301 15.2695 -34.0996 34.0898 -34.0996c12.7197 0 23.6797 7.06934 29.54 17.3896l0.139648 -0.0703125l125.88 222.7l85.4502 -218.33l0.0498047 0.0302734c4.9707 -12.6904 17.2607 -21.71 31.6904 -21.71
92
- c18.8096 0 34.0801 15.2695 34.0801 34.0996c0 4.39062 -0.910156 8.54004 -2.40039 12.4102l0.0605469 0.00976562l-0.330078 0.84082h-0.00976562l-88.2305 225.479v102.62l39.7598 -35.8398v-44.1602c0 -15.6904 12.7305 -28.4004 28.4404 -28.4004
93
- c15.6797 0 28.3994 12.71 28.3994 28.4004z" />
94
- <glyph glyph-name="uniF10C" unicode="&#xf10c;" horiz-adv-x="614"
95
- d="M360.73 463.79c0 27.6533 13.8262 41.4795 41.4795 41.4795s41.4805 -13.8262 41.4805 -41.4795s-13.8271 -41.4805 -41.4805 -41.4805s-41.4795 13.8271 -41.4795 41.4805zM473.75 505.64c-15.8838 27.0615 -39.4375 40.7588 -70.6602 41.0908
96
- c37.3057 62.0889 70.8135 113.686 100.525 154.79s51.5264 68.3242 65.4453 81.6592s22.9727 18.792 27.1592 16.3701c4.19922 -2.42383 4.00098 -13.0049 -0.594727 -31.7441c-4.5957 -18.7383 -17.2715 -51.2637 -38.0273 -97.5742
97
- c-20.7559 -46.3115 -48.7051 -101.175 -83.8477 -164.592zM319.24 463.79c0 -14.5234 3.60352 -28.1436 10.8096 -40.8604c-72.3203 1.27734 -133.666 4.50586 -184.039 9.68457c-50.373 5.17969 -84.8008 10.4609 -103.285 15.8447
98
- c-18.4834 5.38281 -27.7256 10.4932 -27.7256 15.3311c0 4.83984 9.24316 9.95215 27.7295 15.3359c18.4873 5.38379 52.917 10.665 103.291 15.8447c50.373 5.17969 111.724 8.40918 184.05 9.68945c-7.21973 -12.7139 -10.8301 -26.3369 -10.8301 -40.8701zM473.84 422.06
99
- c35.1221 -63.3721 63.0547 -118.201 83.7988 -164.486c20.7432 -46.2852 33.4111 -78.79 38.0029 -97.5166s4.79102 -29.3018 0.598633 -31.7266c-4.19531 -2.41992 -13.25 3.03223 -27.1621 16.3564s-35.71 40.5137 -65.3926 81.5664
100
- c-29.6836 41.0537 -63.1689 92.5928 -100.455 154.617c31.2383 0.373047 54.7754 14.1035 70.6094 41.1895zM360.73 371.11c30.1768 -50.7168 57.833 -94.6543 82.9697 -131.811v-439.3h-82.9697v553.16v17.9502z" />
101
- </font>
102
- </defs></svg>
@@ -1,82 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Fontcustom::Util do
4
- class Generator
5
- include Fontcustom::Util
6
- attr_accessor :cli_options
7
-
8
- def initialize
9
- @cli_options = { :project_root => fixture, :quiet => false }
10
- @shell = Thor::Shell::Color.new
11
- end
12
- end
13
-
14
- context "#check_fontforge" do
15
- it "should raise error if fontforge isn't installed" do
16
- gen = Generator.new
17
- gen.stub(:"`").and_return("")
18
- expect { gen.check_fontforge }.to raise_error Fontcustom::Error, /install fontforge/
19
- end
20
- end
21
-
22
- context "#say_changed" do
23
- it "should strip :project_root from changed paths" do
24
- changed = %w|a b c|.map { |file| fixture(file) }
25
- gen = Generator.new
26
- output = capture(:stdout) { gen.say_changed(:success, changed) }
27
- output.should_not match(fixture)
28
- end
29
-
30
- it "should not respond if :quiet is true " do
31
- changed = %w|a b c|.map { |file| fixture(file) }
32
- gen = Generator.new
33
- gen.cli_options[:quiet] = true
34
- output = capture(:stdout) { gen.say_changed(:success, changed) }
35
- output.should == ""
36
- end
37
- end
38
-
39
- context "#say_message" do
40
- it "should not respond if :quiet is true" do
41
- gen = Generator.new
42
- gen.cli_options[:quiet] = true
43
- output = capture(:stdout) { gen.say_message(:test, "Hello") }
44
- output.should == ""
45
- end
46
- end
47
-
48
- context "#expand_path" do
49
- it "should leave absolute paths alone" do
50
- gen = Generator.new
51
- path = gen.expand_path "/absolute/path"
52
- path.should == "/absolute/path"
53
- end
54
-
55
- it "should prepend paths with :project_root" do
56
- gen = Generator.new
57
- path = gen.expand_path "generators"
58
- path.should == fixture("generators")
59
- end
60
-
61
- it "should follow ../../ relative paths" do
62
- gen = Generator.new
63
- gen.cli_options[:project_root] = fixture("shared/vectors")
64
- path = gen.expand_path "../../generators"
65
- path.should == fixture("generators")
66
- end
67
- end
68
-
69
- context "#relative_to_root" do
70
- it "should trim project root from paths" do
71
- gen = Generator.new
72
- path = gen.relative_to_root fixture("test/path")
73
- path.should == "test/path"
74
- end
75
-
76
- it "should trim beginning slash" do
77
- gen = Generator.new
78
- path = gen.relative_to_root "/test/path"
79
- path.should == "test/path"
80
- end
81
- end
82
- end