fontisan 0.2.1 → 0.2.3

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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +58 -392
  3. data/README.adoc +1509 -1430
  4. data/Rakefile +3 -2
  5. data/benchmark/variation_quick_bench.rb +4 -4
  6. data/docs/FONT_HINTING.adoc +562 -0
  7. data/docs/VARIABLE_FONT_OPERATIONS.adoc +599 -0
  8. data/lib/fontisan/base_collection.rb +296 -0
  9. data/lib/fontisan/cli.rb +10 -3
  10. data/lib/fontisan/collection/builder.rb +2 -1
  11. data/lib/fontisan/collection/offset_calculator.rb +2 -0
  12. data/lib/fontisan/commands/base_command.rb +5 -2
  13. data/lib/fontisan/commands/convert_command.rb +6 -2
  14. data/lib/fontisan/commands/info_command.rb +129 -5
  15. data/lib/fontisan/commands/instance_command.rb +8 -7
  16. data/lib/fontisan/commands/validate_command.rb +4 -1
  17. data/lib/fontisan/constants.rb +24 -24
  18. data/lib/fontisan/converters/format_converter.rb +8 -4
  19. data/lib/fontisan/converters/outline_converter.rb +21 -16
  20. data/lib/fontisan/converters/woff_writer.rb +8 -3
  21. data/lib/fontisan/font_loader.rb +120 -30
  22. data/lib/fontisan/font_writer.rb +2 -0
  23. data/lib/fontisan/formatters/text_formatter.rb +116 -19
  24. data/lib/fontisan/hints/hint_converter.rb +43 -47
  25. data/lib/fontisan/hints/hint_validator.rb +284 -0
  26. data/lib/fontisan/hints/postscript_hint_applier.rb +1 -3
  27. data/lib/fontisan/hints/postscript_hint_extractor.rb +78 -43
  28. data/lib/fontisan/hints/truetype_hint_extractor.rb +22 -26
  29. data/lib/fontisan/hints/truetype_instruction_analyzer.rb +261 -0
  30. data/lib/fontisan/hints/truetype_instruction_generator.rb +266 -0
  31. data/lib/fontisan/loading_modes.rb +4 -4
  32. data/lib/fontisan/models/collection_brief_info.rb +37 -0
  33. data/lib/fontisan/models/collection_info.rb +6 -1
  34. data/lib/fontisan/models/font_export.rb +2 -2
  35. data/lib/fontisan/models/font_info.rb +3 -30
  36. data/lib/fontisan/models/hint.rb +22 -23
  37. data/lib/fontisan/models/outline.rb +4 -1
  38. data/lib/fontisan/models/validation_report.rb +1 -1
  39. data/lib/fontisan/open_type_collection.rb +17 -220
  40. data/lib/fontisan/open_type_font.rb +3 -1
  41. data/lib/fontisan/optimizers/pattern_analyzer.rb +2 -1
  42. data/lib/fontisan/optimizers/subroutine_generator.rb +1 -1
  43. data/lib/fontisan/pipeline/output_writer.rb +8 -3
  44. data/lib/fontisan/pipeline/transformation_pipeline.rb +8 -3
  45. data/lib/fontisan/subset/table_subsetter.rb +5 -5
  46. data/lib/fontisan/tables/cff/charstring.rb +38 -12
  47. data/lib/fontisan/tables/cff/charstring_parser.rb +23 -11
  48. data/lib/fontisan/tables/cff/charstring_rebuilder.rb +14 -14
  49. data/lib/fontisan/tables/cff/dict_builder.rb +4 -1
  50. data/lib/fontisan/tables/cff/hint_operation_injector.rb +6 -4
  51. data/lib/fontisan/tables/cff/offset_recalculator.rb +1 -1
  52. data/lib/fontisan/tables/cff/private_dict_writer.rb +10 -4
  53. data/lib/fontisan/tables/cff/table_builder.rb +1 -1
  54. data/lib/fontisan/tables/cff2/charstring_parser.rb +14 -8
  55. data/lib/fontisan/tables/cff2/private_dict_blend_handler.rb +7 -6
  56. data/lib/fontisan/tables/cff2/region_matcher.rb +2 -2
  57. data/lib/fontisan/tables/cff2/table_builder.rb +26 -20
  58. data/lib/fontisan/tables/cff2/table_reader.rb +35 -33
  59. data/lib/fontisan/tables/cff2/variation_data_extractor.rb +2 -2
  60. data/lib/fontisan/tables/cff2.rb +1 -1
  61. data/lib/fontisan/tables/glyf/compound_glyph_resolver.rb +2 -1
  62. data/lib/fontisan/tables/glyf/curve_converter.rb +10 -4
  63. data/lib/fontisan/tables/glyf/glyph_builder.rb +27 -10
  64. data/lib/fontisan/tables/name.rb +4 -4
  65. data/lib/fontisan/true_type_collection.rb +29 -113
  66. data/lib/fontisan/true_type_font.rb +3 -1
  67. data/lib/fontisan/validation/checksum_validator.rb +2 -2
  68. data/lib/fontisan/variation/cache.rb +3 -1
  69. data/lib/fontisan/variation/converter.rb +2 -1
  70. data/lib/fontisan/variation/delta_applier.rb +2 -1
  71. data/lib/fontisan/variation/inspector.rb +2 -1
  72. data/lib/fontisan/variation/instance_generator.rb +2 -1
  73. data/lib/fontisan/variation/optimizer.rb +6 -3
  74. data/lib/fontisan/variation/subsetter.rb +32 -10
  75. data/lib/fontisan/variation/variation_preserver.rb +4 -1
  76. data/lib/fontisan/version.rb +1 -1
  77. data/lib/fontisan/woff2/glyf_transformer.rb +57 -30
  78. data/lib/fontisan/woff2_font.rb +31 -15
  79. data/lib/fontisan.rb +42 -2
  80. data/scripts/measure_optimization.rb +15 -7
  81. metadata +9 -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-28 12:03:20 UTC using RuboCop version 1.81.7.
3
+ # on 2025-12-30 09:54:17 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,157 +12,33 @@ Gemspec/RequiredRubyVersion:
12
12
  Exclude:
13
13
  - 'fontisan.gemspec'
14
14
 
15
- # Offense count: 6
16
- # This cop supports safe autocorrection (--autocorrect).
17
- # Configuration parameters: EnforcedStyle, IndentationWidth.
18
- # SupportedStyles: with_first_argument, with_fixed_indentation
19
- Layout/ArgumentAlignment:
20
- Exclude:
21
- - 'spec/fontisan/loading_modes_spec.rb'
22
- - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
23
- - 'spec/fontisan/variation/validator_spec.rb'
24
- - 'spec/integration/outline_conversion_spec.rb'
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
-
34
- # Offense count: 2
35
- # This cop supports safe autocorrection (--autocorrect).
36
- Layout/ElseAlignment:
37
- Exclude:
38
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
39
- - 'lib/fontisan/subset/table_subsetter.rb'
40
-
41
- # Offense count: 48
15
+ # Offense count: 1
42
16
  # This cop supports safe autocorrection (--autocorrect).
43
17
  Layout/EmptyLineAfterGuardClause:
44
18
  Exclude:
45
- - 'lib/fontisan/models/hint.rb'
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'
50
- - 'lib/fontisan/true_type_font.rb'
51
- - 'lib/fontisan/woff2/glyf_transformer.rb'
52
- - 'lib/fontisan/woff2_font.rb'
19
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
53
20
 
54
- # Offense count: 2
21
+ # Offense count: 1
55
22
  # This cop supports safe autocorrection (--autocorrect).
56
- # Configuration parameters: EnforcedStyleAlignWith, Severity.
57
- # SupportedStylesAlignWith: keyword, variable, start_of_line
58
- Layout/EndAlignment:
23
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
59
24
  Exclude:
60
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
61
- - 'lib/fontisan/subset/table_subsetter.rb'
25
+ - 'lib/fontisan/hints/hint_validator.rb'
62
26
 
63
- # Offense count: 51
27
+ # Offense count: 2
64
28
  # This cop supports safe autocorrection (--autocorrect).
65
29
  # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
66
30
  Layout/ExtraSpacing:
67
31
  Exclude:
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'
81
- - 'spec/fontisan/variation/delta_parser_spec.rb'
82
- - 'spec/fontisan/variation/validator_spec.rb'
83
-
84
- # Offense count: 24
85
- # This cop supports safe autocorrection (--autocorrect).
86
- # Configuration parameters: EnforcedStyle, IndentationWidth.
87
- # SupportedStyles: special_inside_parentheses, consistent, align_brackets
88
- Layout/FirstArrayElementIndentation:
89
- Exclude:
90
- - 'spec/fontisan/variation/delta_applier_spec.rb'
91
- - 'spec/fontisan/variation/delta_parser_spec.rb'
92
- - 'spec/fontisan/variation/optimizer_spec.rb'
93
- - 'spec/fontisan/variation/validator_spec.rb'
94
-
95
- # Offense count: 18
96
- # This cop supports safe autocorrection (--autocorrect).
97
- # Configuration parameters: EnforcedStyle, IndentationWidth.
98
- # SupportedStyles: special_inside_parentheses, consistent, align_braces
99
- Layout/FirstHashElementIndentation:
100
- Exclude:
101
- - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
102
- - 'spec/fontisan/variation/delta_applier_spec.rb'
103
- - 'spec/fontisan/variation/subsetter_spec.rb'
104
-
105
- # Offense count: 3
106
- # This cop supports safe autocorrection (--autocorrect).
107
- # Configuration parameters: Width, AllowedPatterns.
108
- Layout/IndentationWidth:
109
- Exclude:
110
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
111
- - 'lib/fontisan/subset/table_subsetter.rb'
112
- - 'spec/fontisan/tables/glyf_spec.rb'
32
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
113
33
 
114
- # Offense count: 1303
34
+ # Offense count: 1109
115
35
  # This cop supports safe autocorrection (--autocorrect).
116
36
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
117
37
  # URISchemes: http, https
118
38
  Layout/LineLength:
119
39
  Enabled: false
120
40
 
121
- # Offense count: 4
122
- # This cop supports safe autocorrection (--autocorrect).
123
- # Configuration parameters: EnforcedStyle.
124
- # SupportedStyles: symmetrical, new_line, same_line
125
- Layout/MultilineMethodCallBraceLayout:
126
- Exclude:
127
- - 'spec/fontisan/tables/cff2/table_builder_spec.rb'
128
- - 'spec/fontisan/variation/validator_spec.rb'
129
-
130
- # Offense count: 3
131
- # This cop supports safe autocorrection (--autocorrect).
132
- # Configuration parameters: EnforcedStyle, IndentationWidth.
133
- # SupportedStyles: aligned, indented, indented_relative_to_receiver
134
- Layout/MultilineMethodCallIndentation:
135
- Exclude:
136
- - 'lib/fontisan/tables/cff2/region_matcher.rb'
137
- - 'lib/fontisan/tables/name.rb'
138
-
139
- # Offense count: 3
140
- # This cop supports safe autocorrection (--autocorrect).
141
- # Configuration parameters: EnforcedStyle, IndentationWidth.
142
- # SupportedStyles: aligned, indented
143
- Layout/MultilineOperationIndentation:
144
- Exclude:
145
- - 'lib/fontisan/hints/hint_converter.rb'
146
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
147
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
148
-
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
41
+ # Offense count: 26
166
42
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
167
43
  Lint/DuplicateBranch:
168
44
  Enabled: false
@@ -173,12 +49,6 @@ Lint/DuplicateMethods:
173
49
  - 'lib/fontisan/tables/glyf.rb'
174
50
  - 'lib/fontisan/woff2_font.rb'
175
51
 
176
- # Offense count: 2
177
- # This cop supports unsafe autocorrection (--autocorrect-all).
178
- Lint/DuplicateRequire:
179
- Exclude:
180
- - 'lib/fontisan.rb'
181
-
182
52
  # Offense count: 2
183
53
  # This cop supports safe autocorrection (--autocorrect).
184
54
  # Configuration parameters: AllowComments.
@@ -204,87 +74,55 @@ Lint/MissingSuper:
204
74
  Exclude:
205
75
  - 'lib/fontisan/tables/cff2/table_builder.rb'
206
76
 
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
-
216
77
  # Offense count: 1
217
78
  Lint/StructNewOverride:
218
79
  Exclude:
219
80
  - 'lib/fontisan/optimizers/pattern_analyzer.rb'
220
81
 
221
- # Offense count: 6
222
- # This cop supports safe autocorrection (--autocorrect).
223
- # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
224
- Lint/UnusedBlockArgument:
225
- Exclude:
226
- - 'lib/fontisan/models/hint.rb'
227
- - 'lib/fontisan/tables/cff2/charstring_parser.rb'
228
- - 'lib/fontisan/tables/cff2/table_reader.rb'
229
- - 'spec/fontisan/converters/format_converter_spec.rb'
230
- - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
231
-
232
- # Offense count: 13
82
+ # Offense count: 5
233
83
  # This cop supports safe autocorrection (--autocorrect).
234
84
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
235
85
  # NotImplementedExceptions: NotImplementedError
236
86
  Lint/UnusedMethodArgument:
237
87
  Exclude:
238
- - 'lib/fontisan/commands/instance_command.rb'
239
- - 'lib/fontisan/converters/outline_converter.rb'
240
88
  - 'lib/fontisan/font_loader.rb'
241
- - 'lib/fontisan/hints/hint_converter.rb'
242
- - 'lib/fontisan/tables/cff2/charstring_parser.rb'
243
89
  - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
244
90
  - 'lib/fontisan/utilities/brotli_wrapper.rb'
245
91
  - 'lib/fontisan/variation/table_accessor.rb'
246
92
  - 'lib/fontisan/woff2/glyf_transformer.rb'
247
93
 
248
- # Offense count: 16
94
+ # Offense count: 3
249
95
  # This cop supports safe autocorrection (--autocorrect).
250
96
  Lint/UselessAssignment:
251
97
  Exclude:
252
- - 'lib/fontisan/cli.rb'
253
- - 'lib/fontisan/converters/outline_converter.rb'
254
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
255
- - 'lib/fontisan/models/hint.rb'
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'
260
- - 'spec/fontisan/utils/thread_pool_spec.rb'
261
- - 'spec/fontisan/variation/optimizer_spec.rb'
98
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
99
+ - 'spec/fontisan/hints/hint_round_trip_spec.rb'
262
100
 
263
- # Offense count: 423
101
+ # Offense count: 432
264
102
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
265
103
  Metrics/AbcSize:
266
104
  Enabled: false
267
105
 
268
- # Offense count: 26
106
+ # Offense count: 27
269
107
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
270
108
  # AllowedMethods: refine
271
109
  Metrics/BlockLength:
272
- Max: 81
110
+ Max: 80
273
111
 
274
- # Offense count: 4
112
+ # Offense count: 8
275
113
  # Configuration parameters: CountBlocks, CountModifierForms.
276
114
  Metrics/BlockNesting:
277
115
  Max: 5
278
116
 
279
- # Offense count: 213
117
+ # Offense count: 223
280
118
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
281
119
  Metrics/CyclomaticComplexity:
282
120
  Enabled: false
283
121
 
284
- # Offense count: 630
122
+ # Offense count: 648
285
123
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
286
124
  Metrics/MethodLength:
287
- Max: 136
125
+ Max: 135
288
126
 
289
127
  # Offense count: 17
290
128
  # Configuration parameters: CountKeywordArgs.
@@ -292,7 +130,7 @@ Metrics/ParameterLists:
292
130
  Max: 39
293
131
  MaxOptionalParameters: 4
294
132
 
295
- # Offense count: 150
133
+ # Offense count: 157
296
134
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
297
135
  Metrics/PerceivedComplexity:
298
136
  Enabled: false
@@ -347,47 +185,30 @@ Performance/CollectionLiteralInLoop:
347
185
  - 'spec/fontisan/commands/tables_command_spec.rb'
348
186
 
349
187
  # 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
363
188
  # This cop supports unsafe autocorrection (--autocorrect-all).
364
189
  Performance/TimesMap:
365
190
  Exclude:
366
- - 'benchmark/variation_quick_bench.rb'
191
+ - 'lib/fontisan/font_loader.rb'
367
192
  - 'lib/fontisan/tables/cff2.rb'
368
- - 'spec/fontisan/hints/hint_application_integration_spec.rb'
369
- - 'spec/fontisan/utilities/checksum_calculator_spec.rb'
370
- - 'spec/fontisan/utils/thread_pool_spec.rb'
371
- - 'spec/fontisan/variation/cache_spec.rb'
372
- - 'spec/fontisan/variation/parallel_generator_spec.rb'
373
193
 
374
- # Offense count: 23
194
+ # Offense count: 24
375
195
  RSpec/AnyInstance:
376
196
  Exclude:
377
197
  - 'spec/fontisan/converters/format_converter_spec.rb'
198
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
378
199
  - 'spec/fontisan/validation/validator_spec.rb'
379
200
  - 'spec/fontisan/variation/delta_applier_spec.rb'
380
201
  - 'spec/fontisan/variation/instance_writer_spec.rb'
381
202
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
382
203
  - 'spec/integration/format_conversion_spec.rb'
383
204
 
384
- # Offense count: 94
205
+ # Offense count: 100
385
206
  # Configuration parameters: Prefixes, AllowedPatterns.
386
207
  # Prefixes: when, with, without
387
208
  RSpec/ContextWording:
388
209
  Enabled: false
389
210
 
390
- # Offense count: 16
211
+ # Offense count: 17
391
212
  # Configuration parameters: IgnoredMetadata.
392
213
  RSpec/DescribeClass:
393
214
  Enabled: false
@@ -397,7 +218,7 @@ RSpec/DescribeMethod:
397
218
  Exclude:
398
219
  - 'spec/fontisan/collection/variable_font_builder_spec.rb'
399
220
 
400
- # Offense count: 1108
221
+ # Offense count: 1156
401
222
  # Configuration parameters: CountAsOne.
402
223
  RSpec/ExampleLength:
403
224
  Max: 66
@@ -444,13 +265,6 @@ RSpec/IteratedExpectation:
444
265
  Exclude:
445
266
  - 'spec/fontisan/tables/glyf_spec.rb'
446
267
 
447
- # Offense count: 2
448
- # This cop supports safe autocorrection (--autocorrect).
449
- RSpec/LeadingSubject:
450
- Exclude:
451
- - 'spec/fontisan/variation/blend_applier_spec.rb'
452
- - 'spec/fontisan/variation/delta_applier_spec.rb'
453
-
454
268
  # Offense count: 19
455
269
  # Configuration parameters: EnforcedStyle.
456
270
  # SupportedStyles: have_received, receive
@@ -474,11 +288,11 @@ RSpec/MultipleDescribes:
474
288
  - 'spec/fontisan/utils/thread_pool_spec.rb'
475
289
  - 'spec/fontisan/variation/cache_spec.rb'
476
290
 
477
- # Offense count: 1414
291
+ # Offense count: 1494
478
292
  RSpec/MultipleExpectations:
479
293
  Max: 22
480
294
 
481
- # Offense count: 132
295
+ # Offense count: 134
482
296
  # Configuration parameters: AllowSubject.
483
297
  RSpec/MultipleMemoizedHelpers:
484
298
  Max: 13
@@ -488,34 +302,23 @@ RSpec/MultipleMemoizedHelpers:
488
302
  RSpec/NestedGroups:
489
303
  Max: 4
490
304
 
491
- # Offense count: 8
305
+ # Offense count: 10
492
306
  # Configuration parameters: AllowedPatterns.
493
307
  # AllowedPatterns: ^expect_, ^assert_
494
308
  RSpec/NoExpectationExample:
495
309
  Exclude:
496
310
  - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
311
+ - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
497
312
  - 'spec/fontisan/variation/variable_svg_generator_spec.rb'
498
313
 
499
- # Offense count: 111
500
- # This cop supports unsafe autocorrection (--autocorrect-all).
501
- RSpec/ReceiveMessages:
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'
507
- - 'spec/fontisan/variation/optimizer_spec.rb'
508
- - 'spec/fontisan/variation/parallel_generator_spec.rb'
509
- - 'spec/fontisan/variation/subsetter_spec.rb'
510
- - 'spec/fontisan/variation/validator_spec.rb'
511
-
512
- # Offense count: 9
314
+ # Offense count: 11
513
315
  RSpec/RepeatedExample:
514
316
  Exclude:
317
+ - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
515
318
  - 'spec/fontisan/metrics_calculator_spec.rb'
516
319
  - 'spec/fontisan/tables/os2_spec.rb'
517
320
 
518
- # Offense count: 12
321
+ # Offense count: 14
519
322
  # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
520
323
  # SupportedInflectors: default, active_support
521
324
  RSpec/SpecFilePathFormat:
@@ -526,6 +329,8 @@ RSpec/SpecFilePathFormat:
526
329
  - 'spec/fontisan/hints/postscript_hint_extractor_spec.rb'
527
330
  - 'spec/fontisan/hints/truetype_hint_applier_spec.rb'
528
331
  - 'spec/fontisan/hints/truetype_hint_extractor_spec.rb'
332
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
333
+ - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
529
334
  - 'spec/fontisan/tables/cff/charstring_builder_spec.rb'
530
335
  - 'spec/fontisan/tables/cff/charstring_parser_spec.rb'
531
336
  - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
@@ -570,15 +375,7 @@ Security/Open:
570
375
  Exclude:
571
376
  - 'Rakefile'
572
377
 
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
378
+ # Offense count: 3
582
379
  # This cop supports safe autocorrection (--autocorrect).
583
380
  # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
584
381
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
@@ -587,45 +384,22 @@ Style/AccessorGrouping:
587
384
  # AllowedMethods: lambda, proc, it
588
385
  Style/BlockDelimiters:
589
386
  Exclude:
590
- - 'spec/fontisan/commands/convert_command_spec.rb'
591
- - 'spec/fontisan/hints/postscript_hint_applier_spec.rb'
592
- - 'spec/fontisan/lazy_loading_spec.rb'
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'
387
+ - 'spec/fontisan/hints/hint_validator_spec.rb'
388
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
597
389
 
598
- # Offense count: 4
390
+ # Offense count: 1
599
391
  # This cop supports unsafe autocorrection (--autocorrect-all).
600
392
  Style/CombinableLoops:
601
393
  Exclude:
602
- - 'lib/fontisan/collection/offset_calculator.rb'
603
- - 'lib/fontisan/font_writer.rb'
604
- - 'lib/fontisan/tables/cff/hint_operation_injector.rb'
605
394
  - 'lib/fontisan/woff2_font.rb'
606
395
 
607
- # Offense count: 4
396
+ # Offense count: 2
608
397
  # This cop supports safe autocorrection (--autocorrect).
609
398
  # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
610
399
  # SupportedStyles: assign_to_condition, assign_inside_condition
611
400
  Style/ConditionalAssignment:
612
401
  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
618
- # This cop supports safe autocorrection (--autocorrect).
619
- # Configuration parameters: EnforcedStyle, AllowComments.
620
- # SupportedStyles: empty, nil, both
621
- Style/EmptyElse:
622
- Exclude:
623
- - 'lib/fontisan/converters/outline_converter.rb'
624
- - 'lib/fontisan/hints/postscript_hint_applier.rb'
625
- - 'lib/fontisan/hints/postscript_hint_extractor.rb'
626
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
627
- - 'spec/fontisan/converters/outline_converter_spec.rb'
628
- - 'spec/integration/outline_conversion_spec.rb'
402
+ - 'lib/fontisan/formatters/text_formatter.rb'
629
403
 
630
404
  # Offense count: 17
631
405
  # This cop supports safe autocorrection (--autocorrect).
@@ -653,79 +427,19 @@ Style/HashLikeCase:
653
427
  - 'lib/fontisan/commands/unpack_command.rb'
654
428
  - 'lib/fontisan/models/validation_report.rb'
655
429
 
656
- # Offense count: 8
657
- # This cop supports unsafe autocorrection (--autocorrect-all).
658
- Style/IdenticalConditionalBranches:
659
- Exclude:
660
- - 'lib/fontisan/models/hint.rb'
661
- - 'lib/fontisan/woff2/glyf_transformer.rb'
662
- - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
663
-
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
672
- # This cop supports unsafe autocorrection (--autocorrect-all).
673
- # Configuration parameters: EnforcedStyle.
674
- # SupportedStyles: literals, strict
675
- Style/MutableConstant:
676
- Exclude:
677
- - 'lib/fontisan/hints/truetype_hint_extractor.rb'
678
-
679
- # Offense count: 1
680
- # This cop supports safe autocorrection (--autocorrect).
681
- Style/NegatedIfElseCondition:
682
- Exclude:
683
- - 'lib/fontisan/converters/outline_converter.rb'
684
-
685
- # Offense count: 1
686
- # This cop supports safe autocorrection (--autocorrect).
687
- Style/NestedTernaryOperator:
688
- Exclude:
689
- - 'lib/fontisan/font_loader.rb'
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
430
+ # Offense count: 6
699
431
  # This cop supports unsafe autocorrection (--autocorrect-all).
700
432
  # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
701
433
  # SupportedStyles: predicate, comparison
702
434
  Style/NumericPredicate:
703
435
  Exclude:
704
436
  - 'spec/**/*'
437
+ - 'lib/fontisan/font_loader.rb'
705
438
  - 'lib/fontisan/hints/hint_converter.rb'
439
+ - 'lib/fontisan/hints/hint_validator.rb'
440
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
706
441
  - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
707
442
 
708
- # Offense count: 2
709
- # This cop supports safe autocorrection (--autocorrect).
710
- Style/ParallelAssignment:
711
- Exclude:
712
- - 'spec/fontisan/variation/blend_applier_spec.rb'
713
-
714
- # Offense count: 2
715
- # This cop supports safe autocorrection (--autocorrect).
716
- Style/RedundantAssignment:
717
- Exclude:
718
- - 'lib/fontisan/woff2/glyf_transformer.rb'
719
- - 'spec/fontisan/variation/subsetter_spec.rb'
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
-
729
443
  # Offense count: 10
730
444
  # This cop supports unsafe autocorrection (--autocorrect-all).
731
445
  # Configuration parameters: SafeForConstants.
@@ -733,85 +447,37 @@ Style/RedundantFetchBlock:
733
447
  Exclude:
734
448
  - 'spec/fontisan/variation/cache_spec.rb'
735
449
 
736
- # Offense count: 24
737
- # This cop supports safe autocorrection (--autocorrect).
738
- Style/RedundantFreeze:
739
- Exclude:
740
- - 'lib/fontisan/constants.rb'
741
-
742
- # Offense count: 5
450
+ # Offense count: 1
743
451
  # This cop supports safe autocorrection (--autocorrect).
744
- Style/RedundantParentheses:
452
+ # Configuration parameters: AllowModifier.
453
+ Style/SoleNestedConditional:
745
454
  Exclude:
746
- - 'lib/fontisan/tables/cff/charstring_parser.rb'
747
- - 'spec/fontisan/tables/cff2/region_matcher_spec.rb'
748
-
749
- # Offense count: 5
750
- # This cop supports unsafe autocorrection (--autocorrect-all).
751
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
752
- # AllowedMethods: present?, blank?, presence, try, try!
753
- Style/SafeNavigation:
754
- Exclude:
755
- - 'Rakefile'
756
- - 'lib/fontisan/subset/table_subsetter.rb'
757
- - 'lib/fontisan/tables/cff2/table_builder.rb'
758
- - 'lib/fontisan/woff2_font.rb'
455
+ - 'lib/fontisan/hints/hint_validator.rb'
759
456
 
760
457
  # 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'
766
-
767
- # Offense count: 5
768
- # This cop supports safe autocorrection (--autocorrect).
769
- Style/StderrPuts:
770
- Exclude:
771
- - 'lib/fontisan/commands/instance_command.rb'
772
-
773
- # Offense count: 3
774
- # This cop supports safe autocorrection (--autocorrect).
775
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
776
- # SupportedStyles: single_quotes, double_quotes
777
- Style/StringLiterals:
778
- Exclude:
779
- - 'benchmark/variation_quick_bench.rb'
780
-
781
- # Offense count: 1
782
458
  # This cop supports safe autocorrection (--autocorrect).
783
459
  # Configuration parameters: .
784
460
  # SupportedStyles: percent, brackets
785
461
  Style/SymbolArray:
786
462
  EnforcedStyle: percent
787
- MinSize: 14
463
+ MinSize: 3
788
464
 
789
- # Offense count: 220
790
- # This cop supports safe autocorrection (--autocorrect).
791
- # Configuration parameters: EnforcedStyleForMultiline.
792
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
793
- Style/TrailingCommaInArguments:
794
- Enabled: false
795
-
796
- # Offense count: 108
465
+ # Offense count: 3
797
466
  # This cop supports safe autocorrection (--autocorrect).
798
467
  # Configuration parameters: EnforcedStyleForMultiline.
799
468
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
800
469
  Style/TrailingCommaInArrayLiteral:
801
- Enabled: false
470
+ Exclude:
471
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
472
+ - 'spec/fontisan/variation/parallel_generator_spec.rb'
802
473
 
803
- # Offense count: 77
474
+ # Offense count: 1
804
475
  # This cop supports safe autocorrection (--autocorrect).
805
476
  # Configuration parameters: EnforcedStyleForMultiline.
806
477
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
807
478
  Style/TrailingCommaInHashLiteral:
808
- Enabled: false
809
-
810
- # Offense count: 1
811
- # This cop supports safe autocorrection (--autocorrect).
812
- Style/UnlessElse:
813
479
  Exclude:
814
- - 'lib/fontisan/woff2/glyf_transformer.rb'
480
+ - 'lib/fontisan/hints/truetype_instruction_generator.rb'
815
481
 
816
482
  # Offense count: 1
817
483
  # This cop supports unsafe autocorrection (--autocorrect-all).