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