fontisan 0.2.0 → 0.2.1

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +270 -131
  3. data/README.adoc +158 -4
  4. data/Rakefile +44 -47
  5. data/lib/fontisan/cli.rb +84 -33
  6. data/lib/fontisan/collection/builder.rb +81 -0
  7. data/lib/fontisan/collection/table_deduplicator.rb +76 -0
  8. data/lib/fontisan/commands/base_command.rb +16 -0
  9. data/lib/fontisan/commands/convert_command.rb +97 -170
  10. data/lib/fontisan/commands/instance_command.rb +71 -80
  11. data/lib/fontisan/commands/validate_command.rb +25 -0
  12. data/lib/fontisan/config/validation_rules.yml +1 -1
  13. data/lib/fontisan/constants.rb +10 -0
  14. data/lib/fontisan/converters/format_converter.rb +150 -1
  15. data/lib/fontisan/converters/outline_converter.rb +80 -18
  16. data/lib/fontisan/converters/woff_writer.rb +1 -1
  17. data/lib/fontisan/font_loader.rb +3 -5
  18. data/lib/fontisan/font_writer.rb +7 -6
  19. data/lib/fontisan/hints/hint_converter.rb +133 -0
  20. data/lib/fontisan/hints/postscript_hint_applier.rb +221 -140
  21. data/lib/fontisan/hints/postscript_hint_extractor.rb +100 -0
  22. data/lib/fontisan/hints/truetype_hint_applier.rb +90 -44
  23. data/lib/fontisan/hints/truetype_hint_extractor.rb +127 -0
  24. data/lib/fontisan/loading_modes.rb +2 -0
  25. data/lib/fontisan/models/font_export.rb +2 -2
  26. data/lib/fontisan/models/hint.rb +173 -1
  27. data/lib/fontisan/models/validation_report.rb +1 -1
  28. data/lib/fontisan/open_type_font.rb +25 -9
  29. data/lib/fontisan/open_type_font_extensions.rb +54 -0
  30. data/lib/fontisan/pipeline/format_detector.rb +249 -0
  31. data/lib/fontisan/pipeline/output_writer.rb +154 -0
  32. data/lib/fontisan/pipeline/strategies/base_strategy.rb +75 -0
  33. data/lib/fontisan/pipeline/strategies/instance_strategy.rb +93 -0
  34. data/lib/fontisan/pipeline/strategies/named_strategy.rb +118 -0
  35. data/lib/fontisan/pipeline/strategies/preserve_strategy.rb +56 -0
  36. data/lib/fontisan/pipeline/transformation_pipeline.rb +411 -0
  37. data/lib/fontisan/pipeline/variation_resolver.rb +165 -0
  38. data/lib/fontisan/tables/cff/charstring.rb +33 -4
  39. data/lib/fontisan/tables/cff/charstring_builder.rb +34 -0
  40. data/lib/fontisan/tables/cff/charstring_parser.rb +237 -0
  41. data/lib/fontisan/tables/cff/charstring_rebuilder.rb +172 -0
  42. data/lib/fontisan/tables/cff/dict_builder.rb +15 -0
  43. data/lib/fontisan/tables/cff/hint_operation_injector.rb +207 -0
  44. data/lib/fontisan/tables/cff/offset_recalculator.rb +70 -0
  45. data/lib/fontisan/tables/cff/private_dict_writer.rb +125 -0
  46. data/lib/fontisan/tables/cff/table_builder.rb +221 -0
  47. data/lib/fontisan/tables/cff.rb +2 -0
  48. data/lib/fontisan/tables/cff2/private_dict_blend_handler.rb +246 -0
  49. data/lib/fontisan/tables/cff2/region_matcher.rb +200 -0
  50. data/lib/fontisan/tables/cff2/table_builder.rb +574 -0
  51. data/lib/fontisan/tables/cff2/table_reader.rb +419 -0
  52. data/lib/fontisan/tables/cff2/variation_data_extractor.rb +212 -0
  53. data/lib/fontisan/tables/cff2.rb +9 -4
  54. data/lib/fontisan/tables/cvar.rb +2 -41
  55. data/lib/fontisan/tables/gvar.rb +2 -41
  56. data/lib/fontisan/true_type_font.rb +24 -9
  57. data/lib/fontisan/true_type_font_extensions.rb +54 -0
  58. data/lib/fontisan/utilities/checksum_calculator.rb +42 -0
  59. data/lib/fontisan/validation/checksum_validator.rb +2 -2
  60. data/lib/fontisan/validation/table_validator.rb +1 -1
  61. data/lib/fontisan/validation/variable_font_validator.rb +218 -0
  62. data/lib/fontisan/variation/converter.rb +120 -13
  63. data/lib/fontisan/variation/instance_writer.rb +341 -0
  64. data/lib/fontisan/variation/tuple_variation_header.rb +51 -0
  65. data/lib/fontisan/variation/variable_svg_generator.rb +268 -0
  66. data/lib/fontisan/variation/variation_preserver.rb +288 -0
  67. data/lib/fontisan/version.rb +1 -1
  68. data/lib/fontisan/version.rb.orig +9 -0
  69. data/lib/fontisan/woff2/glyf_transformer.rb +666 -0
  70. data/lib/fontisan/woff2/hmtx_transformer.rb +164 -0
  71. data/lib/fontisan/woff2_font.rb +475 -470
  72. data/lib/fontisan/woff_font.rb +16 -11
  73. data/lib/fontisan.rb +12 -0
  74. metadata +31 -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-28 12:03:20 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,16 +12,25 @@ Gemspec/RequiredRubyVersion:
12
12
  Exclude:
13
13
  - 'fontisan.gemspec'
14
14
 
15
- # Offense count: 3
15
+ # Offense count: 6
16
16
  # This cop supports safe autocorrection (--autocorrect).
17
17
  # Configuration parameters: EnforcedStyle, IndentationWidth.
18
18
  # SupportedStyles: with_first_argument, with_fixed_indentation
19
19
  Layout/ArgumentAlignment:
20
20
  Exclude:
21
21
  - 'spec/fontisan/loading_modes_spec.rb'
22
+ - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
22
23
  - 'spec/fontisan/variation/validator_spec.rb'
23
24
  - 'spec/integration/outline_conversion_spec.rb'
24
25
 
26
+ # Offense count: 2
27
+ # This cop supports safe autocorrection (--autocorrect).
28
+ # Configuration parameters: AllowForAlignment.
29
+ Layout/CommentIndentation:
30
+ Exclude:
31
+ - 'lib/fontisan/tables/cff2/table_builder.rb'
32
+ - 'spec/fontisan/hints/hint_conversion_integration_spec.rb'
33
+
25
34
  # Offense count: 2
26
35
  # This cop supports safe autocorrection (--autocorrect).
27
36
  Layout/ElseAlignment:
@@ -29,12 +38,18 @@ Layout/ElseAlignment:
29
38
  - 'lib/fontisan/hints/postscript_hint_extractor.rb'
30
39
  - 'lib/fontisan/subset/table_subsetter.rb'
31
40
 
32
- # Offense count: 2
41
+ # Offense count: 48
33
42
  # This cop supports safe autocorrection (--autocorrect).
34
43
  Layout/EmptyLineAfterGuardClause:
35
44
  Exclude:
45
+ - 'lib/fontisan/models/hint.rb'
36
46
  - 'lib/fontisan/open_type_font.rb'
47
+ - 'lib/fontisan/tables/cff/charstring.rb'
48
+ - 'lib/fontisan/tables/cff/charstring_parser.rb'
49
+ - 'lib/fontisan/tables/cff2/table_reader.rb'
37
50
  - 'lib/fontisan/true_type_font.rb'
51
+ - 'lib/fontisan/woff2/glyf_transformer.rb'
52
+ - 'lib/fontisan/woff2_font.rb'
38
53
 
39
54
  # Offense count: 2
40
55
  # This cop supports safe autocorrection (--autocorrect).
@@ -45,12 +60,24 @@ Layout/EndAlignment:
45
60
  - 'lib/fontisan/hints/postscript_hint_extractor.rb'
46
61
  - 'lib/fontisan/subset/table_subsetter.rb'
47
62
 
48
- # Offense count: 6
63
+ # Offense count: 51
49
64
  # This cop supports safe autocorrection (--autocorrect).
50
65
  # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
51
66
  Layout/ExtraSpacing:
52
67
  Exclude:
53
68
  - 'lib/fontisan/loading_modes.rb'
69
+ - 'lib/fontisan/models/hint.rb'
70
+ - 'lib/fontisan/tables/cff/charstring.rb'
71
+ - 'lib/fontisan/validation/checksum_validator.rb'
72
+ - 'lib/fontisan/woff2/glyf_transformer.rb'
73
+ - 'lib/fontisan/woff2_font.rb'
74
+ - 'spec/fontisan/hints/hint_application_integration_spec.rb'
75
+ - 'spec/fontisan/hints/postscript_hint_applier_spec.rb'
76
+ - 'spec/fontisan/hints/truetype_hint_applier_spec.rb'
77
+ - 'spec/fontisan/tables/cff/charstring_builder_spec.rb'
78
+ - 'spec/fontisan/tables/cff2/region_matcher_spec.rb'
79
+ - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
80
+ - 'spec/fontisan/tables/cff2/table_reader_spec.rb'
54
81
  - 'spec/fontisan/variation/delta_parser_spec.rb'
55
82
  - 'spec/fontisan/variation/validator_spec.rb'
56
83
 
@@ -65,73 +92,80 @@ Layout/FirstArrayElementIndentation:
65
92
  - 'spec/fontisan/variation/optimizer_spec.rb'
66
93
  - 'spec/fontisan/variation/validator_spec.rb'
67
94
 
68
- # Offense count: 4
95
+ # Offense count: 18
69
96
  # This cop supports safe autocorrection (--autocorrect).
70
97
  # Configuration parameters: EnforcedStyle, IndentationWidth.
71
98
  # SupportedStyles: special_inside_parentheses, consistent, align_braces
72
99
  Layout/FirstHashElementIndentation:
73
100
  Exclude:
101
+ - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
74
102
  - 'spec/fontisan/variation/delta_applier_spec.rb'
75
103
  - 'spec/fontisan/variation/subsetter_spec.rb'
76
104
 
77
- # Offense count: 2
105
+ # Offense count: 3
78
106
  # This cop supports safe autocorrection (--autocorrect).
79
107
  # Configuration parameters: Width, AllowedPatterns.
80
108
  Layout/IndentationWidth:
81
109
  Exclude:
82
110
  - 'lib/fontisan/hints/postscript_hint_extractor.rb'
83
111
  - 'lib/fontisan/subset/table_subsetter.rb'
112
+ - 'spec/fontisan/tables/glyf_spec.rb'
84
113
 
85
- # Offense count: 908
114
+ # Offense count: 1303
86
115
  # This cop supports safe autocorrection (--autocorrect).
87
116
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
88
117
  # URISchemes: http, https
89
118
  Layout/LineLength:
90
119
  Enabled: false
91
120
 
92
- # Offense count: 1
121
+ # Offense count: 4
93
122
  # This cop supports safe autocorrection (--autocorrect).
94
123
  # Configuration parameters: EnforcedStyle.
95
124
  # SupportedStyles: symmetrical, new_line, same_line
96
125
  Layout/MultilineMethodCallBraceLayout:
97
126
  Exclude:
127
+ - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
98
128
  - 'spec/fontisan/variation/validator_spec.rb'
99
129
 
100
- # Offense count: 2
130
+ # Offense count: 3
101
131
  # This cop supports safe autocorrection (--autocorrect).
102
132
  # Configuration parameters: EnforcedStyle, IndentationWidth.
103
133
  # SupportedStyles: aligned, indented, indented_relative_to_receiver
104
134
  Layout/MultilineMethodCallIndentation:
105
135
  Exclude:
136
+ - 'lib/fontisan/tables/cff2/region_matcher.rb'
106
137
  - 'lib/fontisan/tables/name.rb'
107
138
 
108
- # Offense count: 2
139
+ # Offense count: 3
109
140
  # This cop supports safe autocorrection (--autocorrect).
110
141
  # Configuration parameters: EnforcedStyle, IndentationWidth.
111
142
  # SupportedStyles: aligned, indented
112
143
  Layout/MultilineOperationIndentation:
113
144
  Exclude:
145
+ - 'lib/fontisan/hints/hint_converter.rb'
114
146
  - 'lib/fontisan/hints/postscript_hint_extractor.rb'
115
147
  - 'lib/fontisan/hints/truetype_hint_extractor.rb'
116
148
 
117
- # Offense count: 20
149
+ # Offense count: 1
150
+ # This cop supports safe autocorrection (--autocorrect).
151
+ # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
152
+ # SupportedStylesForExponentOperator: space, no_space
153
+ # SupportedStylesForRationalLiterals: space, no_space
154
+ Layout/SpaceAroundOperators:
155
+ Exclude:
156
+ - 'lib/fontisan/tables/cff/charstring.rb'
157
+
158
+ # Offense count: 30
159
+ # This cop supports safe autocorrection (--autocorrect).
160
+ # Configuration parameters: EnforcedStyle.
161
+ # SupportedStyles: final_newline, final_blank_line
162
+ Layout/TrailingEmptyLines:
163
+ Enabled: false
164
+
165
+ # Offense count: 29
118
166
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
119
167
  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'
168
+ Enabled: false
135
169
 
136
170
  # Offense count: 2
137
171
  Lint/DuplicateMethods:
@@ -145,12 +179,13 @@ Lint/DuplicateRequire:
145
179
  Exclude:
146
180
  - 'lib/fontisan.rb'
147
181
 
148
- # Offense count: 1
182
+ # Offense count: 2
149
183
  # This cop supports safe autocorrection (--autocorrect).
150
184
  # Configuration parameters: AllowComments.
151
185
  Lint/EmptyConditionalBody:
152
186
  Exclude:
153
187
  - 'lib/fontisan/cli.rb'
188
+ - 'lib/fontisan/variation/variable_svg_generator.rb'
154
189
 
155
190
  # Offense count: 2
156
191
  Lint/FloatComparison:
@@ -163,20 +198,38 @@ Lint/IneffectiveAccessModifier:
163
198
  - 'lib/fontisan/models/outline.rb'
164
199
  - 'lib/fontisan/models/ttx/tables/binary_table.rb'
165
200
 
201
+ # Offense count: 1
202
+ # Configuration parameters: AllowedParentClasses.
203
+ Lint/MissingSuper:
204
+ Exclude:
205
+ - 'lib/fontisan/tables/cff2/table_builder.rb'
206
+
207
+ # Offense count: 2
208
+ # This cop supports unsafe autocorrection (--autocorrect-all).
209
+ # Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods.
210
+ # AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
211
+ # AdditionalNilMethods: present?, blank?, try, try!
212
+ Lint/RedundantSafeNavigation:
213
+ Exclude:
214
+ - 'lib/fontisan/hints/hint_converter.rb'
215
+
166
216
  # Offense count: 1
167
217
  Lint/StructNewOverride:
168
218
  Exclude:
169
219
  - 'lib/fontisan/optimizers/pattern_analyzer.rb'
170
220
 
171
- # Offense count: 2
221
+ # Offense count: 6
172
222
  # This cop supports safe autocorrection (--autocorrect).
173
223
  # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
174
224
  Lint/UnusedBlockArgument:
175
225
  Exclude:
226
+ - 'lib/fontisan/models/hint.rb'
176
227
  - 'lib/fontisan/tables/cff2/charstring_parser.rb'
228
+ - 'lib/fontisan/tables/cff2/table_reader.rb'
177
229
  - 'spec/fontisan/converters/format_converter_spec.rb'
230
+ - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
178
231
 
179
- # Offense count: 8
232
+ # Offense count: 13
180
233
  # This cop supports safe autocorrection (--autocorrect).
181
234
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
182
235
  # NotImplementedExceptions: NotImplementedError
@@ -185,49 +238,61 @@ Lint/UnusedMethodArgument:
185
238
  - 'lib/fontisan/commands/instance_command.rb'
186
239
  - 'lib/fontisan/converters/outline_converter.rb'
187
240
  - 'lib/fontisan/font_loader.rb'
241
+ - 'lib/fontisan/hints/hint_converter.rb'
188
242
  - 'lib/fontisan/tables/cff2/charstring_parser.rb'
243
+ - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
189
244
  - 'lib/fontisan/utilities/brotli_wrapper.rb'
190
245
  - 'lib/fontisan/variation/table_accessor.rb'
246
+ - 'lib/fontisan/woff2/glyf_transformer.rb'
191
247
 
192
- # Offense count: 9
248
+ # Offense count: 16
193
249
  # This cop supports safe autocorrection (--autocorrect).
194
250
  Lint/UselessAssignment:
195
251
  Exclude:
252
+ - 'lib/fontisan/cli.rb'
196
253
  - 'lib/fontisan/converters/outline_converter.rb'
197
- - 'lib/fontisan/hints/truetype_hint_applier.rb'
254
+ - 'lib/fontisan/hints/truetype_hint_extractor.rb'
198
255
  - 'lib/fontisan/models/hint.rb'
199
256
  - 'lib/fontisan/tables/cff2/charstring_parser.rb'
257
+ - 'lib/fontisan/tables/cff2/table_reader.rb'
258
+ - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
259
+ - 'spec/fontisan/utilities/checksum_calculator_spec.rb'
200
260
  - 'spec/fontisan/utils/thread_pool_spec.rb'
201
261
  - 'spec/fontisan/variation/optimizer_spec.rb'
202
262
 
203
- # Offense count: 354
263
+ # Offense count: 423
204
264
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
205
265
  Metrics/AbcSize:
206
266
  Enabled: false
207
267
 
208
- # Offense count: 24
268
+ # Offense count: 26
209
269
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
210
270
  # AllowedMethods: refine
211
271
  Metrics/BlockLength:
212
- Max: 88
272
+ Max: 81
273
+
274
+ # Offense count: 4
275
+ # Configuration parameters: CountBlocks, CountModifierForms.
276
+ Metrics/BlockNesting:
277
+ Max: 5
213
278
 
214
- # Offense count: 169
279
+ # Offense count: 213
215
280
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
216
281
  Metrics/CyclomaticComplexity:
217
282
  Enabled: false
218
283
 
219
- # Offense count: 533
284
+ # Offense count: 630
220
285
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
221
286
  Metrics/MethodLength:
222
- Max: 126
287
+ Max: 136
223
288
 
224
- # Offense count: 13
289
+ # Offense count: 17
225
290
  # Configuration parameters: CountKeywordArgs.
226
291
  Metrics/ParameterLists:
227
292
  Max: 39
228
293
  MaxOptionalParameters: 4
229
294
 
230
- # Offense count: 109
295
+ # Offense count: 150
231
296
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
232
297
  Metrics/PerceivedComplexity:
233
298
  Enabled: false
@@ -242,7 +307,7 @@ Naming/MethodParameterName:
242
307
  - 'lib/fontisan/tables/glyf/curve_converter.rb'
243
308
  - 'lib/fontisan/variation/optimizer.rb'
244
309
 
245
- # Offense count: 57
310
+ # Offense count: 71
246
311
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
247
312
  # SupportedStyles: snake_case, normalcase, non_integer
248
313
  # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
@@ -264,15 +329,16 @@ Naming/VariableNumber:
264
329
  - 'spec/fontisan/tables/hmtx_spec.rb'
265
330
  - 'spec/fontisan/tables/maxp_spec.rb'
266
331
 
267
- # Offense count: 21
332
+ # Offense count: 22
268
333
  # Configuration parameters: MinSize.
269
334
  Performance/CollectionLiteralInLoop:
270
335
  Exclude:
271
336
  - 'lib/fontisan/collection/builder.rb'
272
- - 'lib/fontisan/hints/postscript_hint_applier.rb'
273
337
  - 'lib/fontisan/open_type_font.rb'
274
338
  - 'lib/fontisan/tables/cff/charstring.rb'
339
+ - 'lib/fontisan/tables/cff/private_dict_writer.rb'
275
340
  - 'lib/fontisan/tables/cff2.rb'
341
+ - 'lib/fontisan/tables/cff2/region_matcher.rb'
276
342
  - 'lib/fontisan/true_type_font.rb'
277
343
  - 'lib/fontisan/variation/validator.rb'
278
344
  - 'spec/fontisan/cli_spec.rb'
@@ -280,67 +346,58 @@ Performance/CollectionLiteralInLoop:
280
346
  - 'spec/fontisan/commands/info_command_spec.rb'
281
347
  - 'spec/fontisan/commands/tables_command_spec.rb'
282
348
 
283
- # Offense count: 8
349
+ # Offense count: 3
350
+ # This cop supports safe autocorrection (--autocorrect).
351
+ Performance/RedundantBlockCall:
352
+ Exclude:
353
+ - 'lib/fontisan/tables/cff/charstring_rebuilder.rb'
354
+
355
+ # Offense count: 1
356
+ # This cop supports unsafe autocorrection (--autocorrect-all).
357
+ # Configuration parameters: AllowRegexpMatch.
358
+ Performance/RedundantEqualityComparisonBlock:
359
+ Exclude:
360
+ - 'spec/fontisan/utilities/checksum_calculator_spec.rb'
361
+
362
+ # Offense count: 10
284
363
  # This cop supports unsafe autocorrection (--autocorrect-all).
285
364
  Performance/TimesMap:
286
365
  Exclude:
287
366
  - 'benchmark/variation_quick_bench.rb'
288
367
  - 'lib/fontisan/tables/cff2.rb'
368
+ - 'spec/fontisan/hints/hint_application_integration_spec.rb'
369
+ - 'spec/fontisan/utilities/checksum_calculator_spec.rb'
289
370
  - 'spec/fontisan/utils/thread_pool_spec.rb'
290
371
  - 'spec/fontisan/variation/cache_spec.rb'
291
372
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
292
373
 
293
- # Offense count: 22
374
+ # Offense count: 23
294
375
  RSpec/AnyInstance:
295
376
  Exclude:
296
377
  - 'spec/fontisan/converters/format_converter_spec.rb'
297
378
  - 'spec/fontisan/validation/validator_spec.rb'
298
379
  - 'spec/fontisan/variation/delta_applier_spec.rb'
380
+ - 'spec/fontisan/variation/instance_writer_spec.rb'
299
381
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
300
382
  - 'spec/integration/format_conversion_spec.rb'
301
383
 
302
- # Offense count: 57
384
+ # Offense count: 94
303
385
  # Configuration parameters: Prefixes, AllowedPatterns.
304
386
  # Prefixes: when, with, without
305
387
  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'
388
+ Enabled: false
320
389
 
321
- # Offense count: 12
390
+ # Offense count: 16
322
391
  # Configuration parameters: IgnoredMetadata.
323
392
  RSpec/DescribeClass:
393
+ Enabled: false
394
+
395
+ # Offense count: 1
396
+ RSpec/DescribeMethod:
324
397
  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'
398
+ - 'spec/fontisan/collection/variable_font_builder_spec.rb'
342
399
 
343
- # Offense count: 758
400
+ # Offense count: 1108
344
401
  # Configuration parameters: CountAsOne.
345
402
  RSpec/ExampleLength:
346
403
  Max: 66
@@ -394,17 +451,19 @@ RSpec/LeadingSubject:
394
451
  - 'spec/fontisan/variation/blend_applier_spec.rb'
395
452
  - 'spec/fontisan/variation/delta_applier_spec.rb'
396
453
 
397
- # Offense count: 15
454
+ # Offense count: 19
398
455
  # Configuration parameters: EnforcedStyle.
399
456
  # SupportedStyles: have_received, receive
400
457
  RSpec/MessageSpies:
401
458
  Exclude:
402
459
  - 'spec/fontisan/collection/builder_spec.rb'
460
+ - 'spec/fontisan/collection/variable_font_builder_spec.rb'
403
461
  - 'spec/fontisan/commands/pack_command_spec.rb'
404
462
  - 'spec/fontisan/commands/unpack_command_spec.rb'
405
463
  - 'spec/fontisan/glyph_accessor_spec.rb'
406
464
  - 'spec/fontisan/metrics_calculator_spec.rb'
407
465
  - 'spec/fontisan/subset/builder_spec.rb'
466
+ - 'spec/fontisan/variation/instance_writer_spec.rb'
408
467
  - 'spec/fontisan/woff2_font_spec.rb'
409
468
 
410
469
  # Offense count: 4
@@ -415,31 +474,36 @@ RSpec/MultipleDescribes:
415
474
  - 'spec/fontisan/utils/thread_pool_spec.rb'
416
475
  - 'spec/fontisan/variation/cache_spec.rb'
417
476
 
418
- # Offense count: 1092
477
+ # Offense count: 1414
419
478
  RSpec/MultipleExpectations:
420
479
  Max: 22
421
480
 
422
- # Offense count: 106
481
+ # Offense count: 132
423
482
  # Configuration parameters: AllowSubject.
424
483
  RSpec/MultipleMemoizedHelpers:
425
484
  Max: 13
426
485
 
427
- # Offense count: 3
486
+ # Offense count: 16
428
487
  # Configuration parameters: AllowedGroups.
429
488
  RSpec/NestedGroups:
430
489
  Max: 4
431
490
 
432
- # Offense count: 7
491
+ # Offense count: 8
433
492
  # Configuration parameters: AllowedPatterns.
434
493
  # AllowedPatterns: ^expect_, ^assert_
435
494
  RSpec/NoExpectationExample:
436
495
  Exclude:
437
496
  - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
497
+ - 'spec/fontisan/variation/variable_svg_generator_spec.rb'
438
498
 
439
- # Offense count: 23
499
+ # Offense count: 111
440
500
  # This cop supports unsafe autocorrection (--autocorrect-all).
441
501
  RSpec/ReceiveMessages:
442
502
  Exclude:
503
+ - 'spec/fontisan/converters/outline_converter_spec.rb'
504
+ - 'spec/fontisan/hints/postscript_hint_extractor_spec.rb'
505
+ - 'spec/fontisan/hints/truetype_hint_extractor_spec.rb'
506
+ - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
443
507
  - 'spec/fontisan/variation/optimizer_spec.rb'
444
508
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
445
509
  - 'spec/fontisan/variation/subsetter_spec.rb'
@@ -451,17 +515,23 @@ RSpec/RepeatedExample:
451
515
  - 'spec/fontisan/metrics_calculator_spec.rb'
452
516
  - 'spec/fontisan/tables/os2_spec.rb'
453
517
 
454
- # Offense count: 6
518
+ # Offense count: 12
455
519
  # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
456
520
  # SupportedInflectors: default, active_support
457
521
  RSpec/SpecFilePathFormat:
458
522
  Exclude:
459
523
  - '**/spec/routing/**/*'
524
+ - 'spec/fontisan/collection/variable_font_builder_spec.rb'
525
+ - 'spec/fontisan/hints/postscript_hint_applier_spec.rb'
526
+ - 'spec/fontisan/hints/postscript_hint_extractor_spec.rb'
527
+ - 'spec/fontisan/hints/truetype_hint_applier_spec.rb'
528
+ - 'spec/fontisan/hints/truetype_hint_extractor_spec.rb'
460
529
  - 'spec/fontisan/tables/cff/charstring_builder_spec.rb'
530
+ - 'spec/fontisan/tables/cff/charstring_parser_spec.rb'
531
+ - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
461
532
  - 'spec/fontisan/tables/cff/charstring_spec.rb'
462
533
  - 'spec/fontisan/tables/glyf/curve_converter_spec.rb'
463
534
  - 'spec/fontisan/tables/glyf/glyph_builder_spec.rb'
464
- - 'spec/fontisan/variation/converter_spec.rb'
465
535
  - 'spec/fontisan/woff2/header_spec.rb'
466
536
 
467
537
  # Offense count: 1
@@ -485,7 +555,7 @@ RSpec/VerifiedDoubleReference:
485
555
  Exclude:
486
556
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
487
557
 
488
- # Offense count: 221
558
+ # Offense count: 292
489
559
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
490
560
  RSpec/VerifiedDoubles:
491
561
  Enabled: false
@@ -500,7 +570,15 @@ Security/Open:
500
570
  Exclude:
501
571
  - 'Rakefile'
502
572
 
503
- # Offense count: 10
573
+ # Offense count: 2
574
+ # This cop supports safe autocorrection (--autocorrect).
575
+ # Configuration parameters: EnforcedStyle.
576
+ # SupportedStyles: separated, grouped
577
+ Style/AccessorGrouping:
578
+ Exclude:
579
+ - 'lib/fontisan/woff2_font.rb'
580
+
581
+ # Offense count: 17
504
582
  # This cop supports safe autocorrection (--autocorrect).
505
583
  # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
506
584
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
@@ -509,25 +587,44 @@ Security/Open:
509
587
  # AllowedMethods: lambda, proc, it
510
588
  Style/BlockDelimiters:
511
589
  Exclude:
590
+ - 'spec/fontisan/commands/convert_command_spec.rb'
591
+ - 'spec/fontisan/hints/postscript_hint_applier_spec.rb'
512
592
  - 'spec/fontisan/lazy_loading_spec.rb'
513
593
  - 'spec/fontisan/loading_modes_spec.rb'
594
+ - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
595
+ - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
596
+ - 'spec/fontisan/utilities/checksum_calculator_spec.rb'
514
597
 
515
- # Offense count: 2
598
+ # Offense count: 4
516
599
  # This cop supports unsafe autocorrection (--autocorrect-all).
517
600
  Style/CombinableLoops:
518
601
  Exclude:
519
602
  - 'lib/fontisan/collection/offset_calculator.rb'
520
603
  - 'lib/fontisan/font_writer.rb'
604
+ - 'lib/fontisan/tables/cff/hint_operation_injector.rb'
605
+ - 'lib/fontisan/woff2_font.rb'
521
606
 
522
- # Offense count: 6
607
+ # Offense count: 4
608
+ # This cop supports safe autocorrection (--autocorrect).
609
+ # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
610
+ # SupportedStyles: assign_to_condition, assign_inside_condition
611
+ Style/ConditionalAssignment:
612
+ Exclude:
613
+ - 'lib/fontisan/tables/cff/charstring_rebuilder.rb'
614
+ - 'lib/fontisan/tables/cff2/table_builder.rb'
615
+ - 'lib/fontisan/woff2/glyf_transformer.rb'
616
+
617
+ # Offense count: 9
523
618
  # This cop supports safe autocorrection (--autocorrect).
524
619
  # Configuration parameters: EnforcedStyle, AllowComments.
525
620
  # SupportedStyles: empty, nil, both
526
621
  Style/EmptyElse:
527
622
  Exclude:
528
623
  - 'lib/fontisan/converters/outline_converter.rb'
624
+ - 'lib/fontisan/hints/postscript_hint_applier.rb'
529
625
  - 'lib/fontisan/hints/postscript_hint_extractor.rb'
530
626
  - 'lib/fontisan/hints/truetype_hint_extractor.rb'
627
+ - 'spec/fontisan/converters/outline_converter_spec.rb'
531
628
  - 'spec/integration/outline_conversion_spec.rb'
532
629
 
533
630
  # Offense count: 17
@@ -539,12 +636,13 @@ Style/FormatStringToken:
539
636
  - 'lib/fontisan/formatters/text_formatter.rb'
540
637
  - 'scripts/measure_optimization.rb'
541
638
 
542
- # Offense count: 3
639
+ # Offense count: 4
543
640
  # This cop supports unsafe autocorrection (--autocorrect-all).
544
641
  # Configuration parameters: AllowedReceivers.
545
642
  # AllowedReceivers: Thread.current
546
643
  Style/HashEachMethods:
547
644
  Exclude:
645
+ - 'lib/fontisan/converters/woff_writer.rb'
548
646
  - 'lib/fontisan/subset/table_subsetter.rb'
549
647
  - 'spec/fontisan/subset/glyph_mapping_spec.rb'
550
648
 
@@ -555,19 +653,27 @@ Style/HashLikeCase:
555
653
  - 'lib/fontisan/commands/unpack_command.rb'
556
654
  - 'lib/fontisan/models/validation_report.rb'
557
655
 
558
- # Offense count: 2
656
+ # Offense count: 8
559
657
  # This cop supports unsafe autocorrection (--autocorrect-all).
560
658
  Style/IdenticalConditionalBranches:
561
659
  Exclude:
562
660
  - 'lib/fontisan/models/hint.rb'
661
+ - 'lib/fontisan/woff2/glyf_transformer.rb'
662
+ - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
563
663
 
564
- # Offense count: 3
664
+ # Offense count: 1
665
+ # This cop supports safe autocorrection (--autocorrect).
666
+ # Configuration parameters: AllowMethodComparison, ComparisonsThreshold.
667
+ Style/MultipleComparison:
668
+ Exclude:
669
+ - 'lib/fontisan/tables/cff2/table_builder.rb'
670
+
671
+ # Offense count: 1
565
672
  # This cop supports unsafe autocorrection (--autocorrect-all).
566
673
  # Configuration parameters: EnforcedStyle.
567
674
  # SupportedStyles: literals, strict
568
675
  Style/MutableConstant:
569
676
  Exclude:
570
- - 'lib/fontisan/hints/postscript_hint_applier.rb'
571
677
  - 'lib/fontisan/hints/truetype_hint_extractor.rb'
572
678
 
573
679
  # Offense count: 1
@@ -582,18 +688,44 @@ Style/NestedTernaryOperator:
582
688
  Exclude:
583
689
  - 'lib/fontisan/font_loader.rb'
584
690
 
691
+ # Offense count: 3
692
+ # This cop supports safe autocorrection (--autocorrect).
693
+ Style/NilLambda:
694
+ Exclude:
695
+ - 'lib/fontisan/models/font_export.rb'
696
+ - 'lib/fontisan/models/validation_report.rb'
697
+
698
+ # Offense count: 2
699
+ # This cop supports unsafe autocorrection (--autocorrect-all).
700
+ # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
701
+ # SupportedStyles: predicate, comparison
702
+ Style/NumericPredicate:
703
+ Exclude:
704
+ - 'spec/**/*'
705
+ - 'lib/fontisan/hints/hint_converter.rb'
706
+ - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
707
+
585
708
  # Offense count: 2
586
709
  # This cop supports safe autocorrection (--autocorrect).
587
710
  Style/ParallelAssignment:
588
711
  Exclude:
589
712
  - 'spec/fontisan/variation/blend_applier_spec.rb'
590
713
 
591
- # Offense count: 1
714
+ # Offense count: 2
592
715
  # This cop supports safe autocorrection (--autocorrect).
593
716
  Style/RedundantAssignment:
594
717
  Exclude:
718
+ - 'lib/fontisan/woff2/glyf_transformer.rb'
595
719
  - 'spec/fontisan/variation/subsetter_spec.rb'
596
720
 
721
+ # Offense count: 4
722
+ # This cop supports safe autocorrection (--autocorrect).
723
+ Style/RedundantBegin:
724
+ Exclude:
725
+ - 'lib/fontisan/hints/postscript_hint_extractor.rb'
726
+ - 'lib/fontisan/hints/truetype_hint_extractor.rb'
727
+ - 'lib/fontisan/tables/cff2/table_reader.rb'
728
+
597
729
  # Offense count: 10
598
730
  # This cop supports unsafe autocorrection (--autocorrect-all).
599
731
  # Configuration parameters: SafeForConstants.
@@ -607,13 +739,30 @@ Style/RedundantFreeze:
607
739
  Exclude:
608
740
  - 'lib/fontisan/constants.rb'
609
741
 
610
- # Offense count: 1
742
+ # Offense count: 5
743
+ # This cop supports safe autocorrection (--autocorrect).
744
+ Style/RedundantParentheses:
745
+ Exclude:
746
+ - 'lib/fontisan/tables/cff/charstring_parser.rb'
747
+ - 'spec/fontisan/tables/cff2/region_matcher_spec.rb'
748
+
749
+ # Offense count: 5
611
750
  # This cop supports unsafe autocorrection (--autocorrect-all).
612
751
  # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
613
752
  # AllowedMethods: present?, blank?, presence, try, try!
614
753
  Style/SafeNavigation:
615
754
  Exclude:
755
+ - 'Rakefile'
616
756
  - 'lib/fontisan/subset/table_subsetter.rb'
757
+ - 'lib/fontisan/tables/cff2/table_builder.rb'
758
+ - 'lib/fontisan/woff2_font.rb'
759
+
760
+ # Offense count: 2
761
+ # This cop supports unsafe autocorrection (--autocorrect-all).
762
+ Style/SlicingWithRange:
763
+ Exclude:
764
+ - 'lib/fontisan/tables/cff2/table_builder.rb'
765
+ - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
617
766
 
618
767
  # Offense count: 5
619
768
  # This cop supports safe autocorrection (--autocorrect).
@@ -629,53 +778,43 @@ Style/StringLiterals:
629
778
  Exclude:
630
779
  - 'benchmark/variation_quick_bench.rb'
631
780
 
632
- # Offense count: 67
781
+ # Offense count: 1
782
+ # This cop supports safe autocorrection (--autocorrect).
783
+ # Configuration parameters: .
784
+ # SupportedStyles: percent, brackets
785
+ Style/SymbolArray:
786
+ EnforcedStyle: percent
787
+ MinSize: 14
788
+
789
+ # Offense count: 220
633
790
  # This cop supports safe autocorrection (--autocorrect).
634
791
  # Configuration parameters: EnforcedStyleForMultiline.
635
792
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
636
793
  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'
794
+ Enabled: false
653
795
 
654
- # Offense count: 34
796
+ # Offense count: 108
655
797
  # This cop supports safe autocorrection (--autocorrect).
656
798
  # Configuration parameters: EnforcedStyleForMultiline.
657
799
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
658
800
  Style/TrailingCommaInArrayLiteral:
659
- 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'
666
- - 'spec/fontisan/variation/parallel_generator_spec.rb'
667
- - 'spec/fontisan/variation/validator_spec.rb'
801
+ Enabled: false
668
802
 
669
- # Offense count: 33
803
+ # Offense count: 77
670
804
  # This cop supports safe autocorrection (--autocorrect).
671
805
  # Configuration parameters: EnforcedStyleForMultiline.
672
806
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
673
807
  Style/TrailingCommaInHashLiteral:
808
+ Enabled: false
809
+
810
+ # Offense count: 1
811
+ # This cop supports safe autocorrection (--autocorrect).
812
+ Style/UnlessElse:
674
813
  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'
814
+ - 'lib/fontisan/woff2/glyf_transformer.rb'
815
+
816
+ # Offense count: 1
817
+ # This cop supports unsafe autocorrection (--autocorrect-all).
818
+ Style/ZeroLengthPredicate:
819
+ Exclude:
820
+ - 'lib/fontisan/hints/hint_converter.rb'