fontisan 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +57 -385
  3. data/README.adoc +1483 -1435
  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/cli.rb +10 -3
  9. data/lib/fontisan/collection/builder.rb +2 -1
  10. data/lib/fontisan/collection/offset_calculator.rb +2 -0
  11. data/lib/fontisan/commands/base_command.rb +5 -2
  12. data/lib/fontisan/commands/convert_command.rb +6 -2
  13. data/lib/fontisan/commands/info_command.rb +111 -5
  14. data/lib/fontisan/commands/instance_command.rb +8 -7
  15. data/lib/fontisan/commands/validate_command.rb +4 -1
  16. data/lib/fontisan/constants.rb +24 -24
  17. data/lib/fontisan/converters/format_converter.rb +8 -4
  18. data/lib/fontisan/converters/outline_converter.rb +21 -16
  19. data/lib/fontisan/converters/woff_writer.rb +8 -3
  20. data/lib/fontisan/font_loader.rb +11 -4
  21. data/lib/fontisan/font_writer.rb +2 -0
  22. data/lib/fontisan/formatters/text_formatter.rb +45 -1
  23. data/lib/fontisan/hints/hint_converter.rb +43 -47
  24. data/lib/fontisan/hints/hint_validator.rb +284 -0
  25. data/lib/fontisan/hints/postscript_hint_applier.rb +1 -3
  26. data/lib/fontisan/hints/postscript_hint_extractor.rb +78 -43
  27. data/lib/fontisan/hints/truetype_hint_extractor.rb +22 -26
  28. data/lib/fontisan/hints/truetype_instruction_analyzer.rb +261 -0
  29. data/lib/fontisan/hints/truetype_instruction_generator.rb +266 -0
  30. data/lib/fontisan/loading_modes.rb +4 -4
  31. data/lib/fontisan/models/collection_brief_info.rb +31 -0
  32. data/lib/fontisan/models/font_export.rb +2 -2
  33. data/lib/fontisan/models/font_info.rb +3 -30
  34. data/lib/fontisan/models/hint.rb +22 -23
  35. data/lib/fontisan/models/outline.rb +4 -1
  36. data/lib/fontisan/models/validation_report.rb +1 -1
  37. data/lib/fontisan/open_type_font.rb +3 -1
  38. data/lib/fontisan/optimizers/pattern_analyzer.rb +2 -1
  39. data/lib/fontisan/optimizers/subroutine_generator.rb +1 -1
  40. data/lib/fontisan/pipeline/output_writer.rb +8 -3
  41. data/lib/fontisan/pipeline/transformation_pipeline.rb +8 -3
  42. data/lib/fontisan/subset/table_subsetter.rb +5 -5
  43. data/lib/fontisan/tables/cff/charstring.rb +38 -12
  44. data/lib/fontisan/tables/cff/charstring_parser.rb +23 -11
  45. data/lib/fontisan/tables/cff/charstring_rebuilder.rb +14 -14
  46. data/lib/fontisan/tables/cff/dict_builder.rb +4 -1
  47. data/lib/fontisan/tables/cff/hint_operation_injector.rb +6 -4
  48. data/lib/fontisan/tables/cff/offset_recalculator.rb +1 -1
  49. data/lib/fontisan/tables/cff/private_dict_writer.rb +10 -4
  50. data/lib/fontisan/tables/cff/table_builder.rb +1 -1
  51. data/lib/fontisan/tables/cff2/charstring_parser.rb +14 -8
  52. data/lib/fontisan/tables/cff2/private_dict_blend_handler.rb +7 -6
  53. data/lib/fontisan/tables/cff2/region_matcher.rb +2 -2
  54. data/lib/fontisan/tables/cff2/table_builder.rb +26 -20
  55. data/lib/fontisan/tables/cff2/table_reader.rb +35 -33
  56. data/lib/fontisan/tables/cff2/variation_data_extractor.rb +2 -2
  57. data/lib/fontisan/tables/cff2.rb +1 -1
  58. data/lib/fontisan/tables/glyf/compound_glyph_resolver.rb +2 -1
  59. data/lib/fontisan/tables/glyf/curve_converter.rb +10 -4
  60. data/lib/fontisan/tables/glyf/glyph_builder.rb +27 -10
  61. data/lib/fontisan/tables/name.rb +4 -4
  62. data/lib/fontisan/true_type_font.rb +3 -1
  63. data/lib/fontisan/validation/checksum_validator.rb +2 -2
  64. data/lib/fontisan/variation/cache.rb +3 -1
  65. data/lib/fontisan/variation/converter.rb +2 -1
  66. data/lib/fontisan/variation/delta_applier.rb +2 -1
  67. data/lib/fontisan/variation/inspector.rb +2 -1
  68. data/lib/fontisan/variation/instance_generator.rb +2 -1
  69. data/lib/fontisan/variation/optimizer.rb +6 -3
  70. data/lib/fontisan/variation/subsetter.rb +32 -10
  71. data/lib/fontisan/variation/variation_preserver.rb +4 -1
  72. data/lib/fontisan/version.rb +1 -1
  73. data/lib/fontisan/woff2/glyf_transformer.rb +57 -30
  74. data/lib/fontisan/woff2_font.rb +31 -15
  75. data/lib/fontisan.rb +42 -2
  76. data/scripts/measure_optimization.rb +15 -7
  77. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9de9818bb2be7f1b285a3c4de6cad790e85ad9a3fbc93e071db4a5ebb9e0484
4
- data.tar.gz: 7a74658520d8d82736bba2d0545bb35ea0521517af13d19a2b4fdd7a20be1c2f
3
+ metadata.gz: f52b19a1d943c0e079127e9699e517b6832a30d46bab88454ae8471a398886d2
4
+ data.tar.gz: 8395db7eef4bb2bed2169a08f54208e5119209f3336dcf17bf6d27b602e7fd5f
5
5
  SHA512:
6
- metadata.gz: 2a7a1edaa7ad3ba1bee76993a1de5908d797fbbf81ff5c7a6677986affa42e5850980a9c91dea79d6d57cb4dcfc08495bc6ce2724b8f84508fc28172c8be9d71
7
- data.tar.gz: dab485966b284673379b69388ac36ffd7413e54b7655f8bd21aedc33e285e6265f8c690e25e32edf04866dd446697506def9bfaeaa3958a7707e00b32b692645
6
+ metadata.gz: 65003981ab35b7ff61c6f7524e9552278cfff918f0bbbfeb9a28271042e91033aa4623f8f301b66e1b6a171bea423ae30c644c32b4d111ce10a1d8bd6a82b61e
7
+ data.tar.gz: 7ff760af226e26a619cce271e505c92c8c6a3f21e6ec9c3c6582571e8944352ae7ff6be448c9236e11c5f6f023550f492716db5945980ac0607eaee700c9318e
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-29 12:26:25 UTC using RuboCop version 1.81.7.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -12,157 +12,41 @@ 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'
32
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
94
33
 
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'
113
-
114
- # Offense count: 1303
34
+ # Offense count: 1101
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
41
  # Offense count: 1
150
42
  # 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
43
  # Configuration parameters: EnforcedStyle.
161
44
  # SupportedStyles: final_newline, final_blank_line
162
45
  Layout/TrailingEmptyLines:
163
- Enabled: false
46
+ Exclude:
47
+ - 'spec/fontisan_spec.rb'
164
48
 
165
- # Offense count: 29
49
+ # Offense count: 26
166
50
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
167
51
  Lint/DuplicateBranch:
168
52
  Enabled: false
@@ -173,12 +57,6 @@ Lint/DuplicateMethods:
173
57
  - 'lib/fontisan/tables/glyf.rb'
174
58
  - 'lib/fontisan/woff2_font.rb'
175
59
 
176
- # Offense count: 2
177
- # This cop supports unsafe autocorrection (--autocorrect-all).
178
- Lint/DuplicateRequire:
179
- Exclude:
180
- - 'lib/fontisan.rb'
181
-
182
60
  # Offense count: 2
183
61
  # This cop supports safe autocorrection (--autocorrect).
184
62
  # Configuration parameters: AllowComments.
@@ -204,87 +82,55 @@ Lint/MissingSuper:
204
82
  Exclude:
205
83
  - 'lib/fontisan/tables/cff2/table_builder.rb'
206
84
 
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
85
  # Offense count: 1
217
86
  Lint/StructNewOverride:
218
87
  Exclude:
219
88
  - 'lib/fontisan/optimizers/pattern_analyzer.rb'
220
89
 
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
90
+ # Offense count: 5
233
91
  # This cop supports safe autocorrection (--autocorrect).
234
92
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
235
93
  # NotImplementedExceptions: NotImplementedError
236
94
  Lint/UnusedMethodArgument:
237
95
  Exclude:
238
- - 'lib/fontisan/commands/instance_command.rb'
239
- - 'lib/fontisan/converters/outline_converter.rb'
240
96
  - 'lib/fontisan/font_loader.rb'
241
- - 'lib/fontisan/hints/hint_converter.rb'
242
- - 'lib/fontisan/tables/cff2/charstring_parser.rb'
243
97
  - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
244
98
  - 'lib/fontisan/utilities/brotli_wrapper.rb'
245
99
  - 'lib/fontisan/variation/table_accessor.rb'
246
100
  - 'lib/fontisan/woff2/glyf_transformer.rb'
247
101
 
248
- # Offense count: 16
102
+ # Offense count: 3
249
103
  # This cop supports safe autocorrection (--autocorrect).
250
104
  Lint/UselessAssignment:
251
105
  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'
106
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
107
+ - 'spec/fontisan/hints/hint_round_trip_spec.rb'
262
108
 
263
- # Offense count: 423
109
+ # Offense count: 431
264
110
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
265
111
  Metrics/AbcSize:
266
112
  Enabled: false
267
113
 
268
- # Offense count: 26
114
+ # Offense count: 27
269
115
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
270
116
  # AllowedMethods: refine
271
117
  Metrics/BlockLength:
272
- Max: 81
118
+ Max: 80
273
119
 
274
- # Offense count: 4
120
+ # Offense count: 8
275
121
  # Configuration parameters: CountBlocks, CountModifierForms.
276
122
  Metrics/BlockNesting:
277
123
  Max: 5
278
124
 
279
- # Offense count: 213
125
+ # Offense count: 220
280
126
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
281
127
  Metrics/CyclomaticComplexity:
282
128
  Enabled: false
283
129
 
284
- # Offense count: 630
130
+ # Offense count: 648
285
131
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
286
132
  Metrics/MethodLength:
287
- Max: 136
133
+ Max: 135
288
134
 
289
135
  # Offense count: 17
290
136
  # Configuration parameters: CountKeywordArgs.
@@ -292,7 +138,7 @@ Metrics/ParameterLists:
292
138
  Max: 39
293
139
  MaxOptionalParameters: 4
294
140
 
295
- # Offense count: 150
141
+ # Offense count: 154
296
142
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
297
143
  Metrics/PerceivedComplexity:
298
144
  Enabled: false
@@ -346,48 +192,30 @@ Performance/CollectionLiteralInLoop:
346
192
  - 'spec/fontisan/commands/info_command_spec.rb'
347
193
  - 'spec/fontisan/commands/tables_command_spec.rb'
348
194
 
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
195
  # Offense count: 1
356
196
  # 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
- # This cop supports unsafe autocorrection (--autocorrect-all).
364
197
  Performance/TimesMap:
365
198
  Exclude:
366
- - 'benchmark/variation_quick_bench.rb'
367
199
  - '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
200
 
374
- # Offense count: 23
201
+ # Offense count: 24
375
202
  RSpec/AnyInstance:
376
203
  Exclude:
377
204
  - 'spec/fontisan/converters/format_converter_spec.rb'
205
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
378
206
  - 'spec/fontisan/validation/validator_spec.rb'
379
207
  - 'spec/fontisan/variation/delta_applier_spec.rb'
380
208
  - 'spec/fontisan/variation/instance_writer_spec.rb'
381
209
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
382
210
  - 'spec/integration/format_conversion_spec.rb'
383
211
 
384
- # Offense count: 94
212
+ # Offense count: 100
385
213
  # Configuration parameters: Prefixes, AllowedPatterns.
386
214
  # Prefixes: when, with, without
387
215
  RSpec/ContextWording:
388
216
  Enabled: false
389
217
 
390
- # Offense count: 16
218
+ # Offense count: 17
391
219
  # Configuration parameters: IgnoredMetadata.
392
220
  RSpec/DescribeClass:
393
221
  Enabled: false
@@ -397,7 +225,7 @@ RSpec/DescribeMethod:
397
225
  Exclude:
398
226
  - 'spec/fontisan/collection/variable_font_builder_spec.rb'
399
227
 
400
- # Offense count: 1108
228
+ # Offense count: 1152
401
229
  # Configuration parameters: CountAsOne.
402
230
  RSpec/ExampleLength:
403
231
  Max: 66
@@ -444,13 +272,6 @@ RSpec/IteratedExpectation:
444
272
  Exclude:
445
273
  - 'spec/fontisan/tables/glyf_spec.rb'
446
274
 
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
275
  # Offense count: 19
455
276
  # Configuration parameters: EnforcedStyle.
456
277
  # SupportedStyles: have_received, receive
@@ -474,7 +295,7 @@ RSpec/MultipleDescribes:
474
295
  - 'spec/fontisan/utils/thread_pool_spec.rb'
475
296
  - 'spec/fontisan/variation/cache_spec.rb'
476
297
 
477
- # Offense count: 1414
298
+ # Offense count: 1488
478
299
  RSpec/MultipleExpectations:
479
300
  Max: 22
480
301
 
@@ -488,34 +309,23 @@ RSpec/MultipleMemoizedHelpers:
488
309
  RSpec/NestedGroups:
489
310
  Max: 4
490
311
 
491
- # Offense count: 8
312
+ # Offense count: 10
492
313
  # Configuration parameters: AllowedPatterns.
493
314
  # AllowedPatterns: ^expect_, ^assert_
494
315
  RSpec/NoExpectationExample:
495
316
  Exclude:
496
317
  - 'spec/benchmarks/subroutine_optimization_benchmark.rb'
318
+ - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
497
319
  - 'spec/fontisan/variation/variable_svg_generator_spec.rb'
498
320
 
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
321
+ # Offense count: 11
513
322
  RSpec/RepeatedExample:
514
323
  Exclude:
324
+ - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
515
325
  - 'spec/fontisan/metrics_calculator_spec.rb'
516
326
  - 'spec/fontisan/tables/os2_spec.rb'
517
327
 
518
- # Offense count: 12
328
+ # Offense count: 14
519
329
  # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
520
330
  # SupportedInflectors: default, active_support
521
331
  RSpec/SpecFilePathFormat:
@@ -526,6 +336,8 @@ RSpec/SpecFilePathFormat:
526
336
  - 'spec/fontisan/hints/postscript_hint_extractor_spec.rb'
527
337
  - 'spec/fontisan/hints/truetype_hint_applier_spec.rb'
528
338
  - 'spec/fontisan/hints/truetype_hint_extractor_spec.rb'
339
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
340
+ - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
529
341
  - 'spec/fontisan/tables/cff/charstring_builder_spec.rb'
530
342
  - 'spec/fontisan/tables/cff/charstring_parser_spec.rb'
531
343
  - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
@@ -570,15 +382,7 @@ Security/Open:
570
382
  Exclude:
571
383
  - 'Rakefile'
572
384
 
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
385
+ # Offense count: 3
582
386
  # This cop supports safe autocorrection (--autocorrect).
583
387
  # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
584
388
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
@@ -587,45 +391,22 @@ Style/AccessorGrouping:
587
391
  # AllowedMethods: lambda, proc, it
588
392
  Style/BlockDelimiters:
589
393
  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'
394
+ - 'spec/fontisan/hints/hint_validator_spec.rb'
395
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
597
396
 
598
- # Offense count: 4
397
+ # Offense count: 1
599
398
  # This cop supports unsafe autocorrection (--autocorrect-all).
600
399
  Style/CombinableLoops:
601
400
  Exclude:
602
- - 'lib/fontisan/collection/offset_calculator.rb'
603
- - 'lib/fontisan/font_writer.rb'
604
- - 'lib/fontisan/tables/cff/hint_operation_injector.rb'
605
401
  - 'lib/fontisan/woff2_font.rb'
606
402
 
607
- # Offense count: 4
403
+ # Offense count: 1
608
404
  # This cop supports safe autocorrection (--autocorrect).
609
405
  # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
610
406
  # SupportedStyles: assign_to_condition, assign_inside_condition
611
407
  Style/ConditionalAssignment:
612
408
  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'
409
+ - 'lib/fontisan/formatters/text_formatter.rb'
629
410
 
630
411
  # Offense count: 17
631
412
  # This cop supports safe autocorrection (--autocorrect).
@@ -653,49 +434,7 @@ Style/HashLikeCase:
653
434
  - 'lib/fontisan/commands/unpack_command.rb'
654
435
  - 'lib/fontisan/models/validation_report.rb'
655
436
 
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
437
+ # Offense count: 4
699
438
  # This cop supports unsafe autocorrection (--autocorrect-all).
700
439
  # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
701
440
  # SupportedStyles: predicate, comparison
@@ -703,29 +442,10 @@ Style/NumericPredicate:
703
442
  Exclude:
704
443
  - 'spec/**/*'
705
444
  - 'lib/fontisan/hints/hint_converter.rb'
445
+ - 'lib/fontisan/hints/hint_validator.rb'
446
+ - 'lib/fontisan/hints/truetype_instruction_analyzer.rb'
706
447
  - 'lib/fontisan/tables/cff2/private_dict_blend_handler.rb'
707
448
 
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
449
  # Offense count: 10
730
450
  # This cop supports unsafe autocorrection (--autocorrect-all).
731
451
  # Configuration parameters: SafeForConstants.
@@ -733,85 +453,37 @@ Style/RedundantFetchBlock:
733
453
  Exclude:
734
454
  - 'spec/fontisan/variation/cache_spec.rb'
735
455
 
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
456
+ # Offense count: 1
743
457
  # 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
750
- # This cop supports unsafe autocorrection (--autocorrect-all).
751
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
752
- # AllowedMethods: present?, blank?, presence, try, try!
753
- Style/SafeNavigation:
458
+ # Configuration parameters: AllowModifier.
459
+ Style/SoleNestedConditional:
754
460
  Exclude:
755
- - 'Rakefile'
756
- - 'lib/fontisan/subset/table_subsetter.rb'
757
- - 'lib/fontisan/tables/cff2/table_builder.rb'
758
- - 'lib/fontisan/woff2_font.rb'
461
+ - 'lib/fontisan/hints/hint_validator.rb'
759
462
 
760
463
  # 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
464
  # This cop supports safe autocorrection (--autocorrect).
783
465
  # Configuration parameters: .
784
466
  # SupportedStyles: percent, brackets
785
467
  Style/SymbolArray:
786
468
  EnforcedStyle: percent
787
- MinSize: 14
469
+ MinSize: 3
788
470
 
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
471
+ # Offense count: 3
797
472
  # This cop supports safe autocorrection (--autocorrect).
798
473
  # Configuration parameters: EnforcedStyleForMultiline.
799
474
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
800
475
  Style/TrailingCommaInArrayLiteral:
801
- Enabled: false
476
+ Exclude:
477
+ - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
478
+ - 'spec/fontisan/variation/parallel_generator_spec.rb'
802
479
 
803
- # Offense count: 77
480
+ # Offense count: 1
804
481
  # This cop supports safe autocorrection (--autocorrect).
805
482
  # Configuration parameters: EnforcedStyleForMultiline.
806
483
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
807
484
  Style/TrailingCommaInHashLiteral:
808
- Enabled: false
809
-
810
- # Offense count: 1
811
- # This cop supports safe autocorrection (--autocorrect).
812
- Style/UnlessElse:
813
485
  Exclude:
814
- - 'lib/fontisan/woff2/glyf_transformer.rb'
486
+ - 'lib/fontisan/hints/truetype_instruction_generator.rb'
815
487
 
816
488
  # Offense count: 1
817
489
  # This cop supports unsafe autocorrection (--autocorrect-all).