metanorma 1.6.6 → 1.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/collection_render_utils.rb +2 -2
- data/lib/metanorma/compile_options.rb +3 -15
- data/lib/metanorma/fontist_utils.rb +15 -6
- data/lib/metanorma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da01eef341e191e1e5feb7181afa5341ec66ff9b81792aace74bdcfc58a9690e
|
4
|
+
data.tar.gz: 36ab1f699a49b800cbeef67950e595f8306980b0406d8d0227d8570bf4581abc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c3a0595febda908e72b2e1075e8ac54955c00fbcbedb06a312f19f162c08de69f54ff0db365c76eece70743b0ffea5b68f67cce4e95e2b5c9261236b895e63a
|
7
|
+
data.tar.gz: a8065d8df08ade6c95ec184dd0d428c09aab5aadab74b0198280a95e9263c3794135b72139039cd7306168d26c8dc99daee8fc4ef869de4d3413b93c8929869d
|
@@ -110,8 +110,8 @@ module Metanorma
|
|
110
110
|
class PdfOptionsNode
|
111
111
|
def initialize(doctype, options)
|
112
112
|
docproc = Metanorma::Registry.instance.find_processor(doctype)
|
113
|
-
if FontistUtils.
|
114
|
-
@fonts_manifest = FontistUtils.location_manifest(docproc)
|
113
|
+
if FontistUtils.has_custom_fonts?(docproc, options, {})
|
114
|
+
@fonts_manifest = FontistUtils.location_manifest(docproc, options)
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
@@ -61,19 +61,6 @@ module Metanorma
|
|
61
61
|
def font_install(opt)
|
62
62
|
FontistUtils.install_fonts(@processor, opt) unless @fontist_installed
|
63
63
|
@fontist_installed = true
|
64
|
-
!opt[:fonts] ||
|
65
|
-
opt[:fontlicenseagreement] == "continue-without-fonts" and return
|
66
|
-
@font_overrides ||= []
|
67
|
-
font_install_override(opt)
|
68
|
-
end
|
69
|
-
|
70
|
-
def font_install_override(opt)
|
71
|
-
confirm = opt[:fontlicenseagreement] == "no-install-fonts" ? "no" : "yes"
|
72
|
-
CSV.parse_line(opt[:fonts], col_sep: ";").map(&:strip).each do |f|
|
73
|
-
@font_overrides.include?(f) and next
|
74
|
-
Fontist::Font.install(f, confirmation: confirm)
|
75
|
-
@font_overrides << f
|
76
|
-
end
|
77
64
|
end
|
78
65
|
|
79
66
|
private
|
@@ -85,9 +72,10 @@ module Metanorma
|
|
85
72
|
%i(bare sectionsplit no_install_fonts baseassetpath aligncrosselements
|
86
73
|
tocfigures toctables tocrecommendations strict)
|
87
74
|
.each { |x| ret[x] ||= options[x] }
|
88
|
-
|
75
|
+
custom_fonts = FontistUtils.has_custom_fonts?(@processor, options, ret)
|
76
|
+
ext == :pdf && custom_fonts &&
|
89
77
|
ret[:mn2pdf] =
|
90
|
-
{ font_manifest: FontistUtils.location_manifest(@processor) }
|
78
|
+
{ font_manifest: FontistUtils.location_manifest(@processor, ret) }
|
91
79
|
ret
|
92
80
|
end
|
93
81
|
end
|
@@ -16,7 +16,7 @@ module Metanorma
|
|
16
16
|
Util.log("[fontist] Skip font installation because" \
|
17
17
|
" --no-install-fonts argument passed", :debug)
|
18
18
|
return false
|
19
|
-
elsif !
|
19
|
+
elsif !has_custom_fonts?(processor, options, options)
|
20
20
|
Util.log("[fontist] Skip font installation because "\
|
21
21
|
"fonts_manifest is missing", :debug)
|
22
22
|
return false
|
@@ -89,7 +89,8 @@ module Metanorma
|
|
89
89
|
return unless validate_install_fonts(processor, options)
|
90
90
|
|
91
91
|
@@updated_formulas_repo = false
|
92
|
-
manifest = processor.fonts_manifest
|
92
|
+
manifest = processor.fonts_manifest.dup
|
93
|
+
append_source_fonts(manifest, options)
|
93
94
|
agree_to_terms, can_without_fonts, no_progress = validate_options(options)
|
94
95
|
|
95
96
|
install_fonts_safe(
|
@@ -100,14 +101,22 @@ module Metanorma
|
|
100
101
|
)
|
101
102
|
end
|
102
103
|
|
103
|
-
def self.
|
104
|
+
def self.has_custom_fonts?(processor, options, source_attributes)
|
104
105
|
!options[:no_install_fonts] \
|
105
106
|
&& processor.respond_to?(:fonts_manifest) \
|
106
|
-
&& !processor.fonts_manifest.nil?
|
107
|
+
&& !processor.fonts_manifest.nil? \
|
108
|
+
|| source_attributes[:fonts]
|
107
109
|
end
|
108
110
|
|
109
|
-
def self.location_manifest(processor)
|
110
|
-
Fontist::Manifest::Locations.from_hash(
|
111
|
+
def self.location_manifest(processor, source_attributes)
|
112
|
+
Fontist::Manifest::Locations.from_hash(
|
113
|
+
append_source_fonts(processor.fonts_manifest.dup, source_attributes),
|
114
|
+
)
|
115
|
+
end
|
116
|
+
|
117
|
+
def self.append_source_fonts(manifest, source_attributes)
|
118
|
+
source_attributes[:fonts]&.split(";")&.each { |f| manifest[f] = nil }
|
119
|
+
manifest
|
111
120
|
end
|
112
121
|
end
|
113
122
|
end
|
data/lib/metanorma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|