fontist 1.3.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/check_google.yml +28 -0
- data/.github/workflows/macosx.yml +3 -0
- data/.github/workflows/ubuntu.yml +1 -1
- data/.github/workflows/windows.yml +1 -1
- data/.gitignore +6 -0
- data/.hound.yml +2 -0
- data/.rubocop.yml +22 -0
- data/README.md +224 -0
- data/bin/check_google +8 -0
- data/bin/convert_formulas +8 -0
- data/bin/fontist +7 -0
- data/bin/generate_otfinfo +8 -0
- data/bin/import_google +8 -0
- data/fontist.gemspec +15 -1
- data/lib/fontist.rb +19 -13
- data/lib/fontist/cli.rb +168 -0
- data/lib/fontist/errors.rb +6 -0
- data/lib/fontist/font.rb +145 -7
- data/lib/fontist/font_formula.rb +42 -7
- data/lib/fontist/fontist_font.rb +70 -0
- data/lib/fontist/formula.rb +31 -9
- data/lib/fontist/formula_template.rb +122 -0
- data/lib/fontist/formulas.rb +41 -0
- data/lib/fontist/import.rb +9 -0
- data/lib/fontist/import/convert_formulas.rb +65 -0
- data/lib/fontist/import/create_formula.rb +59 -0
- data/lib/fontist/import/extractors.rb +5 -0
- data/lib/fontist/import/extractors/cab_extractor.rb +37 -0
- data/lib/fontist/import/extractors/extractor.rb +19 -0
- data/lib/fontist/import/extractors/ole_extractor.rb +41 -0
- data/lib/fontist/import/extractors/seven_zip_extractor.rb +44 -0
- data/lib/fontist/import/extractors/zip_extractor.rb +31 -0
- data/lib/fontist/import/files/collection_file.rb +52 -0
- data/lib/fontist/import/files/file_requirement.rb +17 -0
- data/lib/fontist/import/files/font_detector.rb +48 -0
- data/lib/fontist/import/formula_builder.rb +166 -0
- data/lib/fontist/import/formula_serializer.rb +133 -0
- data/lib/fontist/import/google.rb +16 -0
- data/lib/fontist/import/google/fonts_public.md +10 -0
- data/lib/fontist/import/google/fonts_public.pb.rb +71 -0
- data/lib/fontist/import/google/fonts_public.proto +46 -0
- data/lib/fontist/import/google/new_fonts_fetcher.rb +121 -0
- data/lib/fontist/import/google/skiplist.yml +8 -0
- data/lib/fontist/import/google_check.rb +34 -0
- data/lib/fontist/import/google_import.rb +180 -0
- data/lib/fontist/import/helpers/hash_helper.rb +13 -0
- data/lib/fontist/import/helpers/system_helper.rb +23 -0
- data/lib/fontist/import/otf/font_file.rb +105 -0
- data/lib/fontist/import/otf_parser.rb +25 -0
- data/lib/fontist/import/otf_style.rb +29 -0
- data/lib/fontist/import/otfinfo/otfinfo_requirement.rb +22 -0
- data/lib/fontist/import/otfinfo/template.erb +20 -0
- data/lib/fontist/import/otfinfo_generate.rb +45 -0
- data/lib/fontist/import/recursive_extraction.rb +185 -0
- data/lib/fontist/import/template_helper.rb +19 -0
- data/lib/fontist/import/text_helper.rb +30 -0
- data/lib/fontist/manifest.rb +2 -0
- data/lib/fontist/manifest/install.rb +32 -0
- data/lib/fontist/manifest/locations.rb +60 -0
- data/lib/fontist/system_font.rb +66 -22
- data/lib/fontist/utils.rb +5 -0
- data/lib/fontist/utils/cache.rb +88 -0
- data/lib/fontist/utils/downloader.rb +66 -9
- data/lib/fontist/utils/dsl.rb +8 -0
- data/lib/fontist/utils/dsl/collection_font.rb +36 -0
- data/lib/fontist/utils/dsl/font.rb +38 -0
- data/lib/fontist/utils/exe_extractor.rb +25 -22
- data/lib/fontist/utils/msi_extractor.rb +31 -0
- data/lib/fontist/utils/seven_zip_extractor.rb +41 -0
- data/lib/fontist/utils/system.rb +23 -0
- data/lib/fontist/utils/ui.rb +12 -0
- data/lib/fontist/utils/zip_extractor.rb +22 -8
- data/lib/fontist/version.rb +1 -1
- metadata +173 -49
- data/lib/fontist/formulas/andale_font.rb +0 -80
- data/lib/fontist/formulas/arial_black_font.rb +0 -79
- data/lib/fontist/formulas/cleartype_fonts.rb +0 -227
- data/lib/fontist/formulas/comic_font.rb +0 -78
- data/lib/fontist/formulas/courier_font.rb +0 -81
- data/lib/fontist/formulas/euphemia_font.rb +0 -85
- data/lib/fontist/formulas/georgia_font.rb +0 -80
- data/lib/fontist/formulas/impact_font.rb +0 -78
- data/lib/fontist/formulas/montserrat_font.rb +0 -132
- data/lib/fontist/formulas/ms_truetype_fonts.rb +0 -125
- data/lib/fontist/formulas/open_sans_fonts.rb +0 -263
- data/lib/fontist/formulas/overpass_font.rb +0 -73
- data/lib/fontist/formulas/source_fonts.rb +0 -109
- data/lib/fontist/formulas/stix_fonts.rb +0 -108
- data/lib/fontist/formulas/tahoma_font.rb +0 -147
- data/lib/fontist/formulas/webding_font.rb +0 -78
- data/spec/fontist/font_formula_spec.rb +0 -67
- data/spec/fontist/font_spec.rb +0 -113
- data/spec/fontist/formula_spec.rb +0 -67
- data/spec/fontist/formulas/andale_font_spec.rb +0 -29
- data/spec/fontist/formulas/arial_black_font_spec.rb +0 -29
- data/spec/fontist/formulas/cleartype_fonts_spec.rb +0 -38
- data/spec/fontist/formulas/comic_font_spec.rb +0 -29
- data/spec/fontist/formulas/courier_font_spec.rb +0 -29
- data/spec/fontist/formulas/euphemia_font_spec.rb +0 -29
- data/spec/fontist/formulas/georgia_font_spec.rb +0 -29
- data/spec/fontist/formulas/impact_font_spec.rb +0 -29
- data/spec/fontist/formulas/montserrat_font_spec.rb +0 -29
- data/spec/fontist/formulas/ms_truetype_fonts_spec.rb +0 -29
- data/spec/fontist/formulas/open_sans_fonts_spec.rb +0 -29
- data/spec/fontist/formulas/overpass_font_spec.rb +0 -29
- data/spec/fontist/formulas/source_fonts_spec.rb +0 -31
- data/spec/fontist/formulas/stix_fonts_spec.rb +0 -29
- data/spec/fontist/formulas/tahoma_font_spec.rb +0 -29
- data/spec/fontist/formulas/webding_font_spec.rb +0 -29
- data/spec/fontist/registry_spec.rb +0 -47
- data/spec/fontist/system_font_spec.rb +0 -44
- data/spec/fontist/utils/downloader_spec.rb +0 -35
- data/spec/fontist_spec.rb +0 -5
- data/spec/spec_helper.rb +0 -22
- data/spec/support/fontist_helper.rb +0 -10
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::AndaleFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::AndaleFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(1)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Andale Mono")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts", skip_in_windows: true do
|
16
|
-
name = "Andale Mono"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::AndaleFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/AndaleMo.TTF")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::ArialBlackFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::ArialBlackFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(1)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Arial Black")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts", skip_in_windows: true do
|
16
|
-
name = "Arial Black"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::ArialBlackFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/AriBlk.TTF")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::ClearTypeFonts do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::ClearTypeFonts.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(12)
|
9
|
-
expect(formula.fonts[1][:name]).to eq("Cambria Math")
|
10
|
-
expect(formula.fonts.first[:name]).to eq("Cambria")
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe "installation" do
|
15
|
-
context "with valid licence agreement", slow: true do
|
16
|
-
it "installs the valid fonts", skip_in_windows: true do
|
17
|
-
name = "Calibri"
|
18
|
-
confirmation = "yes"
|
19
|
-
|
20
|
-
paths = Fontist::Formulas::ClearTypeFonts.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(paths.first).to include("fonts/#{name.upcase}.TTF")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
context "with missing licence agreement" do
|
29
|
-
it "raises an Fontist::Errors::LicensingError" do
|
30
|
-
name = "Calibri"
|
31
|
-
|
32
|
-
expect {
|
33
|
-
Fontist::Formulas::ClearTypeFonts.fetch_font(name, confirmation: "no")
|
34
|
-
}.to raise_error(Fontist::Errors::LicensingError)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::ComicFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::ComicFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(1)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Comic Sans")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts", skip_in_windows: true do
|
16
|
-
name = "Comic Sans"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::ComicFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/Comicbd.TTF")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::CourierFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::CourierFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(1)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Courier")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts", skip_in_windows: true do
|
16
|
-
name = "Courier"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::CourierFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/cour.ttf")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::EuphemiaFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::EuphemiaFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(1)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Euphemia UCAS")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement" do
|
15
|
-
it "installs the valid fonts" do
|
16
|
-
name = "Euphemia UCAS"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::EuphemiaFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/#{name} Italic 2.6.6.ttf")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::GeorgiaFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::GeorgiaFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(1)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Georgia")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts", skip_in_windows: true do
|
16
|
-
name = "Georgia"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::GeorgiaFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/Georgiaz.TTF")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::ImpactFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::ImpactFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(1)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Impact")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts", skip_in_windows: true do
|
16
|
-
name = "Impact"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::ImpactFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/#{name}.TTF")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::MontserratFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::MontserratFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(2)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Montserrat")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts" do
|
16
|
-
name = "Montserrat"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::MontserratFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/#{name}-Thin.otf")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::MsTruetypeFonts do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::MsTruetypeFonts.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(4)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Arial")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement" do
|
15
|
-
it "installs the valid fonts", skip_in_windows: true do
|
16
|
-
name = "Arial"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::MsTruetypeFonts.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/#{name}.ttf")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::OpenSansFonts do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::OpenSansFonts.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(1)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("OpenSans")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts" do
|
16
|
-
name = "OpenSans"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::OpenSansFonts.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/#{name}-Light.ttf")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::OverpassFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::OverpassFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(2)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Overpass")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement" do
|
15
|
-
it "installs the valid fonts" do
|
16
|
-
name = "Overpass"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::OverpassFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/#{name.downcase}-bold-italic.otf")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::SourceFonts do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::SourceFonts.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(33)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Source Code Pro")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts" do
|
16
|
-
name = "Source Code Pro"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::SourceFonts.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths).to include(
|
26
|
-
Fontist.fonts_path.join("SourceCodePro-Black.ttf").to_s
|
27
|
-
)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::StixFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::StixFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(2)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("STIX Two Math")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement" do
|
15
|
-
it "installs the valid fonts" do
|
16
|
-
name = "STIX Two Math"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::StixFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/STIX2Math.otf")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Fontist::Formulas::TahomaFont do
|
4
|
-
describe "initializing" do
|
5
|
-
it "builds the data dictionary" do
|
6
|
-
formula = Fontist::Formulas::TahomaFont.instance
|
7
|
-
|
8
|
-
expect(formula.fonts.count).to eq(1)
|
9
|
-
expect(formula.fonts.first[:name]).to eq("Tahoma")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "installation" do
|
14
|
-
context "with valid licence agreement", slow: true do
|
15
|
-
it "installs the valid fonts", skip_in_windows: true do
|
16
|
-
name = "Tahoma"
|
17
|
-
confirmation = "yes"
|
18
|
-
|
19
|
-
stub_fontist_path_to_temp_path
|
20
|
-
paths = Fontist::Formulas::TahomaFont.fetch_font(
|
21
|
-
name, confirmation: confirmation
|
22
|
-
)
|
23
|
-
|
24
|
-
expect(Fontist::Font.find(name)).not_to be_empty
|
25
|
-
expect(paths.first).to include("fonts/#{name.downcase}.ttf")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|