fontisan 0.2.7 → 0.2.8

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +103 -0
  3. data/.rubocop_todo.yml +106 -319
  4. data/Gemfile +1 -1
  5. data/README.adoc +81 -14
  6. data/Rakefile +12 -7
  7. data/benchmark/variation_quick_bench.rb +1 -1
  8. data/lib/fontisan/cli.rb +45 -13
  9. data/lib/fontisan/collection/dfont_builder.rb +2 -1
  10. data/lib/fontisan/commands/convert_command.rb +2 -4
  11. data/lib/fontisan/commands/info_command.rb +3 -3
  12. data/lib/fontisan/commands/pack_command.rb +2 -1
  13. data/lib/fontisan/commands/validate_command.rb +157 -6
  14. data/lib/fontisan/converters/collection_converter.rb +22 -13
  15. data/lib/fontisan/converters/svg_generator.rb +2 -1
  16. data/lib/fontisan/converters/woff2_encoder.rb +6 -6
  17. data/lib/fontisan/converters/woff_writer.rb +3 -1
  18. data/lib/fontisan/font_loader.rb +7 -6
  19. data/lib/fontisan/formatters/text_formatter.rb +18 -14
  20. data/lib/fontisan/hints/hint_converter.rb +1 -1
  21. data/lib/fontisan/hints/hint_validator.rb +13 -10
  22. data/lib/fontisan/hints/truetype_instruction_analyzer.rb +15 -8
  23. data/lib/fontisan/hints/truetype_instruction_generator.rb +1 -1
  24. data/lib/fontisan/models/collection_validation_report.rb +104 -0
  25. data/lib/fontisan/models/font_report.rb +24 -0
  26. data/lib/fontisan/models/validation_report.rb +7 -2
  27. data/lib/fontisan/open_type_font.rb +2 -3
  28. data/lib/fontisan/optimizers/charstring_rewriter.rb +1 -1
  29. data/lib/fontisan/optimizers/subroutine_optimizer.rb +6 -2
  30. data/lib/fontisan/subset/glyph_mapping.rb +2 -0
  31. data/lib/fontisan/subset/table_subsetter.rb +2 -2
  32. data/lib/fontisan/tables/cblc.rb +8 -4
  33. data/lib/fontisan/tables/cff/index.rb +2 -0
  34. data/lib/fontisan/tables/cff.rb +6 -3
  35. data/lib/fontisan/tables/cff2/private_dict_blend_handler.rb +1 -1
  36. data/lib/fontisan/tables/cff2.rb +1 -1
  37. data/lib/fontisan/tables/cmap.rb +5 -5
  38. data/lib/fontisan/tables/glyf.rb +8 -10
  39. data/lib/fontisan/tables/head.rb +3 -3
  40. data/lib/fontisan/tables/hhea.rb +4 -4
  41. data/lib/fontisan/tables/maxp.rb +2 -2
  42. data/lib/fontisan/tables/name.rb +1 -1
  43. data/lib/fontisan/tables/os2.rb +8 -8
  44. data/lib/fontisan/tables/post.rb +2 -2
  45. data/lib/fontisan/tables/sbix.rb +5 -4
  46. data/lib/fontisan/true_type_font.rb +2 -3
  47. data/lib/fontisan/utilities/checksum_calculator.rb +0 -44
  48. data/lib/fontisan/validation/collection_validator.rb +4 -2
  49. data/lib/fontisan/validators/basic_validator.rb +11 -21
  50. data/lib/fontisan/validators/font_book_validator.rb +29 -50
  51. data/lib/fontisan/validators/opentype_validator.rb +24 -28
  52. data/lib/fontisan/validators/validator.rb +87 -66
  53. data/lib/fontisan/validators/web_font_validator.rb +16 -21
  54. data/lib/fontisan/version.rb +1 -1
  55. data/lib/fontisan/woff2/glyf_transformer.rb +31 -8
  56. data/lib/fontisan/woff2/hmtx_transformer.rb +2 -1
  57. data/lib/fontisan/woff2/table_transformer.rb +4 -2
  58. data/lib/fontisan/woff2_font.rb +4 -2
  59. data/lib/fontisan/woff_font.rb +2 -2
  60. data/lib/fontisan.rb +2 -2
  61. data/scripts/compare_stack_aware.rb +1 -1
  62. data/scripts/measure_optimization.rb +1 -2
  63. metadata +4 -2
data/.rubocop_todo.yml CHANGED
@@ -1,78 +1,64 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-01-06 02:07:50 UTC using RuboCop version 1.81.7.
3
+ # on 2026-01-15 10:44:19 UTC using RuboCop version 1.82.1.
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
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
9
  # Offense count: 1
10
- # Configuration parameters: Severity.
11
10
  Gemspec/RequiredRubyVersion:
12
11
  Exclude:
13
12
  - 'fontisan.gemspec'
14
13
 
15
- # Offense count: 1
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
- - 'lib/fontisan/converters/woff2_encoder.rb'
22
-
23
- # Offense count: 3
24
- # This cop supports safe autocorrection (--autocorrect).
25
- Layout/EmptyLineAfterGuardClause:
26
- Exclude:
27
- - 'lib/fontisan/commands/validate_command.rb'
28
- - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
29
- - 'lib/fontisan/models/validation_report.rb'
30
-
31
- # Offense count: 1
14
+ # Offense count: 94
32
15
  # This cop supports safe autocorrection (--autocorrect).
33
- Layout/EmptyLinesAroundExceptionHandlingKeywords:
16
+ Layout/EmptyLines:
34
17
  Exclude:
35
- - 'lib/fontisan/hints/hint_validator.rb'
18
+ - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
19
+ - 'spec/fontisan/converters/extended_woff2_spec.rb'
20
+ - 'spec/fontisan/lazy_loading_spec.rb'
21
+ - 'spec/fontisan/loading_modes_spec.rb'
22
+ - 'spec/integration/subroutine_roundtrip_spec.rb'
23
+ - 'spec/integration/woff2_conversion_spec.rb'
36
24
 
37
- # Offense count: 32
25
+ # Offense count: 25
38
26
  # This cop supports safe autocorrection (--autocorrect).
39
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
40
- Layout/ExtraSpacing:
27
+ # Configuration parameters: EnforcedStyle.
28
+ # SupportedStyles: empty_lines, no_empty_lines
29
+ Layout/EmptyLinesAroundBlockBody:
41
30
  Exclude:
42
- - 'lib/fontisan/commands/info_command.rb'
43
- - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
44
- - 'lib/fontisan/tables/glyf.rb'
45
- - 'lib/fontisan/tables/head.rb'
46
- - 'lib/fontisan/tables/maxp.rb'
47
- - 'lib/fontisan/tables/os2.rb'
48
- - 'lib/fontisan/tables/sbix.rb'
49
- - 'spec/fontisan/tables/sbix_spec.rb'
50
- - 'spec/fontisan/validators/basic_validator_spec.rb'
51
- - 'spec/integration/color_emoji_fonts_spec.rb'
52
- - 'spec/integration/dfont_pack_spec.rb'
31
+ - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
32
+ - 'spec/fontisan/converters/woff2_round_trip_spec.rb'
33
+ - 'spec/fontisan/loading_modes_spec.rb'
53
34
 
54
- # Offense count: 1313
35
+ # Offense count: 1217
55
36
  # This cop supports safe autocorrection (--autocorrect).
56
- # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
37
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
57
38
  # URISchemes: http, https
58
39
  Layout/LineLength:
59
40
  Enabled: false
60
41
 
61
- # Offense count: 1
62
- # This cop supports safe autocorrection (--autocorrect).
63
- # Configuration parameters: EnforcedStyle.
64
- # SupportedStyles: final_newline, final_blank_line
65
- Layout/TrailingEmptyLines:
66
- Exclude:
67
- - 'lib/fontisan/collection/shared_logic.rb'
68
-
69
- # Offense count: 19
42
+ # Offense count: 100
70
43
  # This cop supports safe autocorrection (--autocorrect).
71
44
  # Configuration parameters: AllowInHeredoc.
72
45
  Layout/TrailingWhitespace:
73
46
  Exclude:
74
- - 'check_dfont.rb'
75
- - 'spec/fontisan/converters/woff2_encoder_integration_spec.rb'
47
+ - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
48
+ - 'spec/fontisan/converters/extended_woff2_spec.rb'
49
+ - 'spec/fontisan/converters/woff2_round_trip_spec.rb'
50
+ - 'spec/fontisan/lazy_loading_spec.rb'
51
+ - 'spec/fontisan/loading_modes_spec.rb'
52
+ - 'spec/integration/outline_conversion_spec.rb'
53
+ - 'spec/integration/subroutine_roundtrip_spec.rb'
54
+ - 'spec/integration/woff2_conversion_spec.rb'
55
+
56
+ # Offense count: 3
57
+ Lint/CopDirectiveSyntax:
58
+ Exclude:
59
+ - 'lib/fontisan/converters/woff_writer.rb'
60
+ - 'lib/fontisan/woff2_font.rb'
61
+ - 'spec/fontisan/variation/cache_spec.rb'
76
62
 
77
63
  # Offense count: 27
78
64
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
@@ -85,13 +71,22 @@ Lint/DuplicateMethods:
85
71
  - 'lib/fontisan/tables/glyf.rb'
86
72
  - 'lib/fontisan/woff2_font.rb'
87
73
 
88
- # Offense count: 2
74
+ # Offense count: 1
75
+ # Configuration parameters: AllowComments.
76
+ Lint/EmptyClass:
77
+ Exclude:
78
+ - 'lib/fontisan.rb'
79
+
80
+ # Offense count: 5
89
81
  # This cop supports safe autocorrection (--autocorrect).
90
82
  # Configuration parameters: AllowComments.
91
83
  Lint/EmptyConditionalBody:
92
84
  Exclude:
93
85
  - 'lib/fontisan/cli.rb'
94
86
  - 'lib/fontisan/variation/variable_svg_generator.rb'
87
+ - 'spec/fontisan/lazy_loading_spec.rb'
88
+ - 'spec/fontisan/loading_modes_spec.rb'
89
+ - 'spec/integration/subroutine_roundtrip_spec.rb'
95
90
 
96
91
  # Offense count: 3
97
92
  Lint/FloatComparison:
@@ -116,51 +111,37 @@ Lint/StructNewOverride:
116
111
  Exclude:
117
112
  - 'lib/fontisan/optimizers/pattern_analyzer.rb'
118
113
 
119
- # Offense count: 22
114
+ # Offense count: 2
120
115
  # This cop supports safe autocorrection (--autocorrect).
121
116
  # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
122
117
  Lint/UnusedBlockArgument:
123
118
  Exclude:
124
- - 'lib/fontisan/validators/opentype_validator.rb'
125
- - 'spec/fontisan/tables/sbix_spec.rb'
126
- - 'spec/fontisan/validators/profile_loader_spec.rb'
127
- - 'spec/fontisan/validators/validator_spec.rb'
119
+ - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
128
120
 
129
- # Offense count: 13
121
+ # Offense count: 8
130
122
  # This cop supports safe autocorrection (--autocorrect).
131
123
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
132
124
  # NotImplementedExceptions: NotImplementedError
133
125
  Lint/UnusedMethodArgument:
134
126
  Exclude:
135
127
  - 'lib/fontisan.rb'
136
- - 'lib/fontisan/converters/collection_converter.rb'
137
128
  - 'lib/fontisan/font_loader.rb'
138
- - 'lib/fontisan/optimizers/charstring_rewriter.rb'
139
129
  - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
140
- - 'lib/fontisan/tables/glyf.rb'
141
130
  - 'lib/fontisan/utilities/brotli_wrapper.rb'
142
- - 'lib/fontisan/validators/validator.rb'
143
131
  - 'lib/fontisan/variation/table_accessor.rb'
144
132
  - 'lib/fontisan/woff2/glyf_transformer.rb'
145
133
  - 'lib/fontisan/woff_font.rb'
146
134
 
147
- # Offense count: 2
148
- # This cop supports safe autocorrection (--autocorrect).
149
- # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
150
- Lint/UselessAccessModifier:
151
- Exclude:
152
- - 'lib/fontisan.rb'
153
- - 'lib/fontisan/tables/cmap.rb'
154
-
155
- # Offense count: 4
135
+ # Offense count: 19
156
136
  # This cop supports safe autocorrection (--autocorrect).
157
137
  Lint/UselessAssignment:
158
138
  Exclude:
159
- - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
160
- - 'spec/fontisan/hints/hint_round_trip_spec.rb'
161
- - 'spec/fontisan/validators/validator_spec.rb'
139
+ - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
140
+ - 'spec/fontisan/loading_modes_spec.rb'
141
+ - 'spec/integration/subroutine_roundtrip_spec.rb'
142
+ - 'spec/integration/woff2_conversion_spec.rb'
162
143
 
163
- # Offense count: 464
144
+ # Offense count: 466
164
145
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
165
146
  Metrics/AbcSize:
166
147
  Enabled: false
@@ -169,19 +150,19 @@ Metrics/AbcSize:
169
150
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
170
151
  # AllowedMethods: refine
171
152
  Metrics/BlockLength:
172
- Max: 91
153
+ Max: 80
173
154
 
174
- # Offense count: 8
155
+ # Offense count: 6
175
156
  # Configuration parameters: CountBlocks, CountModifierForms.
176
157
  Metrics/BlockNesting:
177
158
  Max: 5
178
159
 
179
- # Offense count: 233
160
+ # Offense count: 231
180
161
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
181
162
  Metrics/CyclomaticComplexity:
182
163
  Enabled: false
183
164
 
184
- # Offense count: 707
165
+ # Offense count: 771
185
166
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
186
167
  Metrics/MethodLength:
187
168
  Max: 135
@@ -192,7 +173,7 @@ Metrics/ParameterLists:
192
173
  Max: 39
193
174
  MaxOptionalParameters: 4
194
175
 
195
- # Offense count: 171
176
+ # Offense count: 169
196
177
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
197
178
  Metrics/PerceivedComplexity:
198
179
  Enabled: false
@@ -207,6 +188,22 @@ Naming/MethodParameterName:
207
188
  - 'lib/fontisan/tables/glyf/curve_converter.rb'
208
189
  - 'lib/fontisan/variation/optimizer.rb'
209
190
 
191
+ # Offense count: 11
192
+ # Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
193
+ # AllowedMethods: call
194
+ # WaywardPredicates: nonzero?
195
+ Naming/PredicateMethod:
196
+ Exclude:
197
+ - 'lib/fontisan/collection/builder.rb'
198
+ - 'lib/fontisan/converters/outline_converter.rb'
199
+ - 'lib/fontisan/converters/svg_generator.rb'
200
+ - 'lib/fontisan/converters/table_copier.rb'
201
+ - 'lib/fontisan/converters/woff2_encoder.rb'
202
+ - 'lib/fontisan/optimizers/charstring_rewriter.rb'
203
+ - 'lib/fontisan/subset/options.rb'
204
+ - 'lib/fontisan/validation/collection_validator.rb'
205
+ - 'lib/fontisan/variation/metrics_adjuster.rb'
206
+
210
207
  # Offense count: 87
211
208
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
212
209
  # SupportedStyles: snake_case, normalcase, non_integer
@@ -214,14 +211,13 @@ Naming/MethodParameterName:
214
211
  Naming/VariableNumber:
215
212
  Enabled: false
216
213
 
217
- # Offense count: 25
214
+ # Offense count: 24
218
215
  # Configuration parameters: MinSize.
219
216
  Performance/CollectionLiteralInLoop:
220
217
  Exclude:
221
218
  - 'lib/fontisan/collection/builder.rb'
222
219
  - 'lib/fontisan/open_type_font.rb'
223
220
  - 'lib/fontisan/tables/cff/charstring.rb'
224
- - 'lib/fontisan/tables/cff/private_dict_writer.rb'
225
221
  - 'lib/fontisan/tables/cff2.rb'
226
222
  - 'lib/fontisan/tables/cff2/region_matcher.rb'
227
223
  - 'lib/fontisan/tables/sbix.rb'
@@ -233,13 +229,6 @@ Performance/CollectionLiteralInLoop:
233
229
  - 'spec/fontisan/commands/info_command_spec.rb'
234
230
  - 'spec/fontisan/commands/tables_command_spec.rb'
235
231
 
236
- # Offense count: 3
237
- # This cop supports unsafe autocorrection (--autocorrect-all).
238
- Performance/TimesMap:
239
- Exclude:
240
- - 'lib/fontisan/font_loader.rb'
241
- - 'lib/fontisan/tables/cff2.rb'
242
-
243
232
  # Offense count: 23
244
233
  RSpec/AnyInstance:
245
234
  Exclude:
@@ -250,7 +239,7 @@ RSpec/AnyInstance:
250
239
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
251
240
  - 'spec/integration/format_conversion_spec.rb'
252
241
 
253
- # Offense count: 107
242
+ # Offense count: 106
254
243
  # Configuration parameters: Prefixes, AllowedPatterns.
255
244
  # Prefixes: when, with, without
256
245
  RSpec/ContextWording:
@@ -267,7 +256,7 @@ RSpec/DescribeMethod:
267
256
  - 'spec/fontisan/collection/variable_font_builder_spec.rb'
268
257
  - 'spec/fontisan/converters/woff2_encoder_integration_spec.rb'
269
258
 
270
- # Offense count: 1280
259
+ # Offense count: 1286
271
260
  # Configuration parameters: CountAsOne.
272
261
  RSpec/ExampleLength:
273
262
  Max: 66
@@ -341,11 +330,11 @@ RSpec/MultipleDescribes:
341
330
  - 'spec/fontisan/utils/thread_pool_spec.rb'
342
331
  - 'spec/fontisan/variation/cache_spec.rb'
343
332
 
344
- # Offense count: 1697
333
+ # Offense count: 1699
345
334
  RSpec/MultipleExpectations:
346
335
  Max: 19
347
336
 
348
- # Offense count: 149
337
+ # Offense count: 150
349
338
  # Configuration parameters: AllowSubject.
350
339
  RSpec/MultipleMemoizedHelpers:
351
340
  Max: 13
@@ -365,6 +354,20 @@ RSpec/NoExpectationExample:
365
354
  - 'spec/fontisan/validators/validator_spec.rb'
366
355
  - 'spec/fontisan/variation/variable_svg_generator_spec.rb'
367
356
 
357
+ # Offense count: 100
358
+ # This cop supports unsafe autocorrection (--autocorrect-all).
359
+ # RSpec/Output was renamed to RSpec/ExpectOutput in rubocop-rspec 3.0+
360
+ RSpec/ExpectOutput:
361
+ Exclude:
362
+ - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
363
+ - 'spec/fontisan/converters/extended_woff2_spec.rb'
364
+ - 'spec/fontisan/converters/woff2_round_trip_spec.rb'
365
+ - 'spec/fontisan/lazy_loading_spec.rb'
366
+ - 'spec/fontisan/loading_modes_spec.rb'
367
+ - 'spec/integration/outline_conversion_spec.rb'
368
+ - 'spec/integration/subroutine_roundtrip_spec.rb'
369
+ - 'spec/integration/woff2_conversion_spec.rb'
370
+
368
371
  # Offense count: 11
369
372
  RSpec/RepeatedExample:
370
373
  Exclude:
@@ -409,13 +412,7 @@ RSpec/SubjectStub:
409
412
  Exclude:
410
413
  - 'spec/fontisan/variation/delta_applier_spec.rb'
411
414
 
412
- # Offense count: 4
413
- # This cop supports unsafe autocorrection (--autocorrect-all).
414
- RSpec/VerifiedDoubleReference:
415
- Exclude:
416
- - 'spec/fontisan/variation/parallel_generator_spec.rb'
417
-
418
- # Offense count: 289
415
+ # Offense count: 291
419
416
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
420
417
  RSpec/VerifiedDoubles:
421
418
  Enabled: false
@@ -430,47 +427,25 @@ Security/Open:
430
427
  Exclude:
431
428
  - 'Rakefile'
432
429
 
433
- # Offense count: 12
434
- # This cop supports safe autocorrection (--autocorrect).
435
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
436
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
437
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
438
- # FunctionalMethods: let, let!, subject, watch
439
- # AllowedMethods: lambda, proc, it
440
- Style/BlockDelimiters:
441
- Exclude:
442
- - 'spec/fontisan/converters/extended_woff2_spec.rb'
443
- - 'spec/fontisan/hints/hint_validator_spec.rb'
444
- - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
445
- - 'spec/fontisan/tables/colr_spec.rb'
446
- - 'spec/fontisan/tables/cpal_spec.rb'
447
- - 'spec/fontisan/validators/profile_loader_spec.rb'
448
- - 'spec/integration/font_validation_spec.rb'
449
-
450
- # Offense count: 1
451
- # This cop supports unsafe autocorrection (--autocorrect-all).
452
- Style/CombinableLoops:
453
- Exclude:
454
- - 'lib/fontisan/woff2_font.rb'
455
-
456
- # Offense count: 2
430
+ # Offense count: 4
457
431
  # This cop supports safe autocorrection (--autocorrect).
458
- # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
459
- # SupportedStyles: assign_to_condition, assign_inside_condition
460
- Style/ConditionalAssignment:
432
+ Style/ComparableClamp:
461
433
  Exclude:
462
- - 'lib/fontisan/formatters/text_formatter.rb'
434
+ - 'lib/fontisan/tables/cff2/blend_operator.rb'
435
+ - 'lib/fontisan/variable/axis_normalizer.rb'
436
+ - 'lib/fontisan/variation/interpolator.rb'
463
437
 
464
- # Offense count: 2
438
+ # Offense count: 4
465
439
  # This cop supports safe autocorrection (--autocorrect).
466
440
  # Configuration parameters: EnforcedStyle, AllowComments.
467
441
  # SupportedStyles: empty, nil, both
468
442
  Style/EmptyElse:
469
443
  Exclude:
470
- - 'lib/fontisan/commands/convert_command.rb'
471
- - 'lib/fontisan/validators/validator.rb'
444
+ - 'spec/fontisan/lazy_loading_spec.rb'
445
+ - 'spec/fontisan/loading_modes_spec.rb'
446
+ - 'spec/integration/subroutine_roundtrip_spec.rb'
472
447
 
473
- # Offense count: 17
448
+ # Offense count: 11
474
449
  # This cop supports safe autocorrection (--autocorrect).
475
450
  # Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
476
451
  # SupportedStyles: annotated, template, unannotated
@@ -479,198 +454,10 @@ Style/FormatStringToken:
479
454
  - 'lib/fontisan/formatters/text_formatter.rb'
480
455
  - 'scripts/measure_optimization.rb'
481
456
 
482
- # Offense count: 5
483
- # This cop supports unsafe autocorrection (--autocorrect-all).
484
- # Configuration parameters: AllowedReceivers.
485
- # AllowedReceivers: Thread.current
486
- Style/HashEachMethods:
487
- Exclude:
488
- - 'lib/fontisan/converters/woff_writer.rb'
489
- - 'lib/fontisan/subset/table_subsetter.rb'
490
- - 'spec/fontisan/subset/glyph_mapping_spec.rb'
491
- - 'spec/fontisan/validators/profile_loader_spec.rb'
492
-
493
- # Offense count: 2
457
+ # Offense count: 3
494
458
  # Configuration parameters: MinBranchesCount.
495
459
  Style/HashLikeCase:
496
460
  Exclude:
461
+ - 'lib/fontisan/commands/convert_command.rb'
497
462
  - 'lib/fontisan/commands/unpack_command.rb'
498
463
  - 'lib/fontisan/models/validation_report.rb'
499
-
500
- # Offense count: 1
501
- # This cop supports safe autocorrection (--autocorrect).
502
- # Configuration parameters: AllowIfModifier.
503
- Style/IfInsideElse:
504
- Exclude:
505
- - 'Rakefile'
506
-
507
- # Offense count: 6
508
- # This cop supports safe autocorrection (--autocorrect).
509
- Style/MultilineTernaryOperator:
510
- Exclude:
511
- - 'lib/fontisan/validators/validator.rb'
512
-
513
- # Offense count: 3
514
- # This cop supports safe autocorrection (--autocorrect).
515
- # Configuration parameters: AllowMethodComparison, ComparisonsThreshold.
516
- Style/MultipleComparison:
517
- Exclude:
518
- - 'lib/fontisan/tables/head.rb'
519
- - 'lib/fontisan/tables/name.rb'
520
- - 'lib/fontisan/tables/post.rb'
521
-
522
- # Offense count: 6
523
- # This cop supports safe autocorrection (--autocorrect).
524
- # Configuration parameters: IncludeSemanticChanges.
525
- Style/NonNilCheck:
526
- Exclude:
527
- - 'lib/fontisan/validators/validator.rb'
528
-
529
- # Offense count: 24
530
- # This cop supports unsafe autocorrection (--autocorrect-all).
531
- # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
532
- # SupportedStyles: predicate, comparison
533
- Style/NumericPredicate:
534
- Exclude:
535
- - 'spec/**/*'
536
- - 'lib/fontisan/font_loader.rb'
537
- - 'lib/fontisan/hints/hint_converter.rb'
538
- - 'lib/fontisan/hints/hint_validator.rb'
539
- - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
540
- - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
541
- - 'lib/fontisan/tables/cmap.rb'
542
- - 'lib/fontisan/tables/head.rb'
543
- - 'lib/fontisan/tables/hhea.rb'
544
- - 'lib/fontisan/tables/name.rb'
545
- - 'lib/fontisan/tables/os2.rb'
546
- - 'lib/fontisan/tables/post.rb'
547
-
548
- # Offense count: 1
549
- # This cop supports safe autocorrection (--autocorrect).
550
- Style/RedundantAssignment:
551
- Exclude:
552
- - 'lib/fontisan/converters/woff2_encoder.rb'
553
-
554
- # Offense count: 1
555
- # This cop supports safe autocorrection (--autocorrect).
556
- Style/RedundantBegin:
557
- Exclude:
558
- - 'lib/fontisan/tables/glyf.rb'
559
-
560
- # Offense count: 10
561
- # This cop supports unsafe autocorrection (--autocorrect-all).
562
- # Configuration parameters: SafeForConstants.
563
- Style/RedundantFetchBlock:
564
- Exclude:
565
- - 'spec/fontisan/variation/cache_spec.rb'
566
-
567
- # Offense count: 3
568
- # This cop supports safe autocorrection (--autocorrect).
569
- # Configuration parameters: EnforcedStyle.
570
- # SupportedStyles: implicit, explicit
571
- Style/RescueStandardError:
572
- Exclude:
573
- - 'lib/fontisan/cli.rb'
574
- - 'lib/fontisan/commands/validate_command.rb'
575
- - 'lib/fontisan/validators/validator.rb'
576
-
577
- # Offense count: 7
578
- # This cop supports unsafe autocorrection (--autocorrect-all).
579
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
580
- # AllowedMethods: present?, blank?, presence, try, try!
581
- Style/SafeNavigation:
582
- Exclude:
583
- - 'lib/fontisan/cli.rb'
584
- - 'lib/fontisan/tables/maxp.rb'
585
- - 'lib/fontisan/tables/os2.rb'
586
- - 'lib/fontisan/validators/validator.rb'
587
-
588
- # Offense count: 1
589
- # This cop supports safe autocorrection (--autocorrect).
590
- # Configuration parameters: AllowModifier.
591
- Style/SoleNestedConditional:
592
- Exclude:
593
- - 'lib/fontisan/hints/hint_validator.rb'
594
-
595
- # Offense count: 4
596
- # This cop supports unsafe autocorrection (--autocorrect-all).
597
- # Configuration parameters: Mode.
598
- Style/StringConcatenation:
599
- Exclude:
600
- - 'spec/fontisan/tables/cbdt_spec.rb'
601
-
602
- # Offense count: 56
603
- # This cop supports safe autocorrection (--autocorrect).
604
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
605
- # SupportedStyles: single_quotes, double_quotes
606
- Style/StringLiterals:
607
- Exclude:
608
- - 'check_dfont.rb'
609
- - 'lib/fontisan/commands/convert_command.rb'
610
- - 'lib/fontisan/converters/collection_converter.rb'
611
- - 'lib/fontisan/validators/font_book_validator.rb'
612
- - 'lib/fontisan/validators/opentype_validator.rb'
613
- - 'lib/fontisan/validators/web_font_validator.rb'
614
-
615
- # Offense count: 2
616
- # This cop supports safe autocorrection (--autocorrect).
617
- # Configuration parameters: .
618
- # SupportedStyles: percent, brackets
619
- Style/SymbolArray:
620
- EnforcedStyle: percent
621
- MinSize: 3
622
-
623
- # Offense count: 50
624
- # This cop supports unsafe autocorrection (--autocorrect-all).
625
- # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
626
- # AllowedMethods: define_method
627
- Style/SymbolProc:
628
- Exclude:
629
- - 'lib/fontisan/validators/basic_validator.rb'
630
- - 'lib/fontisan/validators/font_book_validator.rb'
631
- - 'lib/fontisan/validators/opentype_validator.rb'
632
- - 'lib/fontisan/validators/web_font_validator.rb'
633
- - 'spec/fontisan/validators/validator_spec.rb'
634
-
635
- # Offense count: 69
636
- # This cop supports safe autocorrection (--autocorrect).
637
- # Configuration parameters: EnforcedStyleForMultiline.
638
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
639
- Style/TrailingCommaInArguments:
640
- Exclude:
641
- - 'lib/fontisan/cli.rb'
642
- - 'lib/fontisan/commands/convert_command.rb'
643
- - 'lib/fontisan/commands/info_command.rb'
644
- - 'spec/fontisan/converters/woff2_encoder_integration_spec.rb'
645
- - 'spec/fontisan/models/validation_report_spec.rb'
646
- - 'spec/fontisan/optimizers/charstring_rewriter_spec.rb'
647
- - 'spec/fontisan/tables/cblc_spec.rb'
648
- - 'spec/fontisan/tables/sbix_spec.rb'
649
- - 'spec/fontisan/validators/basic_validator_spec.rb'
650
- - 'spec/integration/color_emoji_fonts_spec.rb'
651
- - 'spec/integration/dfont_pack_spec.rb'
652
-
653
- # Offense count: 12
654
- # This cop supports safe autocorrection (--autocorrect).
655
- # Configuration parameters: EnforcedStyleForMultiline.
656
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
657
- Style/TrailingCommaInArrayLiteral:
658
- Exclude:
659
- - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
660
- - 'spec/fontisan/tables/colr_spec.rb'
661
- - 'spec/fontisan/tables/cpal_spec.rb'
662
- - 'spec/fontisan/variation/parallel_generator_spec.rb'
663
-
664
- # Offense count: 1
665
- # This cop supports safe autocorrection (--autocorrect).
666
- # Configuration parameters: EnforcedStyleForMultiline.
667
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
668
- Style/TrailingCommaInHashLiteral:
669
- Exclude:
670
- - 'lib/fontisan/hints/truetype_instruction_generator.rb'
671
-
672
- # Offense count: 1
673
- # This cop supports unsafe autocorrection (--autocorrect-all).
674
- Style/ZeroLengthPredicate:
675
- Exclude:
676
- - 'lib/fontisan/hints/hint_converter.rb'
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "canon", "~> 0.1.3"
9
- gem "openssl"
9
+ gem "openssl", "~> 3.0"
10
10
  gem "rake"
11
11
  gem "rspec"
12
12
  gem "rubocop"