fontisan 0.2.0 → 0.2.2

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 (99) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +119 -308
  3. data/README.adoc +1525 -1323
  4. data/Rakefile +45 -47
  5. data/benchmark/variation_quick_bench.rb +4 -4
  6. data/docs/FONT_HINTING.adoc +562 -0
  7. data/docs/VARIABLE_FONT_OPERATIONS.adoc +599 -0
  8. data/lib/fontisan/cli.rb +92 -34
  9. data/lib/fontisan/collection/builder.rb +82 -0
  10. data/lib/fontisan/collection/offset_calculator.rb +2 -0
  11. data/lib/fontisan/collection/table_deduplicator.rb +76 -0
  12. data/lib/fontisan/commands/base_command.rb +21 -2
  13. data/lib/fontisan/commands/convert_command.rb +96 -165
  14. data/lib/fontisan/commands/info_command.rb +111 -5
  15. data/lib/fontisan/commands/instance_command.rb +77 -85
  16. data/lib/fontisan/commands/validate_command.rb +28 -0
  17. data/lib/fontisan/config/validation_rules.yml +1 -1
  18. data/lib/fontisan/constants.rb +34 -24
  19. data/lib/fontisan/converters/format_converter.rb +154 -1
  20. data/lib/fontisan/converters/outline_converter.rb +101 -34
  21. data/lib/fontisan/converters/woff_writer.rb +9 -4
  22. data/lib/fontisan/font_loader.rb +14 -9
  23. data/lib/fontisan/font_writer.rb +9 -6
  24. data/lib/fontisan/formatters/text_formatter.rb +45 -1
  25. data/lib/fontisan/hints/hint_converter.rb +131 -2
  26. data/lib/fontisan/hints/hint_validator.rb +284 -0
  27. data/lib/fontisan/hints/postscript_hint_applier.rb +219 -140
  28. data/lib/fontisan/hints/postscript_hint_extractor.rb +151 -16
  29. data/lib/fontisan/hints/truetype_hint_applier.rb +90 -44
  30. data/lib/fontisan/hints/truetype_hint_extractor.rb +134 -11
  31. data/lib/fontisan/hints/truetype_instruction_analyzer.rb +261 -0
  32. data/lib/fontisan/hints/truetype_instruction_generator.rb +266 -0
  33. data/lib/fontisan/loading_modes.rb +6 -4
  34. data/lib/fontisan/models/collection_brief_info.rb +31 -0
  35. data/lib/fontisan/models/font_info.rb +3 -30
  36. data/lib/fontisan/models/hint.rb +183 -12
  37. data/lib/fontisan/models/outline.rb +4 -1
  38. data/lib/fontisan/open_type_font.rb +28 -10
  39. data/lib/fontisan/open_type_font_extensions.rb +54 -0
  40. data/lib/fontisan/optimizers/pattern_analyzer.rb +2 -1
  41. data/lib/fontisan/optimizers/subroutine_generator.rb +1 -1
  42. data/lib/fontisan/pipeline/format_detector.rb +249 -0
  43. data/lib/fontisan/pipeline/output_writer.rb +159 -0
  44. data/lib/fontisan/pipeline/strategies/base_strategy.rb +75 -0
  45. data/lib/fontisan/pipeline/strategies/instance_strategy.rb +93 -0
  46. data/lib/fontisan/pipeline/strategies/named_strategy.rb +118 -0
  47. data/lib/fontisan/pipeline/strategies/preserve_strategy.rb +56 -0
  48. data/lib/fontisan/pipeline/transformation_pipeline.rb +416 -0
  49. data/lib/fontisan/pipeline/variation_resolver.rb +165 -0
  50. data/lib/fontisan/subset/table_subsetter.rb +5 -5
  51. data/lib/fontisan/tables/cff/charstring.rb +58 -3
  52. data/lib/fontisan/tables/cff/charstring_builder.rb +34 -0
  53. data/lib/fontisan/tables/cff/charstring_parser.rb +249 -0
  54. data/lib/fontisan/tables/cff/charstring_rebuilder.rb +172 -0
  55. data/lib/fontisan/tables/cff/dict_builder.rb +19 -1
  56. data/lib/fontisan/tables/cff/hint_operation_injector.rb +209 -0
  57. data/lib/fontisan/tables/cff/offset_recalculator.rb +70 -0
  58. data/lib/fontisan/tables/cff/private_dict_writer.rb +131 -0
  59. data/lib/fontisan/tables/cff/table_builder.rb +221 -0
  60. data/lib/fontisan/tables/cff.rb +2 -0
  61. data/lib/fontisan/tables/cff2/charstring_parser.rb +14 -8
  62. data/lib/fontisan/tables/cff2/private_dict_blend_handler.rb +247 -0
  63. data/lib/fontisan/tables/cff2/region_matcher.rb +200 -0
  64. data/lib/fontisan/tables/cff2/table_builder.rb +580 -0
  65. data/lib/fontisan/tables/cff2/table_reader.rb +421 -0
  66. data/lib/fontisan/tables/cff2/variation_data_extractor.rb +212 -0
  67. data/lib/fontisan/tables/cff2.rb +10 -5
  68. data/lib/fontisan/tables/cvar.rb +2 -41
  69. data/lib/fontisan/tables/glyf/compound_glyph_resolver.rb +2 -1
  70. data/lib/fontisan/tables/glyf/curve_converter.rb +10 -4
  71. data/lib/fontisan/tables/glyf/glyph_builder.rb +27 -10
  72. data/lib/fontisan/tables/gvar.rb +2 -41
  73. data/lib/fontisan/tables/name.rb +4 -4
  74. data/lib/fontisan/true_type_font.rb +27 -10
  75. data/lib/fontisan/true_type_font_extensions.rb +54 -0
  76. data/lib/fontisan/utilities/checksum_calculator.rb +42 -0
  77. data/lib/fontisan/validation/checksum_validator.rb +2 -2
  78. data/lib/fontisan/validation/table_validator.rb +1 -1
  79. data/lib/fontisan/validation/variable_font_validator.rb +218 -0
  80. data/lib/fontisan/variation/cache.rb +3 -1
  81. data/lib/fontisan/variation/converter.rb +121 -13
  82. data/lib/fontisan/variation/delta_applier.rb +2 -1
  83. data/lib/fontisan/variation/inspector.rb +2 -1
  84. data/lib/fontisan/variation/instance_generator.rb +2 -1
  85. data/lib/fontisan/variation/instance_writer.rb +341 -0
  86. data/lib/fontisan/variation/optimizer.rb +6 -3
  87. data/lib/fontisan/variation/subsetter.rb +32 -10
  88. data/lib/fontisan/variation/tuple_variation_header.rb +51 -0
  89. data/lib/fontisan/variation/variable_svg_generator.rb +268 -0
  90. data/lib/fontisan/variation/variation_preserver.rb +291 -0
  91. data/lib/fontisan/version.rb +1 -1
  92. data/lib/fontisan/version.rb.orig +9 -0
  93. data/lib/fontisan/woff2/glyf_transformer.rb +693 -0
  94. data/lib/fontisan/woff2/hmtx_transformer.rb +164 -0
  95. data/lib/fontisan/woff2_font.rb +489 -468
  96. data/lib/fontisan/woff_font.rb +16 -11
  97. data/lib/fontisan.rb +54 -2
  98. data/scripts/measure_optimization.rb +15 -7
  99. metadata +37 -2
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-12-17 08:44:35 UTC using RuboCop version 1.81.7.
3
+ # on 2025-12-29 12:26:25 UTC using RuboCop version 1.81.7.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -12,77 +12,26 @@ Gemspec/RequiredRubyVersion:
12
12
  Exclude:
13
13
  - 'fontisan.gemspec'
14
14
 
15
- # Offense count: 3
16
- # This cop supports safe autocorrection (--autocorrect).
17
- # Configuration parameters: EnforcedStyle, IndentationWidth.
18
- # SupportedStyles: with_first_argument, with_fixed_indentation
19
- Layout/ArgumentAlignment:
20
- Exclude:
21
- - 'spec/fontisan/loading_modes_spec.rb'
22
- - 'spec/fontisan/variation/validator_spec.rb'
23
- - 'spec/integration/outline_conversion_spec.rb'
24
-
25
- # Offense count: 2
26
- # This cop supports safe autocorrection (--autocorrect).
27
- Layout/ElseAlignment:
28
- Exclude:
29
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
30
- - 'lib/fontisan/subset/table_subsetter.rb'
31
-
32
- # Offense count: 2
15
+ # Offense count: 1
33
16
  # This cop supports safe autocorrection (--autocorrect).
34
17
  Layout/EmptyLineAfterGuardClause:
35
18
  Exclude:
36
- - 'lib/fontisan/open_type_font.rb'
37
- - 'lib/fontisan/true_type_font.rb'
19
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
38
20
 
39
- # Offense count: 2
21
+ # Offense count: 1
40
22
  # This cop supports safe autocorrection (--autocorrect).
41
- # Configuration parameters: EnforcedStyleAlignWith, Severity.
42
- # SupportedStylesAlignWith: keyword, variable, start_of_line
43
- Layout/EndAlignment:
23
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
44
24
  Exclude:
45
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
46
- - 'lib/fontisan/subset/table_subsetter.rb'
25
+ - 'lib/fontisan/hints/hint_validator.rb'
47
26
 
48
- # Offense count: 6
27
+ # Offense count: 2
49
28
  # This cop supports safe autocorrection (--autocorrect).
50
29
  # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
51
30
  Layout/ExtraSpacing:
52
31
  Exclude:
53
- - 'lib/fontisan/loading_modes.rb'
54
- - 'spec/fontisan/variation/delta_parser_spec.rb'
55
- - 'spec/fontisan/variation/validator_spec.rb'
56
-
57
- # Offense count: 24
58
- # This cop supports safe autocorrection (--autocorrect).
59
- # Configuration parameters: EnforcedStyle, IndentationWidth.
60
- # SupportedStyles: special_inside_parentheses, consistent, align_brackets
61
- Layout/FirstArrayElementIndentation:
62
- Exclude:
63
- - 'spec/fontisan/variation/delta_applier_spec.rb'
64
- - 'spec/fontisan/variation/delta_parser_spec.rb'
65
- - 'spec/fontisan/variation/optimizer_spec.rb'
66
- - 'spec/fontisan/variation/validator_spec.rb'
67
-
68
- # Offense count: 4
69
- # This cop supports safe autocorrection (--autocorrect).
70
- # Configuration parameters: EnforcedStyle, IndentationWidth.
71
- # SupportedStyles: special_inside_parentheses, consistent, align_braces
72
- Layout/FirstHashElementIndentation:
73
- Exclude:
74
- - 'spec/fontisan/variation/delta_applier_spec.rb'
75
- - 'spec/fontisan/variation/subsetter_spec.rb'
76
-
77
- # Offense count: 2
78
- # This cop supports safe autocorrection (--autocorrect).
79
- # Configuration parameters: Width, AllowedPatterns.
80
- Layout/IndentationWidth:
81
- Exclude:
82
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
83
- - 'lib/fontisan/subset/table_subsetter.rb'
32
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
84
33
 
85
- # Offense count: 908
34
+ # Offense count: 1101
86
35
  # This cop supports safe autocorrection (--autocorrect).
87
36
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
88
37
  # URISchemes: http, https
@@ -92,46 +41,15 @@ Layout/LineLength:
92
41
  # Offense count: 1
93
42
  # This cop supports safe autocorrection (--autocorrect).
94
43
  # Configuration parameters: EnforcedStyle.
95
- # SupportedStyles: symmetrical, new_line, same_line
96
- Layout/MultilineMethodCallBraceLayout:
44
+ # SupportedStyles: final_newline, final_blank_line
45
+ Layout/TrailingEmptyLines:
97
46
  Exclude:
98
- - 'spec/fontisan/variation/validator_spec.rb'
47
+ - 'spec/fontisan_spec.rb'
99
48
 
100
- # Offense count: 2
101
- # This cop supports safe autocorrection (--autocorrect).
102
- # Configuration parameters: EnforcedStyle, IndentationWidth.
103
- # SupportedStyles: aligned, indented, indented_relative_to_receiver
104
- Layout/MultilineMethodCallIndentation:
105
- Exclude:
106
- - 'lib/fontisan/tables/name.rb'
107
-
108
- # Offense count: 2
109
- # This cop supports safe autocorrection (--autocorrect).
110
- # Configuration parameters: EnforcedStyle, IndentationWidth.
111
- # SupportedStyles: aligned, indented
112
- Layout/MultilineOperationIndentation:
113
- Exclude:
114
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
115
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
116
-
117
- # Offense count: 20
49
+ # Offense count: 26
118
50
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
119
51
  Lint/DuplicateBranch:
120
- Exclude:
121
- - 'lib/fontisan/commands/base_command.rb'
122
- - 'lib/fontisan/commands/convert_command.rb'
123
- - 'lib/fontisan/commands/dump_table_command.rb'
124
- - 'lib/fontisan/converters/outline_converter.rb'
125
- - 'lib/fontisan/export/ttx_generator.rb'
126
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
127
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
128
- - 'lib/fontisan/models/hint.rb'
129
- - 'lib/fontisan/models/outline.rb'
130
- - 'lib/fontisan/tables/cff.rb'
131
- - 'lib/fontisan/tables/name.rb'
132
- - 'lib/fontisan/validation/validator.rb'
133
- - 'lib/fontisan/variable/glyph_delta_processor.rb'
134
- - 'lib/fontisan/variable/metric_delta_processor.rb'
52
+ Enabled: false
135
53
 
136
54
  # Offense count: 2
137
55
  Lint/DuplicateMethods:
@@ -140,17 +58,12 @@ Lint/DuplicateMethods:
140
58
  - 'lib/fontisan/woff2_font.rb'
141
59
 
142
60
  # Offense count: 2
143
- # This cop supports unsafe autocorrection (--autocorrect-all).
144
- Lint/DuplicateRequire:
145
- Exclude:
146
- - 'lib/fontisan.rb'
147
-
148
- # Offense count: 1
149
61
  # This cop supports safe autocorrection (--autocorrect).
150
62
  # Configuration parameters: AllowComments.
151
63
  Lint/EmptyConditionalBody:
152
64
  Exclude:
153
65
  - 'lib/fontisan/cli.rb'
66
+ - 'lib/fontisan/variation/variable_svg_generator.rb'
154
67
 
155
68
  # Offense count: 2
156
69
  Lint/FloatComparison:
@@ -164,70 +77,68 @@ Lint/IneffectiveAccessModifier:
164
77
  - 'lib/fontisan/models/ttx/tables/binary_table.rb'
165
78
 
166
79
  # Offense count: 1
167
- Lint/StructNewOverride:
80
+ # Configuration parameters: AllowedParentClasses.
81
+ Lint/MissingSuper:
168
82
  Exclude:
169
- - 'lib/fontisan/optimizers/pattern_analyzer.rb'
83
+ - 'lib/fontisan/tables/cff2/table_builder.rb'
170
84
 
171
- # Offense count: 2
172
- # This cop supports safe autocorrection (--autocorrect).
173
- # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
174
- Lint/UnusedBlockArgument:
85
+ # Offense count: 1
86
+ Lint/StructNewOverride:
175
87
  Exclude:
176
- - 'lib/fontisan/tables/cff2/charstring_parser.rb'
177
- - 'spec/fontisan/converters/format_converter_spec.rb'
88
+ - 'lib/fontisan/optimizers/pattern_analyzer.rb'
178
89
 
179
- # Offense count: 8
90
+ # Offense count: 5
180
91
  # This cop supports safe autocorrection (--autocorrect).
181
92
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
182
93
  # NotImplementedExceptions: NotImplementedError
183
94
  Lint/UnusedMethodArgument:
184
95
  Exclude:
185
- - 'lib/fontisan/commands/instance_command.rb'
186
- - 'lib/fontisan/converters/outline_converter.rb'
187
96
  - 'lib/fontisan/font_loader.rb'
188
- - 'lib/fontisan/tables/cff2/charstring_parser.rb'
97
+ - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
189
98
  - 'lib/fontisan/utilities/brotli_wrapper.rb'
190
99
  - 'lib/fontisan/variation/table_accessor.rb'
100
+ - 'lib/fontisan/woff2/glyf_transformer.rb'
191
101
 
192
- # Offense count: 9
102
+ # Offense count: 3
193
103
  # This cop supports safe autocorrection (--autocorrect).
194
104
  Lint/UselessAssignment:
195
105
  Exclude:
196
- - 'lib/fontisan/converters/outline_converter.rb'
197
- - 'lib/fontisan/hints/truetype_hint_applier.rb'
198
- - 'lib/fontisan/models/hint.rb'
199
- - 'lib/fontisan/tables/cff2/charstring_parser.rb'
200
- - 'spec/fontisan/utils/thread_pool_spec.rb'
201
- - 'spec/fontisan/variation/optimizer_spec.rb'
106
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
107
+ - 'spec/fontisan/hints/hint_round_trip_spec.rb'
202
108
 
203
- # Offense count: 354
109
+ # Offense count: 431
204
110
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
205
111
  Metrics/AbcSize:
206
112
  Enabled: false
207
113
 
208
- # Offense count: 24
114
+ # Offense count: 27
209
115
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
210
116
  # AllowedMethods: refine
211
117
  Metrics/BlockLength:
212
- Max: 88
118
+ Max: 80
213
119
 
214
- # Offense count: 169
120
+ # Offense count: 8
121
+ # Configuration parameters: CountBlocks, CountModifierForms.
122
+ Metrics/BlockNesting:
123
+ Max: 5
124
+
125
+ # Offense count: 220
215
126
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
216
127
  Metrics/CyclomaticComplexity:
217
128
  Enabled: false
218
129
 
219
- # Offense count: 533
130
+ # Offense count: 648
220
131
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
221
132
  Metrics/MethodLength:
222
- Max: 126
133
+ Max: 135
223
134
 
224
- # Offense count: 13
135
+ # Offense count: 17
225
136
  # Configuration parameters: CountKeywordArgs.
226
137
  Metrics/ParameterLists:
227
138
  Max: 39
228
139
  MaxOptionalParameters: 4
229
140
 
230
- # Offense count: 109
141
+ # Offense count: 154
231
142
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
232
143
  Metrics/PerceivedComplexity:
233
144
  Enabled: false
@@ -242,7 +153,7 @@ Naming/MethodParameterName:
242
153
  - 'lib/fontisan/tables/glyf/curve_converter.rb'
243
154
  - 'lib/fontisan/variation/optimizer.rb'
244
155
 
245
- # Offense count: 57
156
+ # Offense count: 71
246
157
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
247
158
  # SupportedStyles: snake_case, normalcase, non_integer
248
159
  # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
@@ -264,15 +175,16 @@ Naming/VariableNumber:
264
175
  - 'spec/fontisan/tables/hmtx_spec.rb'
265
176
  - 'spec/fontisan/tables/maxp_spec.rb'
266
177
 
267
- # Offense count: 21
178
+ # Offense count: 22
268
179
  # Configuration parameters: MinSize.
269
180
  Performance/CollectionLiteralInLoop:
270
181
  Exclude:
271
182
  - 'lib/fontisan/collection/builder.rb'
272
- - 'lib/fontisan/hints/postscript_hint_applier.rb'
273
183
  - 'lib/fontisan/open_type_font.rb'
274
184
  - 'lib/fontisan/tables/cff/charstring.rb'
185
+ - 'lib/fontisan/tables/cff/private_dict_writer.rb'
275
186
  - 'lib/fontisan/tables/cff2.rb'
187
+ - 'lib/fontisan/tables/cff2/region_matcher.rb'
276
188
  - 'lib/fontisan/true_type_font.rb'
277
189
  - 'lib/fontisan/variation/validator.rb'
278
190
  - 'spec/fontisan/cli_spec.rb'
@@ -280,67 +192,40 @@ Performance/CollectionLiteralInLoop:
280
192
  - 'spec/fontisan/commands/info_command_spec.rb'
281
193
  - 'spec/fontisan/commands/tables_command_spec.rb'
282
194
 
283
- # Offense count: 8
195
+ # Offense count: 1
284
196
  # This cop supports unsafe autocorrection (--autocorrect-all).
285
197
  Performance/TimesMap:
286
198
  Exclude:
287
- - 'benchmark/variation_quick_bench.rb'
288
199
  - 'lib/fontisan/tables/cff2.rb'
289
- - 'spec/fontisan/utils/thread_pool_spec.rb'
290
- - 'spec/fontisan/variation/cache_spec.rb'
291
- - 'spec/fontisan/variation/parallel_generator_spec.rb'
292
200
 
293
- # Offense count: 22
201
+ # Offense count: 24
294
202
  RSpec/AnyInstance:
295
203
  Exclude:
296
204
  - 'spec/fontisan/converters/format_converter_spec.rb'
205
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
297
206
  - 'spec/fontisan/validation/validator_spec.rb'
298
207
  - 'spec/fontisan/variation/delta_applier_spec.rb'
208
+ - 'spec/fontisan/variation/instance_writer_spec.rb'
299
209
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
300
210
  - 'spec/integration/format_conversion_spec.rb'
301
211
 
302
- # Offense count: 57
212
+ # Offense count: 100
303
213
  # Configuration parameters: Prefixes, AllowedPatterns.
304
214
  # Prefixes: when, with, without
305
215
  RSpec/ContextWording:
306
- Exclude:
307
- - 'spec/fontisan/commands/scripts_command_spec.rb'
308
- - 'spec/fontisan/loading_modes_spec.rb'
309
- - 'spec/fontisan/optimizers/charstring_rewriter_spec.rb'
310
- - 'spec/fontisan/optimizers/pattern_analyzer_spec.rb'
311
- - 'spec/fontisan/optimizers/subroutine_builder_spec.rb'
312
- - 'spec/fontisan/subset/glyph_mapping_spec.rb'
313
- - 'spec/fontisan/subset/options_spec.rb'
314
- - 'spec/fontisan/tables/cff/dict_spec.rb'
315
- - 'spec/fontisan/tables/cff/encoding_spec.rb'
316
- - 'spec/fontisan/tables/glyf/curve_converter_spec.rb'
317
- - 'spec/fontisan/tables/hmtx_spec.rb'
318
- - 'spec/integration/format_conversion_spec.rb'
319
- - 'spec/integration/outline_conversion_spec.rb'
216
+ Enabled: false
320
217
 
321
- # Offense count: 12
218
+ # Offense count: 17
322
219
  # Configuration parameters: IgnoredMetadata.
323
220
  RSpec/DescribeClass:
221
+ Enabled: false
222
+
223
+ # Offense count: 1
224
+ RSpec/DescribeMethod:
324
225
  Exclude:
325
- - '**/spec/features/**/*'
326
- - '**/spec/requests/**/*'
327
- - '**/spec/routing/**/*'
328
- - '**/spec/system/**/*'
329
- - '**/spec/views/**/*'
330
- - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
331
- - 'spec/fontisan/lazy_loading_spec.rb'
332
- - 'spec/fontisan/loading_modes_spec.rb'
333
- - 'spec/integration/collection_management_spec.rb'
334
- - 'spec/integration/font_subsetting_spec.rb'
335
- - 'spec/integration/font_validation_spec.rb'
336
- - 'spec/integration/format_conversion_spec.rb'
337
- - 'spec/integration/glyph_outline_extraction_spec.rb'
338
- - 'spec/integration/outline_conversion_spec.rb'
339
- - 'spec/integration/round_trip_validation_simple_spec.rb'
340
- - 'spec/integration/round_trip_validation_spec.rb'
341
- - 'spec/integration/woff2_conversion_spec.rb'
226
+ - 'spec/fontisan/collection/variable_font_builder_spec.rb'
342
227
 
343
- # Offense count: 758
228
+ # Offense count: 1152
344
229
  # Configuration parameters: CountAsOne.
345
230
  RSpec/ExampleLength:
346
231
  Max: 66
@@ -387,24 +272,19 @@ RSpec/IteratedExpectation:
387
272
  Exclude:
388
273
  - 'spec/fontisan/tables/glyf_spec.rb'
389
274
 
390
- # Offense count: 2
391
- # This cop supports safe autocorrection (--autocorrect).
392
- RSpec/LeadingSubject:
393
- Exclude:
394
- - 'spec/fontisan/variation/blend_applier_spec.rb'
395
- - 'spec/fontisan/variation/delta_applier_spec.rb'
396
-
397
- # Offense count: 15
275
+ # Offense count: 19
398
276
  # Configuration parameters: EnforcedStyle.
399
277
  # SupportedStyles: have_received, receive
400
278
  RSpec/MessageSpies:
401
279
  Exclude:
402
280
  - 'spec/fontisan/collection/builder_spec.rb'
281
+ - 'spec/fontisan/collection/variable_font_builder_spec.rb'
403
282
  - 'spec/fontisan/commands/pack_command_spec.rb'
404
283
  - 'spec/fontisan/commands/unpack_command_spec.rb'
405
284
  - 'spec/fontisan/glyph_accessor_spec.rb'
406
285
  - 'spec/fontisan/metrics_calculator_spec.rb'
407
286
  - 'spec/fontisan/subset/builder_spec.rb'
287
+ - 'spec/fontisan/variation/instance_writer_spec.rb'
408
288
  - 'spec/fontisan/woff2_font_spec.rb'
409
289
 
410
290
  # Offense count: 4
@@ -415,53 +295,55 @@ RSpec/MultipleDescribes:
415
295
  - 'spec/fontisan/utils/thread_pool_spec.rb'
416
296
  - 'spec/fontisan/variation/cache_spec.rb'
417
297
 
418
- # Offense count: 1092
298
+ # Offense count: 1488
419
299
  RSpec/MultipleExpectations:
420
300
  Max: 22
421
301
 
422
- # Offense count: 106
302
+ # Offense count: 132
423
303
  # Configuration parameters: AllowSubject.
424
304
  RSpec/MultipleMemoizedHelpers:
425
305
  Max: 13
426
306
 
427
- # Offense count: 3
307
+ # Offense count: 16
428
308
  # Configuration parameters: AllowedGroups.
429
309
  RSpec/NestedGroups:
430
310
  Max: 4
431
311
 
432
- # Offense count: 7
312
+ # Offense count: 10
433
313
  # Configuration parameters: AllowedPatterns.
434
314
  # AllowedPatterns: ^expect_, ^assert_
435
315
  RSpec/NoExpectationExample:
436
316
  Exclude:
437
317
  - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
318
+ - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
319
+ - 'spec/fontisan/variation/variable_svg_generator_spec.rb'
438
320
 
439
- # Offense count: 23
440
- # This cop supports unsafe autocorrection (--autocorrect-all).
441
- RSpec/ReceiveMessages:
442
- Exclude:
443
- - 'spec/fontisan/variation/optimizer_spec.rb'
444
- - 'spec/fontisan/variation/parallel_generator_spec.rb'
445
- - 'spec/fontisan/variation/subsetter_spec.rb'
446
- - 'spec/fontisan/variation/validator_spec.rb'
447
-
448
- # Offense count: 9
321
+ # Offense count: 11
449
322
  RSpec/RepeatedExample:
450
323
  Exclude:
324
+ - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
451
325
  - 'spec/fontisan/metrics_calculator_spec.rb'
452
326
  - 'spec/fontisan/tables/os2_spec.rb'
453
327
 
454
- # Offense count: 6
328
+ # Offense count: 14
455
329
  # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
456
330
  # SupportedInflectors: default, active_support
457
331
  RSpec/SpecFilePathFormat:
458
332
  Exclude:
459
333
  - '**/spec/routing/**/*'
334
+ - 'spec/fontisan/collection/variable_font_builder_spec.rb'
335
+ - 'spec/fontisan/hints/postscript_hint_applier_spec.rb'
336
+ - 'spec/fontisan/hints/postscript_hint_extractor_spec.rb'
337
+ - 'spec/fontisan/hints/truetype_hint_applier_spec.rb'
338
+ - 'spec/fontisan/hints/truetype_hint_extractor_spec.rb'
339
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
340
+ - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
460
341
  - 'spec/fontisan/tables/cff/charstring_builder_spec.rb'
342
+ - 'spec/fontisan/tables/cff/charstring_parser_spec.rb'
343
+ - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
461
344
  - 'spec/fontisan/tables/cff/charstring_spec.rb'
462
345
  - 'spec/fontisan/tables/glyf/curve_converter_spec.rb'
463
346
  - 'spec/fontisan/tables/glyf/glyph_builder_spec.rb'
464
- - 'spec/fontisan/variation/converter_spec.rb'
465
347
  - 'spec/fontisan/woff2/header_spec.rb'
466
348
 
467
349
  # Offense count: 1
@@ -485,7 +367,7 @@ RSpec/VerifiedDoubleReference:
485
367
  Exclude:
486
368
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
487
369
 
488
- # Offense count: 221
370
+ # Offense count: 292
489
371
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
490
372
  RSpec/VerifiedDoubles:
491
373
  Enabled: false
@@ -500,7 +382,7 @@ Security/Open:
500
382
  Exclude:
501
383
  - 'Rakefile'
502
384
 
503
- # Offense count: 10
385
+ # Offense count: 3
504
386
  # This cop supports safe autocorrection (--autocorrect).
505
387
  # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
506
388
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
@@ -509,26 +391,22 @@ Security/Open:
509
391
  # AllowedMethods: lambda, proc, it
510
392
  Style/BlockDelimiters:
511
393
  Exclude:
512
- - 'spec/fontisan/lazy_loading_spec.rb'
513
- - 'spec/fontisan/loading_modes_spec.rb'
394
+ - 'spec/fontisan/hints/hint_validator_spec.rb'
395
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
514
396
 
515
- # Offense count: 2
397
+ # Offense count: 1
516
398
  # This cop supports unsafe autocorrection (--autocorrect-all).
517
399
  Style/CombinableLoops:
518
400
  Exclude:
519
- - 'lib/fontisan/collection/offset_calculator.rb'
520
- - 'lib/fontisan/font_writer.rb'
401
+ - 'lib/fontisan/woff2_font.rb'
521
402
 
522
- # Offense count: 6
403
+ # Offense count: 1
523
404
  # This cop supports safe autocorrection (--autocorrect).
524
- # Configuration parameters: EnforcedStyle, AllowComments.
525
- # SupportedStyles: empty, nil, both
526
- Style/EmptyElse:
405
+ # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
406
+ # SupportedStyles: assign_to_condition, assign_inside_condition
407
+ Style/ConditionalAssignment:
527
408
  Exclude:
528
- - 'lib/fontisan/converters/outline_converter.rb'
529
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
530
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
531
- - 'spec/integration/outline_conversion_spec.rb'
409
+ - 'lib/fontisan/formatters/text_formatter.rb'
532
410
 
533
411
  # Offense count: 17
534
412
  # This cop supports safe autocorrection (--autocorrect).
@@ -539,12 +417,13 @@ Style/FormatStringToken:
539
417
  - 'lib/fontisan/formatters/text_formatter.rb'
540
418
  - 'scripts/measure_optimization.rb'
541
419
 
542
- # Offense count: 3
420
+ # Offense count: 4
543
421
  # This cop supports unsafe autocorrection (--autocorrect-all).
544
422
  # Configuration parameters: AllowedReceivers.
545
423
  # AllowedReceivers: Thread.current
546
424
  Style/HashEachMethods:
547
425
  Exclude:
426
+ - 'lib/fontisan/converters/woff_writer.rb'
548
427
  - 'lib/fontisan/subset/table_subsetter.rb'
549
428
  - 'spec/fontisan/subset/glyph_mapping_spec.rb'
550
429
 
@@ -555,44 +434,17 @@ Style/HashLikeCase:
555
434
  - 'lib/fontisan/commands/unpack_command.rb'
556
435
  - 'lib/fontisan/models/validation_report.rb'
557
436
 
558
- # Offense count: 2
559
- # This cop supports unsafe autocorrection (--autocorrect-all).
560
- Style/IdenticalConditionalBranches:
561
- Exclude:
562
- - 'lib/fontisan/models/hint.rb'
563
-
564
- # Offense count: 3
437
+ # Offense count: 4
565
438
  # This cop supports unsafe autocorrection (--autocorrect-all).
566
- # Configuration parameters: EnforcedStyle.
567
- # SupportedStyles: literals, strict
568
- Style/MutableConstant:
569
- Exclude:
570
- - 'lib/fontisan/hints/postscript_hint_applier.rb'
571
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
572
-
573
- # Offense count: 1
574
- # This cop supports safe autocorrection (--autocorrect).
575
- Style/NegatedIfElseCondition:
576
- Exclude:
577
- - 'lib/fontisan/converters/outline_converter.rb'
578
-
579
- # Offense count: 1
580
- # This cop supports safe autocorrection (--autocorrect).
581
- Style/NestedTernaryOperator:
439
+ # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
440
+ # SupportedStyles: predicate, comparison
441
+ Style/NumericPredicate:
582
442
  Exclude:
583
- - 'lib/fontisan/font_loader.rb'
584
-
585
- # Offense count: 2
586
- # This cop supports safe autocorrection (--autocorrect).
587
- Style/ParallelAssignment:
588
- Exclude:
589
- - 'spec/fontisan/variation/blend_applier_spec.rb'
590
-
591
- # Offense count: 1
592
- # This cop supports safe autocorrection (--autocorrect).
593
- Style/RedundantAssignment:
594
- Exclude:
595
- - 'spec/fontisan/variation/subsetter_spec.rb'
443
+ - 'spec/**/*'
444
+ - 'lib/fontisan/hints/hint_converter.rb'
445
+ - 'lib/fontisan/hints/hint_validator.rb'
446
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
447
+ - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
596
448
 
597
449
  # Offense count: 10
598
450
  # This cop supports unsafe autocorrection (--autocorrect-all).
@@ -601,81 +453,40 @@ Style/RedundantFetchBlock:
601
453
  Exclude:
602
454
  - 'spec/fontisan/variation/cache_spec.rb'
603
455
 
604
- # Offense count: 24
605
- # This cop supports safe autocorrection (--autocorrect).
606
- Style/RedundantFreeze:
607
- Exclude:
608
- - 'lib/fontisan/constants.rb'
609
-
610
456
  # Offense count: 1
611
- # This cop supports unsafe autocorrection (--autocorrect-all).
612
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
613
- # AllowedMethods: present?, blank?, presence, try, try!
614
- Style/SafeNavigation:
615
- Exclude:
616
- - 'lib/fontisan/subset/table_subsetter.rb'
617
-
618
- # Offense count: 5
619
457
  # This cop supports safe autocorrection (--autocorrect).
620
- Style/StderrPuts:
458
+ # Configuration parameters: AllowModifier.
459
+ Style/SoleNestedConditional:
621
460
  Exclude:
622
- - 'lib/fontisan/commands/instance_command.rb'
461
+ - 'lib/fontisan/hints/hint_validator.rb'
623
462
 
624
- # Offense count: 3
625
- # This cop supports safe autocorrection (--autocorrect).
626
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
627
- # SupportedStyles: single_quotes, double_quotes
628
- Style/StringLiterals:
629
- Exclude:
630
- - 'benchmark/variation_quick_bench.rb'
631
-
632
- # Offense count: 67
463
+ # Offense count: 2
633
464
  # This cop supports safe autocorrection (--autocorrect).
634
- # Configuration parameters: EnforcedStyleForMultiline.
635
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
636
- Style/TrailingCommaInArguments:
637
- Exclude:
638
- - 'lib/fontisan/commands/base_command.rb'
639
- - 'lib/fontisan/converters/outline_converter.rb'
640
- - 'lib/fontisan/hints/hint_converter.rb'
641
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
642
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
643
- - 'lib/fontisan/optimizers/subroutine_generator.rb'
644
- - 'lib/fontisan/tables/cff2.rb'
645
- - 'lib/fontisan/tables/name.rb'
646
- - 'spec/fontisan/converters/format_converter_spec.rb'
647
- - 'spec/fontisan/tables/cff2/blend_operator_spec.rb'
648
- - 'spec/fontisan/variation/converter_spec.rb'
649
- - 'spec/fontisan/variation/interpolator_spec.rb'
650
- - 'spec/fontisan/variation/metrics_adjuster_spec.rb'
651
- - 'spec/fontisan/variation/subsetter_spec.rb'
652
- - 'spec/fontisan/variation/validator_spec.rb'
465
+ # Configuration parameters: .
466
+ # SupportedStyles: percent, brackets
467
+ Style/SymbolArray:
468
+ EnforcedStyle: percent
469
+ MinSize: 3
653
470
 
654
- # Offense count: 34
471
+ # Offense count: 3
655
472
  # This cop supports safe autocorrection (--autocorrect).
656
473
  # Configuration parameters: EnforcedStyleForMultiline.
657
474
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
658
475
  Style/TrailingCommaInArrayLiteral:
659
476
  Exclude:
660
- - 'lib/fontisan/hints/postscript_hint_applier.rb'
661
- - 'spec/fontisan/variation/blend_applier_spec.rb'
662
- - 'spec/fontisan/variation/cache_spec.rb'
663
- - 'spec/fontisan/variation/delta_applier_spec.rb'
664
- - 'spec/fontisan/variation/delta_parser_spec.rb'
665
- - 'spec/fontisan/variation/optimizer_spec.rb'
477
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
666
478
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
667
- - 'spec/fontisan/variation/validator_spec.rb'
668
479
 
669
- # Offense count: 33
480
+ # Offense count: 1
670
481
  # This cop supports safe autocorrection (--autocorrect).
671
482
  # Configuration parameters: EnforcedStyleForMultiline.
672
483
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
673
484
  Style/TrailingCommaInHashLiteral:
674
485
  Exclude:
675
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
676
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
677
- - 'lib/fontisan/loading_modes.rb'
678
- - 'spec/fontisan/variation/blend_applier_spec.rb'
679
- - 'spec/fontisan/variation/delta_applier_spec.rb'
680
- - 'spec/fontisan/variation/subsetter_spec.rb'
681
- - 'spec/fontisan/variation/validator_spec.rb'
486
+ - 'lib/fontisan/hints/truetype_instruction_generator.rb'
487
+
488
+ # Offense count: 1
489
+ # This cop supports unsafe autocorrection (--autocorrect-all).
490
+ Style/ZeroLengthPredicate:
491
+ Exclude:
492
+ - 'lib/fontisan/hints/hint_converter.rb'