fontisan 0.2.11 → 0.2.13

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +294 -52
  3. data/Gemfile +5 -0
  4. data/README.adoc +163 -2
  5. data/docs/CONVERSION_GUIDE.adoc +633 -0
  6. data/docs/TYPE1_FONTS.adoc +445 -0
  7. data/lib/fontisan/cli.rb +177 -6
  8. data/lib/fontisan/commands/convert_command.rb +32 -1
  9. data/lib/fontisan/commands/info_command.rb +83 -2
  10. data/lib/fontisan/config/conversion_matrix.yml +132 -4
  11. data/lib/fontisan/constants.rb +12 -0
  12. data/lib/fontisan/conversion_options.rb +378 -0
  13. data/lib/fontisan/converters/collection_converter.rb +45 -10
  14. data/lib/fontisan/converters/format_converter.rb +17 -5
  15. data/lib/fontisan/converters/outline_converter.rb +78 -4
  16. data/lib/fontisan/converters/type1_converter.rb +1234 -0
  17. data/lib/fontisan/font_loader.rb +46 -3
  18. data/lib/fontisan/hints/hint_converter.rb +4 -1
  19. data/lib/fontisan/type1/afm_generator.rb +436 -0
  20. data/lib/fontisan/type1/afm_parser.rb +298 -0
  21. data/lib/fontisan/type1/agl.rb +456 -0
  22. data/lib/fontisan/type1/cff_to_type1_converter.rb +302 -0
  23. data/lib/fontisan/type1/charstring_converter.rb +240 -0
  24. data/lib/fontisan/type1/charstrings.rb +408 -0
  25. data/lib/fontisan/type1/conversion_options.rb +243 -0
  26. data/lib/fontisan/type1/decryptor.rb +183 -0
  27. data/lib/fontisan/type1/encodings.rb +697 -0
  28. data/lib/fontisan/type1/font_dictionary.rb +576 -0
  29. data/lib/fontisan/type1/generator.rb +220 -0
  30. data/lib/fontisan/type1/inf_generator.rb +332 -0
  31. data/lib/fontisan/type1/pfa_generator.rb +369 -0
  32. data/lib/fontisan/type1/pfa_parser.rb +159 -0
  33. data/lib/fontisan/type1/pfb_generator.rb +314 -0
  34. data/lib/fontisan/type1/pfb_parser.rb +166 -0
  35. data/lib/fontisan/type1/pfm_generator.rb +610 -0
  36. data/lib/fontisan/type1/pfm_parser.rb +433 -0
  37. data/lib/fontisan/type1/private_dict.rb +342 -0
  38. data/lib/fontisan/type1/seac_expander.rb +501 -0
  39. data/lib/fontisan/type1/ttf_to_type1_converter.rb +327 -0
  40. data/lib/fontisan/type1/upm_scaler.rb +118 -0
  41. data/lib/fontisan/type1.rb +75 -0
  42. data/lib/fontisan/type1_font.rb +318 -0
  43. data/lib/fontisan/version.rb +1 -1
  44. data/lib/fontisan.rb +2 -0
  45. metadata +30 -3
  46. data/docs/DOCUMENTATION_SUMMARY.md +0 -141
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5afdba14f32dbf6e482d0f17c64afdcc5dbe62b0567f59e42287234757ec1c3
4
- data.tar.gz: 6bdf19ae13494e1599dbb523bab6e6b7179ac288ac4d65d26b3cefb1e749878b
3
+ metadata.gz: 368b69c9050597188840f118f60dcb46247feae93ffe7e53c1954991d790ab95
4
+ data.tar.gz: 4c3e591c4a180734430a099a07036c2888ec7da62f5ccb39d33440b9a2b2346b
5
5
  SHA512:
6
- metadata.gz: e4e5fe71fe99f4edef0432684799419d4bcd634bffd879b804955a3777728a50828797210766e8cd3c2141cbbd7b0a23adb8feef0f8046557548be3d77ff5bbb
7
- data.tar.gz: 287c2f971e1c439de9d1465dbd244247ba65ad57fe2babecb873632429b9f04a935b569e9a1660ab47201e0b4604dac6947642b14b5dc28f353abc97a04c8661
6
+ metadata.gz: 73e614a107d14632d9fa25b1e0605503e3e5d7642230f9acc1a0ebe93a6262f7947b95e73a7c7aa5a5a0f0ec0b56fb34d8e148b7c59c57c30a4690795c280a22
7
+ data.tar.gz: 6b1144b3f402d2c374c5fc4b16918c66751a603a7a4af15a63b9df36c3f7a617a0ce7ca1e6774fb40c55174e52f7f588c23831655f31c0b722281f15f2ba6179
data/.rubocop_todo.yml CHANGED
@@ -1,23 +1,103 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-01-17 10:49:34 UTC using RuboCop version 1.82.1.
3
+ # on 2026-01-21 09:04:34 UTC using RuboCop version 1.82.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 1
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
12
+ Bundler/OrderedGems:
13
+ Exclude:
14
+ - 'Gemfile'
15
+
9
16
  # Offense count: 1
10
17
  Gemspec/RequiredRubyVersion:
11
18
  Exclude:
12
19
  - 'fontisan.gemspec'
13
20
 
14
- # Offense count: 1261
21
+ # Offense count: 2
22
+ # This cop supports safe autocorrection (--autocorrect).
23
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
24
+ # SupportedStyles: with_first_argument, with_fixed_indentation
25
+ Layout/ArgumentAlignment:
26
+ Exclude:
27
+ - 'lib/fontisan/type1/cff_to_type1_converter.rb'
28
+ - 'spec/performance/type1_performance_spec.rb'
29
+
30
+ # Offense count: 2
31
+ # This cop supports safe autocorrection (--autocorrect).
32
+ Layout/ElseAlignment:
33
+ Exclude:
34
+ - 'lib/fontisan/commands/info_command.rb'
35
+ - 'lib/fontisan/converters/type1_converter.rb'
36
+
37
+ # Offense count: 1
38
+ # This cop supports safe autocorrection (--autocorrect).
39
+ Layout/EmptyLineAfterGuardClause:
40
+ Exclude:
41
+ - 'spec/validation/type1_validation_spec.rb'
42
+
43
+ # Offense count: 2
44
+ # This cop supports safe autocorrection (--autocorrect).
45
+ # Configuration parameters: EnforcedStyleAlignWith.
46
+ # SupportedStylesAlignWith: keyword, variable, start_of_line
47
+ Layout/EndAlignment:
48
+ Exclude:
49
+ - 'lib/fontisan/commands/info_command.rb'
50
+ - 'lib/fontisan/converters/type1_converter.rb'
51
+
52
+ # Offense count: 63
53
+ # This cop supports safe autocorrection (--autocorrect).
54
+ # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
55
+ Layout/ExtraSpacing:
56
+ Exclude:
57
+ - 'lib/fontisan/commands/info_command.rb'
58
+ - 'lib/fontisan/converters/type1_converter.rb'
59
+ - 'lib/fontisan/type1/cff_to_type1_converter.rb'
60
+ - 'lib/fontisan/type1/seac_expander.rb'
61
+ - 'spec/fontisan/converters/type1_converter_spec.rb'
62
+ - 'spec/fontisan/type1/cff_to_type1_converter_spec.rb'
63
+ - 'spec/fontisan/type1/seac_expander_spec.rb'
64
+
65
+ # Offense count: 24
66
+ # This cop supports safe autocorrection (--autocorrect).
67
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
68
+ # SupportedStyles: special_inside_parentheses, consistent, align_braces
69
+ Layout/FirstHashElementIndentation:
70
+ Exclude:
71
+ - 'spec/fontisan/converters/type1_converter_spec.rb'
72
+ - 'spec/fontisan/type1/seac_expander_spec.rb'
73
+ - 'spec/integration/type1_conversion_spec.rb'
74
+ - 'spec/validation/type1_validation_spec.rb'
75
+
76
+ # Offense count: 2
77
+ # This cop supports safe autocorrection (--autocorrect).
78
+ # Configuration parameters: Width, AllowedPatterns.
79
+ Layout/IndentationWidth:
80
+ Exclude:
81
+ - 'lib/fontisan/commands/info_command.rb'
82
+ - 'lib/fontisan/converters/type1_converter.rb'
83
+
84
+ # Offense count: 1596
15
85
  # This cop supports safe autocorrection (--autocorrect).
16
86
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
17
87
  # URISchemes: http, https
18
88
  Layout/LineLength:
19
89
  Enabled: false
20
90
 
91
+ # Offense count: 2
92
+ # This cop supports safe autocorrection (--autocorrect).
93
+ # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
94
+ # SupportedStylesForExponentOperator: space, no_space
95
+ # SupportedStylesForRationalLiterals: space, no_space
96
+ Layout/SpaceAroundOperators:
97
+ Exclude:
98
+ - 'lib/fontisan/converters/type1_converter.rb'
99
+ - 'spec/validation/type1_validation_spec.rb'
100
+
21
101
  # Offense count: 3
22
102
  Lint/CopDirectiveSyntax:
23
103
  Exclude:
@@ -25,7 +105,7 @@ Lint/CopDirectiveSyntax:
25
105
  - 'lib/fontisan/woff2_font.rb'
26
106
  - 'spec/fontisan/variation/cache_spec.rb'
27
107
 
28
- # Offense count: 27
108
+ # Offense count: 49
29
109
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
30
110
  Lint/DuplicateBranch:
31
111
  Enabled: false
@@ -58,16 +138,13 @@ Lint/FloatComparison:
58
138
  Exclude:
59
139
  - 'lib/fontisan/tables/post.rb'
60
140
 
61
- # Offense count: 2
62
- Lint/HashCompareByIdentity:
63
- Exclude:
64
- - 'lib/fontisan/collection/table_analyzer.rb'
65
-
66
- # Offense count: 3
141
+ # Offense count: 6
67
142
  Lint/IneffectiveAccessModifier:
68
143
  Exclude:
144
+ - 'lib/fontisan/conversion_options.rb'
69
145
  - 'lib/fontisan/models/outline.rb'
70
146
  - 'lib/fontisan/models/ttx/tables/binary_table.rb'
147
+ - 'lib/fontisan/type1/generator.rb'
71
148
 
72
149
  # Offense count: 2
73
150
  # Configuration parameters: AllowedParentClasses.
@@ -76,6 +153,17 @@ Lint/MissingSuper:
76
153
  - 'lib/fontisan/commands/validate_command.rb'
77
154
  - 'lib/fontisan/tables/cff2/table_builder.rb'
78
155
 
156
+ # Offense count: 9
157
+ # This cop supports unsafe autocorrection (--autocorrect-all).
158
+ # Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods.
159
+ # AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
160
+ # AdditionalNilMethods: present?, blank?, try, try!
161
+ Lint/RedundantSafeNavigation:
162
+ Exclude:
163
+ - 'lib/fontisan/converters/type1_converter.rb'
164
+ - 'lib/fontisan/type1/cff_to_type1_converter.rb'
165
+ - 'spec/fontisan/converters/type1_property_spec.rb'
166
+
79
167
  # Offense count: 1
80
168
  Lint/StructNewOverride:
81
169
  Exclude:
@@ -95,50 +183,64 @@ Lint/UnusedMethodArgument:
95
183
  - 'lib/fontisan/woff2/glyf_transformer.rb'
96
184
  - 'lib/fontisan/woff_font.rb'
97
185
 
98
- # Offense count: 2
186
+ # Offense count: 5
99
187
  # This cop supports safe autocorrection (--autocorrect).
100
188
  Lint/UselessAssignment:
101
189
  Exclude:
102
- - 'lib/fontisan/converters/cff_table_builder.rb'
190
+ - 'lib/fontisan/type1/seac_expander.rb'
191
+ - 'spec/performance/type1_performance_spec.rb'
192
+
193
+ # Offense count: 5
194
+ Lint/UselessConstantScoping:
195
+ Exclude:
196
+ - 'lib/fontisan/conversion_options.rb'
197
+ - 'lib/fontisan/type1/charstrings.rb'
103
198
 
104
- # Offense count: 480
199
+ # Offense count: 552
105
200
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
106
201
  Metrics/AbcSize:
107
202
  Enabled: false
108
203
 
109
- # Offense count: 30
204
+ # Offense count: 33
110
205
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
111
206
  # AllowedMethods: refine
112
207
  Metrics/BlockLength:
113
- Max: 80
208
+ Max: 101
114
209
 
115
210
  # Offense count: 8
116
211
  # Configuration parameters: CountBlocks, CountModifierForms.
117
212
  Metrics/BlockNesting:
118
213
  Max: 5
119
214
 
120
- # Offense count: 239
215
+ # Offense count: 2
216
+ # Configuration parameters: LengthThreshold.
217
+ Metrics/CollectionLiteralLength:
218
+ Exclude:
219
+ - 'lib/fontisan/type1/agl.rb'
220
+ - 'lib/fontisan/type1/encodings.rb'
221
+
222
+ # Offense count: 301
121
223
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
122
224
  Metrics/CyclomaticComplexity:
123
225
  Enabled: false
124
226
 
125
- # Offense count: 788
227
+ # Offense count: 905
126
228
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
127
229
  Metrics/MethodLength:
128
230
  Max: 135
129
231
 
130
- # Offense count: 21
232
+ # Offense count: 22
131
233
  # Configuration parameters: CountKeywordArgs.
132
234
  Metrics/ParameterLists:
133
235
  Max: 39
134
236
  MaxOptionalParameters: 4
135
237
 
136
- # Offense count: 176
238
+ # Offense count: 229
137
239
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
138
240
  Metrics/PerceivedComplexity:
139
241
  Enabled: false
140
242
 
141
- # Offense count: 17
243
+ # Offense count: 24
142
244
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
143
245
  # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
144
246
  Naming/MethodParameterName:
@@ -146,9 +248,11 @@ Naming/MethodParameterName:
146
248
  - 'lib/fontisan/optimizers/subroutine_optimizer.rb'
147
249
  - 'lib/fontisan/tables/cff2/blend_operator.rb'
148
250
  - 'lib/fontisan/tables/glyf/curve_converter.rb'
251
+ - 'lib/fontisan/type1/seac_expander.rb'
252
+ - 'lib/fontisan/type1/ttf_to_type1_converter.rb'
149
253
  - 'lib/fontisan/variation/optimizer.rb'
150
254
 
151
- # Offense count: 12
255
+ # Offense count: 13
152
256
  # Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
153
257
  # AllowedMethods: call
154
258
  # WaywardPredicates: nonzero?
@@ -158,6 +262,7 @@ Naming/PredicateMethod:
158
262
  - 'lib/fontisan/converters/outline_converter.rb'
159
263
  - 'lib/fontisan/converters/svg_generator.rb'
160
264
  - 'lib/fontisan/converters/table_copier.rb'
265
+ - 'lib/fontisan/converters/type1_converter.rb'
161
266
  - 'lib/fontisan/converters/woff2_encoder.rb'
162
267
  - 'lib/fontisan/optimizers/charstring_rewriter.rb'
163
268
  - 'lib/fontisan/sfnt_table.rb'
@@ -165,7 +270,26 @@ Naming/PredicateMethod:
165
270
  - 'lib/fontisan/validation/collection_validator.rb'
166
271
  - 'lib/fontisan/variation/metrics_adjuster.rb'
167
272
 
168
- # Offense count: 87
273
+ # Offense count: 1
274
+ # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
275
+ # NamePrefix: is_, has_, have_, does_
276
+ # ForbiddenPrefixes: is_, has_, have_, does_
277
+ # AllowedMethods: is_a?
278
+ # MethodDefinitionMacros: define_method, define_singleton_method
279
+ Naming/PredicatePrefix:
280
+ Exclude:
281
+ - '../../../.cache/rubocop_cache/spec/**/*'
282
+ - 'lib/fontisan/type1/afm_generator.rb'
283
+
284
+ # Offense count: 21
285
+ # Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns.
286
+ # SupportedStyles: snake_case, camelCase
287
+ Naming/VariableName:
288
+ Exclude:
289
+ - 'lib/fontisan/type1/pfm_generator.rb'
290
+ - 'lib/fontisan/type1/pfm_parser.rb'
291
+
292
+ # Offense count: 113
169
293
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
170
294
  # SupportedStyles: snake_case, normalcase, non_integer
171
295
  # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
@@ -182,29 +306,40 @@ RSpec/AnyInstance:
182
306
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
183
307
  - 'spec/integration/format_conversion_spec.rb'
184
308
 
185
- # Offense count: 106
309
+ # Offense count: 1
310
+ # This cop supports unsafe autocorrection (--autocorrect-all).
311
+ RSpec/BeEq:
312
+ Exclude:
313
+ - 'spec/fontisan/converters/type1_property_spec.rb'
314
+
315
+ # Offense count: 127
186
316
  # Configuration parameters: Prefixes, AllowedPatterns.
187
317
  # Prefixes: when, with, without
188
318
  RSpec/ContextWording:
189
319
  Enabled: false
190
320
 
191
- # Offense count: 23
321
+ # Offense count: 27
192
322
  # Configuration parameters: IgnoredMetadata.
193
323
  RSpec/DescribeClass:
194
324
  Enabled: false
195
325
 
196
- # Offense count: 2
326
+ # Offense count: 7
197
327
  RSpec/DescribeMethod:
198
328
  Exclude:
199
329
  - 'spec/fontisan/collection/variable_font_builder_spec.rb'
200
330
  - 'spec/fontisan/converters/woff2_encoder_integration_spec.rb'
331
+ - 'spec/fontisan/type1/afm_parser_spec.rb'
332
+ - 'spec/fontisan/type1/cff_to_type1_converter_spec.rb'
333
+ - 'spec/fontisan/type1/pfm_parser_spec.rb'
334
+ - 'spec/fontisan/type1/seac_expander_spec.rb'
335
+ - 'spec/fontisan/type1_real_fonts_spec.rb'
201
336
 
202
- # Offense count: 1288
337
+ # Offense count: 1426
203
338
  # Configuration parameters: CountAsOne.
204
339
  RSpec/ExampleLength:
205
340
  Max: 66
206
341
 
207
- # Offense count: 8
342
+ # Offense count: 9
208
343
  # This cop supports safe autocorrection (--autocorrect).
209
344
  RSpec/ExpectActual:
210
345
  Exclude:
@@ -213,6 +348,7 @@ RSpec/ExpectActual:
213
348
  - 'spec/fontisan/converters/extended_woff2_spec.rb'
214
349
  - 'spec/fontisan/converters/woff2_round_trip_spec.rb'
215
350
  - 'spec/fontisan/subset/builder_spec.rb'
351
+ - 'spec/fontisan/type1_real_fonts_spec.rb'
216
352
  - 'spec/fontisan/utils/thread_pool_spec.rb'
217
353
  - 'spec/fontisan/validators/basic_validator_spec.rb'
218
354
  - 'spec/fontisan/variation/validator_spec.rb'
@@ -250,7 +386,13 @@ RSpec/IteratedExpectation:
250
386
  Exclude:
251
387
  - 'spec/fontisan/tables/glyf_spec.rb'
252
388
 
253
- # Offense count: 19
389
+ # Offense count: 1
390
+ # This cop supports safe autocorrection (--autocorrect).
391
+ RSpec/LeadingSubject:
392
+ Exclude:
393
+ - 'spec/fontisan/type1/seac_expander_spec.rb'
394
+
395
+ # Offense count: 25
254
396
  # Configuration parameters: EnforcedStyle.
255
397
  # SupportedStyles: have_received, receive
256
398
  RSpec/MessageSpies:
@@ -259,6 +401,8 @@ RSpec/MessageSpies:
259
401
  - 'spec/fontisan/collection/variable_font_builder_spec.rb'
260
402
  - 'spec/fontisan/commands/pack_command_spec.rb'
261
403
  - 'spec/fontisan/commands/unpack_command_spec.rb'
404
+ - 'spec/fontisan/converters/outline_converter_spec.rb'
405
+ - 'spec/fontisan/converters/type1_converter_spec.rb'
262
406
  - 'spec/fontisan/glyph_accessor_spec.rb'
263
407
  - 'spec/fontisan/metrics_calculator_spec.rb'
264
408
  - 'spec/fontisan/subset/builder_spec.rb'
@@ -273,11 +417,11 @@ RSpec/MultipleDescribes:
273
417
  - 'spec/fontisan/utils/thread_pool_spec.rb'
274
418
  - 'spec/fontisan/variation/cache_spec.rb'
275
419
 
276
- # Offense count: 1699
420
+ # Offense count: 1852
277
421
  RSpec/MultipleExpectations:
278
422
  Max: 19
279
423
 
280
- # Offense count: 150
424
+ # Offense count: 152
281
425
  # Configuration parameters: AllowSubject.
282
426
  RSpec/MultipleMemoizedHelpers:
283
427
  Max: 13
@@ -297,6 +441,16 @@ RSpec/NoExpectationExample:
297
441
  - 'spec/fontisan/validators/validator_spec.rb'
298
442
  - 'spec/fontisan/variation/variable_svg_generator_spec.rb'
299
443
 
444
+ # Offense count: 415
445
+ # This cop supports unsafe autocorrection (--autocorrect-all).
446
+ RSpec/ReceiveMessages:
447
+ Exclude:
448
+ - 'spec/fontisan/converters/type1_converter_spec.rb'
449
+ - 'spec/fontisan/converters/type1_property_spec.rb'
450
+ - 'spec/integration/type1_conversion_spec.rb'
451
+ - 'spec/performance/type1_performance_spec.rb'
452
+ - 'spec/validation/type1_validation_spec.rb'
453
+
300
454
  # Offense count: 13
301
455
  RSpec/RepeatedExample:
302
456
  Exclude:
@@ -305,27 +459,11 @@ RSpec/RepeatedExample:
305
459
  - 'spec/fontisan/metrics_calculator_spec.rb'
306
460
  - 'spec/fontisan/tables/os2_spec.rb'
307
461
 
308
- # Offense count: 15
462
+ # Offense count: 22
309
463
  # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
310
464
  # SupportedInflectors: default, active_support
311
465
  RSpec/SpecFilePathFormat:
312
- Exclude:
313
- - '**/spec/routing/**/*'
314
- - 'spec/fontisan/collection/variable_font_builder_spec.rb'
315
- - 'spec/fontisan/hints/postscript_hint_applier_spec.rb'
316
- - 'spec/fontisan/hints/postscript_hint_extractor_spec.rb'
317
- - 'spec/fontisan/hints/truetype_hint_applier_spec.rb'
318
- - 'spec/fontisan/hints/truetype_hint_extractor_spec.rb'
319
- - 'spec/fontisan/hints/truetype_instruction_analyzer_spec.rb'
320
- - 'spec/fontisan/hints/truetype_instruction_generator_spec.rb'
321
- - 'spec/fontisan/tables/cff/charstring_builder_spec.rb'
322
- - 'spec/fontisan/tables/cff/charstring_parser_spec.rb'
323
- - 'spec/fontisan/tables/cff/charstring_rebuilder_spec.rb'
324
- - 'spec/fontisan/tables/cff/charstring_spec.rb'
325
- - 'spec/fontisan/tables/glyf/curve_converter_spec.rb'
326
- - 'spec/fontisan/tables/glyf/glyph_builder_spec.rb'
327
- - 'spec/fontisan/validators/opentype_validator_spec.rb'
328
- - 'spec/fontisan/woff2/header_spec.rb'
466
+ Enabled: false
329
467
 
330
468
  # Offense count: 1
331
469
  RSpec/SpecFilePathSuffix:
@@ -342,7 +480,7 @@ RSpec/SubjectStub:
342
480
  Exclude:
343
481
  - 'spec/fontisan/variation/delta_applier_spec.rb'
344
482
 
345
- # Offense count: 291
483
+ # Offense count: 427
346
484
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
347
485
  RSpec/VerifiedDoubles:
348
486
  Enabled: false
@@ -357,14 +495,42 @@ Security/Open:
357
495
  Exclude:
358
496
  - 'Rakefile'
359
497
 
360
- # Offense count: 4
498
+ # Offense count: 2
499
+ # This cop supports safe autocorrection (--autocorrect).
500
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
501
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
502
+ # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
503
+ # FunctionalMethods: let, let!, subject, watch
504
+ # AllowedMethods: lambda, proc, it
505
+ Style/BlockDelimiters:
506
+ Exclude:
507
+ - 'spec/fontisan/type1/seac_expander_spec.rb'
508
+
509
+ # Offense count: 6
361
510
  # This cop supports safe autocorrection (--autocorrect).
362
511
  Style/ComparableClamp:
363
512
  Exclude:
364
513
  - 'lib/fontisan/tables/cff2/blend_operator.rb'
514
+ - 'lib/fontisan/type1/pfm_generator.rb'
365
515
  - 'lib/fontisan/variable/axis_normalizer.rb'
366
516
  - 'lib/fontisan/variation/interpolator.rb'
367
517
 
518
+ # Offense count: 4
519
+ # This cop supports safe autocorrection (--autocorrect).
520
+ # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
521
+ # SupportedStyles: assign_to_condition, assign_inside_condition
522
+ Style/ConditionalAssignment:
523
+ Exclude:
524
+ - 'lib/fontisan/converters/type1_converter.rb'
525
+
526
+ # Offense count: 2
527
+ # This cop supports safe autocorrection (--autocorrect).
528
+ # Configuration parameters: EnforcedStyle, AllowComments.
529
+ # SupportedStyles: empty, nil, both
530
+ Style/EmptyElse:
531
+ Exclude:
532
+ - 'lib/fontisan/type1/seac_expander.rb'
533
+
368
534
  # Offense count: 11
369
535
  # This cop supports safe autocorrection (--autocorrect).
370
536
  # Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
@@ -374,6 +540,12 @@ Style/FormatStringToken:
374
540
  - 'lib/fontisan/formatters/text_formatter.rb'
375
541
  - 'scripts/measure_optimization.rb'
376
542
 
543
+ # Offense count: 1
544
+ # This cop supports unsafe autocorrection (--autocorrect-all).
545
+ Style/HashExcept:
546
+ Exclude:
547
+ - 'lib/fontisan/hints/hint_converter.rb'
548
+
377
549
  # Offense count: 3
378
550
  # Configuration parameters: MinBranchesCount.
379
551
  Style/HashLikeCase:
@@ -382,9 +554,79 @@ Style/HashLikeCase:
382
554
  - 'lib/fontisan/commands/unpack_command.rb'
383
555
  - 'lib/fontisan/models/validation_report.rb'
384
556
 
557
+ # Offense count: 4
558
+ # This cop supports unsafe autocorrection (--autocorrect-all).
559
+ # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
560
+ # SupportedStyles: predicate, comparison
561
+ Style/NumericPredicate:
562
+ Exclude:
563
+ - 'spec/**/*'
564
+ - 'lib/fontisan/type1/cff_to_type1_converter.rb'
565
+ - 'lib/fontisan/type1/seac_expander.rb'
566
+
385
567
  # Offense count: 1
568
+ # Configuration parameters: AllowedMethods.
569
+ # AllowedMethods: respond_to_missing?
570
+ Style/OptionalBooleanParameter:
571
+ Exclude:
572
+ - 'lib/fontisan/conversion_options.rb'
573
+
574
+ # Offense count: 1
575
+ # This cop supports safe autocorrection (--autocorrect).
576
+ Style/ParallelAssignment:
577
+ Exclude:
578
+ - 'lib/fontisan/type1/cff_to_type1_converter.rb'
579
+
580
+ # Offense count: 2
581
+ # This cop supports unsafe autocorrection (--autocorrect-all).
582
+ # Configuration parameters: Methods.
583
+ Style/RedundantArgument:
584
+ Exclude:
585
+ - 'lib/fontisan/type1/cff_to_type1_converter.rb'
586
+
587
+ # Offense count: 1
588
+ # This cop supports safe autocorrection (--autocorrect).
589
+ Style/RedundantParentheses:
590
+ Exclude:
591
+ - 'lib/fontisan/converters/type1_converter.rb'
592
+
593
+ # Offense count: 1
594
+ # This cop supports safe autocorrection (--autocorrect).
595
+ # Configuration parameters: AllowModifier.
596
+ Style/SoleNestedConditional:
597
+ Exclude:
598
+ - 'lib/fontisan/converters/type1_converter.rb'
599
+
600
+ # Offense count: 1
601
+ # This cop supports safe autocorrection (--autocorrect).
602
+ # Configuration parameters: EnforcedStyle, AllowSafeAssignment.
603
+ # SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
604
+ Style/TernaryParentheses:
605
+ Exclude:
606
+ - 'lib/fontisan/converters/type1_converter.rb'
607
+
608
+ # Offense count: 2
609
+ # This cop supports safe autocorrection (--autocorrect).
610
+ # Configuration parameters: EnforcedStyleForMultiline.
611
+ # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
612
+ Style/TrailingCommaInArguments:
613
+ Exclude:
614
+ - 'lib/fontisan/converters/type1_converter.rb'
615
+
616
+ # Offense count: 4
617
+ # This cop supports safe autocorrection (--autocorrect).
618
+ # Configuration parameters: EnforcedStyleForMultiline.
619
+ # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
620
+ Style/TrailingCommaInArrayLiteral:
621
+ Exclude:
622
+ - 'spec/fontisan/converters/type1_property_spec.rb'
623
+ - 'spec/fontisan/type1/seac_expander_spec.rb'
624
+
625
+ # Offense count: 8
386
626
  # This cop supports safe autocorrection (--autocorrect).
387
- # Configuration parameters: AllowNamedUnderscoreVariables.
388
- Style/TrailingUnderscoreVariable:
627
+ # Configuration parameters: EnforcedStyleForMultiline.
628
+ # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
629
+ Style/TrailingCommaInHashLiteral:
389
630
  Exclude:
390
- - 'lib/fontisan/converters/cff_table_builder.rb'
631
+ - 'lib/fontisan/type1/seac_expander.rb'
632
+ - 'spec/fontisan/type1/seac_expander_spec.rb'
data/Gemfile CHANGED
@@ -6,7 +6,12 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "canon", "~> 0.1.3"
9
+ gem "get_process_mem", "~> 0.2"
10
+ # bigdecimal is required by get_process_mem for Ruby 3.4+ compatibility
11
+ gem "bigdecimal"
9
12
  gem "openssl", "~> 3.0"
13
+ # sys-proctable is required by get_process_mem on Windows
14
+ gem "sys-proctable", platforms: %i[mswin mingw mswin64]
10
15
  gem "rake"
11
16
  gem "rspec"
12
17
  gem "rubocop"