fontisan 0.2.6 → 0.2.8
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 +4 -4
- data/.rubocop.yml +103 -0
- data/.rubocop_todo.yml +107 -318
- data/Gemfile +1 -1
- data/README.adoc +127 -17
- data/Rakefile +12 -7
- data/benchmark/variation_quick_bench.rb +1 -1
- data/lib/fontisan/base_collection.rb +5 -33
- data/lib/fontisan/cli.rb +45 -13
- data/lib/fontisan/collection/dfont_builder.rb +2 -1
- data/lib/fontisan/collection/shared_logic.rb +54 -0
- data/lib/fontisan/commands/convert_command.rb +2 -4
- data/lib/fontisan/commands/info_command.rb +3 -3
- data/lib/fontisan/commands/pack_command.rb +2 -1
- data/lib/fontisan/commands/validate_command.rb +157 -6
- data/lib/fontisan/converters/collection_converter.rb +22 -13
- data/lib/fontisan/converters/svg_generator.rb +2 -1
- data/lib/fontisan/converters/woff2_encoder.rb +6 -6
- data/lib/fontisan/converters/woff_writer.rb +3 -1
- data/lib/fontisan/dfont_collection.rb +84 -0
- data/lib/fontisan/font_loader.rb +9 -9
- data/lib/fontisan/formatters/text_formatter.rb +18 -14
- data/lib/fontisan/hints/hint_converter.rb +1 -1
- data/lib/fontisan/hints/hint_validator.rb +13 -10
- data/lib/fontisan/hints/truetype_instruction_analyzer.rb +15 -8
- data/lib/fontisan/hints/truetype_instruction_generator.rb +1 -1
- data/lib/fontisan/models/collection_validation_report.rb +104 -0
- data/lib/fontisan/models/font_report.rb +24 -0
- data/lib/fontisan/models/validation_report.rb +7 -2
- data/lib/fontisan/open_type_font.rb +2 -3
- data/lib/fontisan/optimizers/charstring_rewriter.rb +1 -1
- data/lib/fontisan/optimizers/subroutine_optimizer.rb +6 -2
- data/lib/fontisan/subset/glyph_mapping.rb +2 -0
- data/lib/fontisan/subset/table_subsetter.rb +2 -2
- data/lib/fontisan/tables/cblc.rb +8 -4
- data/lib/fontisan/tables/cff/index.rb +2 -0
- data/lib/fontisan/tables/cff.rb +6 -3
- data/lib/fontisan/tables/cff2/private_dict_blend_handler.rb +1 -1
- data/lib/fontisan/tables/cff2.rb +1 -1
- data/lib/fontisan/tables/cmap.rb +5 -5
- data/lib/fontisan/tables/glyf.rb +8 -10
- data/lib/fontisan/tables/head.rb +3 -3
- data/lib/fontisan/tables/hhea.rb +4 -4
- data/lib/fontisan/tables/maxp.rb +2 -2
- data/lib/fontisan/tables/name.rb +1 -1
- data/lib/fontisan/tables/os2.rb +8 -8
- data/lib/fontisan/tables/post.rb +2 -2
- data/lib/fontisan/tables/sbix.rb +5 -4
- data/lib/fontisan/true_type_font.rb +2 -3
- data/lib/fontisan/utilities/checksum_calculator.rb +0 -44
- data/lib/fontisan/validation/collection_validator.rb +4 -2
- data/lib/fontisan/validators/basic_validator.rb +11 -21
- data/lib/fontisan/validators/font_book_validator.rb +29 -50
- data/lib/fontisan/validators/opentype_validator.rb +24 -28
- data/lib/fontisan/validators/validator.rb +87 -66
- data/lib/fontisan/validators/web_font_validator.rb +16 -21
- data/lib/fontisan/version.rb +1 -1
- data/lib/fontisan/woff2/glyf_transformer.rb +31 -8
- data/lib/fontisan/woff2/hmtx_transformer.rb +2 -1
- data/lib/fontisan/woff2/table_transformer.rb +4 -2
- data/lib/fontisan/woff2_font.rb +4 -2
- data/lib/fontisan/woff_font.rb +2 -2
- data/lib/fontisan.rb +2 -2
- data/scripts/compare_stack_aware.rb +1 -1
- data/scripts/measure_optimization.rb +1 -2
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9f774cfee2477366d97b8954c481262eedd928b1c5abae59f559e570aafb294
|
|
4
|
+
data.tar.gz: 0f744a6ba709c5e2c6eb0e81e33ec41d4cbe78d0beb6bd3519b395568257d37c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 59e98be337dc89d359cdb4d7a8a80749d2b89a2d82dda2280550ccd834143f9191752cdc083179907d01f2d3a87695b9a6758b2ad3d910b4a4af79e919479767
|
|
7
|
+
data.tar.gz: 5913d2f154cbf0961436ac7e85dad4d2f8d64ac4a52d1c9709014a33ed112eaf1a9f3a931a0b7f62e469eba0bd5e87589fe677c0e36c8971f042c850b0abe412
|
data/.rubocop.yml
CHANGED
|
@@ -7,7 +7,110 @@ inherit_from:
|
|
|
7
7
|
# local repo-specific modifications
|
|
8
8
|
# ...
|
|
9
9
|
|
|
10
|
+
AllCops:
|
|
11
|
+
NewCops: enable
|
|
12
|
+
|
|
10
13
|
plugins:
|
|
11
14
|
- rubocop-performance
|
|
12
15
|
- rubocop-rake
|
|
13
16
|
- rubocop-rspec
|
|
17
|
+
|
|
18
|
+
# Prevent combining loops in WOFF2 SFNT building - the two loops must remain separate
|
|
19
|
+
# to maintain correct SFNT structure (all directory entries first, then all data)
|
|
20
|
+
Style/CombinableLoops:
|
|
21
|
+
Exclude:
|
|
22
|
+
- 'lib/fontisan/woff2_font.rb'
|
|
23
|
+
|
|
24
|
+
# Disable Performance/Size - Index class doesn't have Enumerable methods
|
|
25
|
+
# .count > 0 and .count.zero? are the appropriate checks
|
|
26
|
+
Performance/Size:
|
|
27
|
+
Enabled: false
|
|
28
|
+
|
|
29
|
+
# Disable Style/CollectionQuerying - Using .count.zero? is clearer than .none?
|
|
30
|
+
# for Index classes, and .count > 0 is clearer than .any?
|
|
31
|
+
Style/CollectionQuerying:
|
|
32
|
+
Enabled: false
|
|
33
|
+
|
|
34
|
+
# Disable Style/MapIntoArray - Using .each is sometimes clearer than .map
|
|
35
|
+
# especially when building arrays with complex transformations
|
|
36
|
+
Style/MapIntoArray:
|
|
37
|
+
Enabled: false
|
|
38
|
+
|
|
39
|
+
# Disable Style/HashSlice - Using .select is clearer than .slice for filtering
|
|
40
|
+
# especially when the filter logic is complex
|
|
41
|
+
Style/HashSlice:
|
|
42
|
+
Enabled: false
|
|
43
|
+
|
|
44
|
+
# Disable Performance/CollectionLiteralInLoop - Array literals in loops are fine
|
|
45
|
+
# when they're small (3 elements) and self-documenting
|
|
46
|
+
Performance/CollectionLiteralInLoop:
|
|
47
|
+
Enabled: false
|
|
48
|
+
|
|
49
|
+
# Disable Style/SelfAssignment - Self-assignment branches are needed
|
|
50
|
+
# for signed/unsigned conversion patterns (e.g., x = x >= 0x8000 ? x - 0x10000 : x)
|
|
51
|
+
Style/SelfAssignment:
|
|
52
|
+
Enabled: false
|
|
53
|
+
|
|
54
|
+
# Disable Style/RedundantSelfAssignmentBranch - Self-assignment branches are needed
|
|
55
|
+
# for signed/unsigned conversion patterns in font data parsing
|
|
56
|
+
Style/RedundantSelfAssignmentBranch:
|
|
57
|
+
Enabled: false
|
|
58
|
+
|
|
59
|
+
# Disable Lint/AmbiguousOperatorPrecedence - Expressions are clear enough
|
|
60
|
+
# Adding parentheses would reduce readability for arithmetic operations
|
|
61
|
+
Lint/AmbiguousOperatorPrecedence:
|
|
62
|
+
Enabled: false
|
|
63
|
+
|
|
64
|
+
# Disable Lint/AmbiguousRange - Ranges are clear enough without parentheses
|
|
65
|
+
Lint/AmbiguousRange:
|
|
66
|
+
Enabled: false
|
|
67
|
+
|
|
68
|
+
# Disable Style/ReturnNilInPredicateMethodDefinition - Returning nil is sometimes
|
|
69
|
+
# more appropriate than false for predicate methods that check bounds/index validity
|
|
70
|
+
Style/ReturnNilInPredicateMethodDefinition:
|
|
71
|
+
Enabled: false
|
|
72
|
+
|
|
73
|
+
# Disable Style/ComparableBetween - Using >= and <= is clearer than .between?
|
|
74
|
+
# for numeric comparisons, especially with signed/unsigned conversions
|
|
75
|
+
Style/ComparableBetween:
|
|
76
|
+
Enabled: false
|
|
77
|
+
|
|
78
|
+
# Disable Performance/MapCompact - Using .map {}.compact is clearer than filter_map
|
|
79
|
+
# when the block has complex logic
|
|
80
|
+
Performance/MapCompact:
|
|
81
|
+
Enabled: false
|
|
82
|
+
|
|
83
|
+
# Disable Style/SelectByRegexp - Using .select { |k| k.match?(pattern) } is clearer
|
|
84
|
+
# than grep for complex regex patterns
|
|
85
|
+
Style/SelectByRegexp:
|
|
86
|
+
Enabled: false
|
|
87
|
+
|
|
88
|
+
# Disable Style/FetchEnvVar - Using ENV[] is clearer than ENV.fetch
|
|
89
|
+
# when we want nil to be returned for unset environment variables
|
|
90
|
+
Style/FetchEnvVar:
|
|
91
|
+
Enabled: false
|
|
92
|
+
|
|
93
|
+
# Disable Lint/NonAtomicFileOperation - Existence checks before Dir.mkdir_p
|
|
94
|
+
# are useful for clarity and to avoid spurious failures
|
|
95
|
+
Lint/NonAtomicFileOperation:
|
|
96
|
+
Enabled: false
|
|
97
|
+
|
|
98
|
+
# Disable Style/RedundantInitialize - Initialize calls can be useful
|
|
99
|
+
# for clarity and to ensure parent initialization happens correctly
|
|
100
|
+
Style/RedundantInitialize:
|
|
101
|
+
Enabled: false
|
|
102
|
+
|
|
103
|
+
# Disable Style/SuperArguments - Explicit super arguments are clearer
|
|
104
|
+
# than implicit, especially when the signature might change
|
|
105
|
+
Style/SuperArguments:
|
|
106
|
+
Enabled: false
|
|
107
|
+
|
|
108
|
+
# Disable Layout/LineEndStringConcatenationIndentation - String concatenation
|
|
109
|
+
# indentation is fine as-is for readability
|
|
110
|
+
Layout/LineEndStringConcatenationIndentation:
|
|
111
|
+
Enabled: false
|
|
112
|
+
|
|
113
|
+
# Disable Style/BitwisePredicate - anybits?/nobits?/allbits? require Ruby 3.3+
|
|
114
|
+
# Bitwise AND checks with != 0 are clearer for font bitmasks
|
|
115
|
+
Style/BitwisePredicate:
|
|
116
|
+
Enabled: false
|