fontisan 0.2.12 → 0.2.14

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b67e8e2428844b9c61766fffe36934694f4572373b1bd3ab1cfbe3348aa5d9f2
4
- data.tar.gz: 4f80609efc6ce157565a60f813f6f95f1ccd6e04636c58d93dba07ebcb6d6a16
3
+ metadata.gz: f8d495575ec4d2504df2181032e5ac8908f503772b1e82171e60e3ffbbd9039a
4
+ data.tar.gz: 80bb603d185b5a96ad53dad56fb2a2b2ab170175ccfb7f924ce8a216bd2eddf9
5
5
  SHA512:
6
- metadata.gz: 5c3e35aaf576698dca9937305b4e422fe89e6f5dc3427ab5f54bdf12f72785fe6eb05649d850077d9fa7133e42ca9cd20eae0c4fa2c60911b9576cad92d5fe55
7
- data.tar.gz: f9debe8c4d0706012a37abc30b30c35bc6508523d7946d270824f0a61f650ed2596c52b666589464004182950ccf3083972e520f1767c698c2c337da269e201d
6
+ metadata.gz: 8c189ad3392f6acfc15a4bda354785d5310a859c9e282606cbbde57b3b187420f0739ad593f03e703f5f537dd8dcc148114e114b2e437cc5b77891d7fcf7a856
7
+ data.tar.gz: 67de3c882d2399a3118aa40d1f0d05c101c77c93ebe0005959fd9ed16fe2d6854a81085337d1b99d74f125771982fa8b340a106163d9e8e4e2e48956e2ff48ea
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-01-19 14:07:09 UTC using RuboCop version 1.82.1.
3
+ # on 2026-02-05 04:16:45 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
@@ -11,107 +11,13 @@ Gemspec/RequiredRubyVersion:
11
11
  Exclude:
12
12
  - 'fontisan.gemspec'
13
13
 
14
- # Offense count: 10
15
- # This cop supports safe autocorrection (--autocorrect).
16
- # Configuration parameters: EnforcedStyle, IndentationWidth.
17
- # SupportedStyles: with_first_argument, with_fixed_indentation
18
- Layout/ArgumentAlignment:
19
- Exclude:
20
- - 'lib/fontisan/cli.rb'
21
- - 'spec/fontisan/converters/type1_converter_spec.rb'
22
-
23
- # Offense count: 3
24
- # This cop supports safe autocorrection (--autocorrect).
25
- # Configuration parameters: EnforcedStyleAlignWith.
26
- # SupportedStylesAlignWith: either, start_of_block, start_of_line
27
- Layout/BlockAlignment:
28
- Exclude:
29
- - 'spec/fontisan/converters/collection_converter_spec.rb'
30
-
31
- # Offense count: 1
32
- # This cop supports safe autocorrection (--autocorrect).
33
- Layout/BlockEndNewline:
34
- Exclude:
35
- - 'spec/fontisan/converters/collection_converter_spec.rb'
36
-
37
- # Offense count: 2
38
- # This cop supports safe autocorrection (--autocorrect).
39
- Layout/ClosingParenthesisIndentation:
40
- Exclude:
41
- - 'spec/fontisan/type1/pfm_parser_spec.rb'
42
-
43
- # Offense count: 4
44
- # This cop supports safe autocorrection (--autocorrect).
45
- # Configuration parameters: AllowForAlignment.
46
- Layout/CommentIndentation:
47
- Exclude:
48
- - 'spec/fontisan/converters/collection_converter_spec.rb'
49
-
50
- # Offense count: 2
51
- # This cop supports safe autocorrection (--autocorrect).
52
- # Configuration parameters: EnforcedStyle, IndentationWidth.
53
- # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
54
- Layout/FirstArgumentIndentation:
55
- Exclude:
56
- - 'spec/fontisan/type1/pfm_parser_spec.rb'
57
-
58
- # Offense count: 10
59
- # This cop supports safe autocorrection (--autocorrect).
60
- # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
61
- # SupportedHashRocketStyles: key, separator, table
62
- # SupportedColonStyles: key, separator, table
63
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
64
- Layout/HashAlignment:
65
- Exclude:
66
- - 'lib/fontisan/cli.rb'
67
- - 'spec/fontisan/commands/convert_command_spec.rb'
68
- - 'spec/fontisan/converters/type1_converter_spec.rb'
69
-
70
- # Offense count: 2
71
- # This cop supports safe autocorrection (--autocorrect).
72
- # Configuration parameters: EnforcedStyle.
73
- # SupportedStyles: normal, indented_internal_methods
74
- Layout/IndentationConsistency:
75
- Exclude:
76
- - 'spec/fontisan/converters/collection_converter_spec.rb'
77
-
78
- # Offense count: 4
79
- # This cop supports safe autocorrection (--autocorrect).
80
- # Configuration parameters: Width, AllowedPatterns.
81
- Layout/IndentationWidth:
82
- Exclude:
83
- - 'spec/fontisan/converters/collection_converter_spec.rb'
84
-
85
- # Offense count: 1437
14
+ # Offense count: 1585
86
15
  # This cop supports safe autocorrection (--autocorrect).
87
16
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
88
17
  # URISchemes: http, https
89
18
  Layout/LineLength:
90
19
  Enabled: false
91
20
 
92
- # Offense count: 2
93
- # This cop supports safe autocorrection (--autocorrect).
94
- # Configuration parameters: EnforcedStyle.
95
- # SupportedStyles: symmetrical, new_line, same_line
96
- Layout/MultilineMethodCallBraceLayout:
97
- Exclude:
98
- - 'spec/fontisan/type1/pfm_parser_spec.rb'
99
-
100
- # Offense count: 1
101
- # This cop supports safe autocorrection (--autocorrect).
102
- # Configuration parameters: EnforcedStyle.
103
- # SupportedStyles: final_newline, final_blank_line
104
- Layout/TrailingEmptyLines:
105
- Exclude:
106
- - 'spec/fontisan/converters/type1_converter_spec.rb'
107
-
108
- # Offense count: 4
109
- # This cop supports safe autocorrection (--autocorrect).
110
- # Configuration parameters: AllowInHeredoc.
111
- Layout/TrailingWhitespace:
112
- Exclude:
113
- - 'spec/fontisan/converters/type1_converter_spec.rb'
114
-
115
21
  # Offense count: 3
116
22
  Lint/CopDirectiveSyntax:
117
23
  Exclude:
@@ -119,16 +25,15 @@ Lint/CopDirectiveSyntax:
119
25
  - 'lib/fontisan/woff2_font.rb'
120
26
  - 'spec/fontisan/variation/cache_spec.rb'
121
27
 
122
- # Offense count: 34
28
+ # Offense count: 49
123
29
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
124
30
  Lint/DuplicateBranch:
125
31
  Enabled: false
126
32
 
127
- # Offense count: 6
33
+ # Offense count: 2
128
34
  Lint/DuplicateMethods:
129
35
  Exclude:
130
36
  - 'lib/fontisan/tables/glyf.rb'
131
- - 'lib/fontisan/type1_font.rb'
132
37
  - 'lib/fontisan/woff2_font.rb'
133
38
 
134
39
  # Offense count: 1
@@ -173,13 +78,6 @@ Lint/StructNewOverride:
173
78
  Exclude:
174
79
  - 'lib/fontisan/optimizers/pattern_analyzer.rb'
175
80
 
176
- # Offense count: 2
177
- # This cop supports safe autocorrection (--autocorrect).
178
- # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
179
- Lint/UnusedBlockArgument:
180
- Exclude:
181
- - 'spec/fontisan/converters/type1_converter_spec.rb'
182
-
183
81
  # Offense count: 8
184
82
  # This cop supports safe autocorrection (--autocorrect).
185
83
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
@@ -200,16 +98,16 @@ Lint/UselessConstantScoping:
200
98
  - 'lib/fontisan/conversion_options.rb'
201
99
  - 'lib/fontisan/type1/charstrings.rb'
202
100
 
203
- # Offense count: 527
101
+ # Offense count: 549
204
102
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
205
103
  Metrics/AbcSize:
206
104
  Enabled: false
207
105
 
208
- # Offense count: 30
106
+ # Offense count: 33
209
107
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
210
108
  # AllowedMethods: refine
211
109
  Metrics/BlockLength:
212
- Max: 80
110
+ Max: 104
213
111
 
214
112
  # Offense count: 8
215
113
  # Configuration parameters: CountBlocks, CountModifierForms.
@@ -223,12 +121,12 @@ Metrics/CollectionLiteralLength:
223
121
  - 'lib/fontisan/type1/agl.rb'
224
122
  - 'lib/fontisan/type1/encodings.rb'
225
123
 
226
- # Offense count: 283
124
+ # Offense count: 301
227
125
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
228
126
  Metrics/CyclomaticComplexity:
229
127
  Enabled: false
230
128
 
231
- # Offense count: 874
129
+ # Offense count: 902
232
130
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
233
131
  Metrics/MethodLength:
234
132
  Max: 135
@@ -239,12 +137,12 @@ Metrics/ParameterLists:
239
137
  Max: 39
240
138
  MaxOptionalParameters: 4
241
139
 
242
- # Offense count: 214
140
+ # Offense count: 229
243
141
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
244
142
  Metrics/PerceivedComplexity:
245
143
  Enabled: false
246
144
 
247
- # Offense count: 20
145
+ # Offense count: 24
248
146
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
249
147
  # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
250
148
  Naming/MethodParameterName:
@@ -252,6 +150,7 @@ Naming/MethodParameterName:
252
150
  - 'lib/fontisan/optimizers/subroutine_optimizer.rb'
253
151
  - 'lib/fontisan/tables/cff2/blend_operator.rb'
254
152
  - 'lib/fontisan/tables/glyf/curve_converter.rb'
153
+ - 'lib/fontisan/type1/seac_expander.rb'
255
154
  - 'lib/fontisan/type1/ttf_to_type1_converter.rb'
256
155
  - 'lib/fontisan/variation/optimizer.rb'
257
156
 
@@ -292,7 +191,7 @@ Naming/VariableName:
292
191
  - 'lib/fontisan/type1/pfm_generator.rb'
293
192
  - 'lib/fontisan/type1/pfm_parser.rb'
294
193
 
295
- # Offense count: 112
194
+ # Offense count: 113
296
195
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
297
196
  # SupportedStyles: snake_case, normalcase, non_integer
298
197
  # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
@@ -309,27 +208,29 @@ RSpec/AnyInstance:
309
208
  - 'spec/fontisan/variation/parallel_generator_spec.rb'
310
209
  - 'spec/integration/format_conversion_spec.rb'
311
210
 
312
- # Offense count: 113
211
+ # Offense count: 128
313
212
  # Configuration parameters: Prefixes, AllowedPatterns.
314
213
  # Prefixes: when, with, without
315
214
  RSpec/ContextWording:
316
215
  Enabled: false
317
216
 
318
- # Offense count: 23
217
+ # Offense count: 27
319
218
  # Configuration parameters: IgnoredMetadata.
320
219
  RSpec/DescribeClass:
321
220
  Enabled: false
322
221
 
323
- # Offense count: 5
222
+ # Offense count: 7
324
223
  RSpec/DescribeMethod:
325
224
  Exclude:
326
225
  - 'spec/fontisan/collection/variable_font_builder_spec.rb'
327
226
  - 'spec/fontisan/converters/woff2_encoder_integration_spec.rb'
328
227
  - 'spec/fontisan/type1/afm_parser_spec.rb'
228
+ - 'spec/fontisan/type1/cff_to_type1_converter_spec.rb'
329
229
  - 'spec/fontisan/type1/pfm_parser_spec.rb'
230
+ - 'spec/fontisan/type1/seac_expander_spec.rb'
330
231
  - 'spec/fontisan/type1_real_fonts_spec.rb'
331
232
 
332
- # Offense count: 1370
233
+ # Offense count: 1428
333
234
  # Configuration parameters: CountAsOne.
334
235
  RSpec/ExampleLength:
335
236
  Max: 66
@@ -406,11 +307,11 @@ RSpec/MultipleDescribes:
406
307
  - 'spec/fontisan/utils/thread_pool_spec.rb'
407
308
  - 'spec/fontisan/variation/cache_spec.rb'
408
309
 
409
- # Offense count: 1793
310
+ # Offense count: 1855
410
311
  RSpec/MultipleExpectations:
411
312
  Max: 19
412
313
 
413
- # Offense count: 150
314
+ # Offense count: 152
414
315
  # Configuration parameters: AllowSubject.
415
316
  RSpec/MultipleMemoizedHelpers:
416
317
  Max: 13
@@ -430,12 +331,6 @@ RSpec/NoExpectationExample:
430
331
  - 'spec/fontisan/validators/validator_spec.rb'
431
332
  - 'spec/fontisan/variation/variable_svg_generator_spec.rb'
432
333
 
433
- # Offense count: 7
434
- # This cop supports unsafe autocorrection (--autocorrect-all).
435
- RSpec/ReceiveMessages:
436
- Exclude:
437
- - 'spec/fontisan/converters/type1_converter_spec.rb'
438
-
439
334
  # Offense count: 13
440
335
  RSpec/RepeatedExample:
441
336
  Exclude:
@@ -444,15 +339,7 @@ RSpec/RepeatedExample:
444
339
  - 'spec/fontisan/metrics_calculator_spec.rb'
445
340
  - 'spec/fontisan/tables/os2_spec.rb'
446
341
 
447
- # Offense count: 2
448
- # This cop supports safe autocorrection (--autocorrect).
449
- # Configuration parameters: EnforcedStyle.
450
- # SupportedStyles: and_return, block
451
- RSpec/ReturnFromStub:
452
- Exclude:
453
- - 'spec/fontisan/converters/type1_converter_spec.rb'
454
-
455
- # Offense count: 20
342
+ # Offense count: 22
456
343
  # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
457
344
  # SupportedInflectors: default, active_support
458
345
  RSpec/SpecFilePathFormat:
@@ -473,7 +360,7 @@ RSpec/SubjectStub:
473
360
  Exclude:
474
361
  - 'spec/fontisan/variation/delta_applier_spec.rb'
475
362
 
476
- # Offense count: 294
363
+ # Offense count: 427
477
364
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
478
365
  RSpec/VerifiedDoubles:
479
366
  Enabled: false
@@ -488,19 +375,6 @@ Security/Open:
488
375
  Exclude:
489
376
  - 'Rakefile'
490
377
 
491
- # Offense count: 11
492
- # This cop supports safe autocorrection (--autocorrect).
493
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
494
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
495
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
496
- # FunctionalMethods: let, let!, subject, watch
497
- # AllowedMethods: lambda, proc, it
498
- Style/BlockDelimiters:
499
- Exclude:
500
- - 'spec/fontisan/converters/collection_converter_spec.rb'
501
- - 'spec/fontisan/converters/outline_converter_spec.rb'
502
- - 'spec/fontisan/converters/type1_converter_spec.rb'
503
-
504
378
  # Offense count: 6
505
379
  # This cop supports safe autocorrection (--autocorrect).
506
380
  Style/ComparableClamp:
@@ -510,6 +384,14 @@ Style/ComparableClamp:
510
384
  - 'lib/fontisan/variable/axis_normalizer.rb'
511
385
  - 'lib/fontisan/variation/interpolator.rb'
512
386
 
387
+ # Offense count: 2
388
+ # This cop supports safe autocorrection (--autocorrect).
389
+ # Configuration parameters: EnforcedStyle, AllowComments.
390
+ # SupportedStyles: empty, nil, both
391
+ Style/EmptyElse:
392
+ Exclude:
393
+ - 'lib/fontisan/type1/seac_expander.rb'
394
+
513
395
  # Offense count: 11
514
396
  # This cop supports safe autocorrection (--autocorrect).
515
397
  # Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
@@ -533,21 +415,3 @@ Style/HashLikeCase:
533
415
  Style/OptionalBooleanParameter:
534
416
  Exclude:
535
417
  - 'lib/fontisan/conversion_options.rb'
536
-
537
- # Offense count: 7
538
- # This cop supports safe autocorrection (--autocorrect).
539
- # Configuration parameters: EnforcedStyleForMultiline.
540
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
541
- Style/TrailingCommaInArguments:
542
- Exclude:
543
- - 'spec/fontisan/commands/convert_command_spec.rb'
544
- - 'spec/fontisan/converters/outline_converter_spec.rb'
545
- - 'spec/fontisan/converters/type1_converter_spec.rb'
546
-
547
- # Offense count: 2
548
- # This cop supports safe autocorrection (--autocorrect).
549
- # Configuration parameters: EnforcedStyleForMultiline.
550
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
551
- Style/TrailingCommaInHashLiteral:
552
- Exclude:
553
- - 'spec/fontisan/converters/collection_converter_spec.rb'
data/Gemfile CHANGED
@@ -6,7 +6,11 @@ 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
10
14
  gem "rake"
11
15
  gem "rspec"
12
16
  gem "rubocop"
@@ -14,3 +18,4 @@ gem "rubocop-performance"
14
18
  gem "rubocop-rake"
15
19
  gem "rubocop-rspec"
16
20
  gem "rubyzip"
21
+ gem "sys-proctable", platforms: %i[mswin mingw mswin64]
data/README.adoc CHANGED
@@ -9,8 +9,8 @@ image:https://github.com/fontist/fontisan/actions/workflows/test.yml/badge.svg[B
9
9
  Fontisan is a Ruby gem providing font analysis tools and utilities.
10
10
 
11
11
  It is designed as a pure Ruby implementation with full object-oriented
12
- architecture, supporting extraction of information from OpenType and TrueType
13
- fonts (OTF, TTF, OTC, TTC, dfont).
12
+ architecture, supporting extraction of information from OpenType, TrueType,
13
+ and Adobe Type 1 fonts (OTF, TTF, OTC, TTC, dfont, PFB, PFA).
14
14
 
15
15
  The gem provides both a Ruby library API and a command-line interface, with
16
16
  structured output formats (YAML, JSON, text) via lutaml-model.
@@ -81,6 +81,7 @@ Font operations::
81
81
 
82
82
  Font format support::
83
83
  * TTF, OTF, TTC, OTC font formats (production ready)
84
+ * Adobe Type 1 fonts (PFB/PFA) with bidirectional conversion (see link:docs/TYPE1_FONTS.adoc[Type 1 Fonts Guide])
84
85
  * WOFF/WOFF2 format support with reading, writing, and conversion (see link:docs/WOFF_WOFF2_FORMATS.adoc[WOFF/WOFF2 Guide])
85
86
  * Apple legacy font support: 'true' signature TrueType fonts and dfont format (see link:docs/APPLE_LEGACY_FONTS.adoc[Apple Legacy Fonts Guide])
86
87
  * SVG font generation (complete)