fontisan 0.2.12 → 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.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +185 -106
- data/Gemfile +5 -0
- data/README.adoc +3 -2
- data/docs/CONVERSION_GUIDE.adoc +633 -0
- data/docs/TYPE1_FONTS.adoc +445 -0
- data/lib/fontisan/commands/info_command.rb +83 -2
- data/lib/fontisan/converters/format_converter.rb +15 -5
- data/lib/fontisan/converters/type1_converter.rb +734 -59
- data/lib/fontisan/font_loader.rb +1 -1
- data/lib/fontisan/hints/hint_converter.rb +4 -1
- data/lib/fontisan/type1/cff_to_type1_converter.rb +302 -0
- data/lib/fontisan/type1/font_dictionary.rb +62 -0
- data/lib/fontisan/type1/pfa_generator.rb +31 -5
- data/lib/fontisan/type1/pfa_parser.rb +31 -30
- data/lib/fontisan/type1/pfb_generator.rb +28 -5
- data/lib/fontisan/type1/private_dict.rb +57 -0
- data/lib/fontisan/type1/seac_expander.rb +501 -0
- data/lib/fontisan/type1.rb +2 -0
- data/lib/fontisan/type1_font.rb +21 -34
- data/lib/fontisan/version.rb +1 -1
- metadata +6 -3
- data/docs/DOCUMENTATION_SUMMARY.md +0 -141
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
# Fontisan Documentation Summary
|
|
2
|
-
|
|
3
|
-
This document provides an overview of all Fontisan documentation files and their purpose.
|
|
4
|
-
|
|
5
|
-
## Main Documentation
|
|
6
|
-
|
|
7
|
-
### README.adoc
|
|
8
|
-
Primary user guide and reference documentation for Fontisan.
|
|
9
|
-
|
|
10
|
-
## Feature Guides
|
|
11
|
-
|
|
12
|
-
### Font Hinting
|
|
13
|
-
- **File**: `docs/FONT_HINTING.adoc`
|
|
14
|
-
- **Purpose**: Documentation for font hinting features in Fontisan
|
|
15
|
-
- **Topics**: TrueType and PostScript hinting, hint extraction and application
|
|
16
|
-
|
|
17
|
-
### Variable Font Operations
|
|
18
|
-
- **File**: `docs/VARIABLE_FONT_OPERATIONS.adoc`
|
|
19
|
-
- **Purpose**: Guide for working with variable fonts
|
|
20
|
-
- **Topics**: Instance generation, axis manipulation, variation preservation
|
|
21
|
-
|
|
22
|
-
### TTC Migration Guide
|
|
23
|
-
- **File**: `docs/EXTRACT_TTC_MIGRATION.md`
|
|
24
|
-
- **Purpose**: Migration guide for users of the `extract-ttc` gem
|
|
25
|
-
- **Topics**: Moving from extract-ttc to Fontisan pack/unpack commands
|
|
26
|
-
|
|
27
|
-
### Web Font Formats
|
|
28
|
-
- **File**: `docs/WOFF_WOFF2_FORMATS.adoc`
|
|
29
|
-
- **Purpose**: Documentation for WOFF and WOFF2 web font formats
|
|
30
|
-
- **Topics**: Conversion to/from WOFF/WOFF2, web optimization
|
|
31
|
-
|
|
32
|
-
### Color Fonts
|
|
33
|
-
- **File**: `docs/COLOR_FONTS.adoc`
|
|
34
|
-
- **Purpose**: Guide for color font formats
|
|
35
|
-
- **Topics**: COLR/CPAL, SVG-in-OpenType, sbix color fonts
|
|
36
|
-
|
|
37
|
-
### Validation
|
|
38
|
-
- **File**: `docs/VALIDATION.adoc`
|
|
39
|
-
- **Purpose**: Font validation framework documentation
|
|
40
|
-
- **Topics**: Validation profiles, quality checks, OpenType spec compliance
|
|
41
|
-
|
|
42
|
-
### Apple Legacy Fonts
|
|
43
|
-
- **File**: `docs/APPLE_LEGACY_FONTS.adoc`
|
|
44
|
-
- **Purpose**: Documentation for Apple legacy font formats
|
|
45
|
-
- **Topics**: dfont format, Mac suitcase fonts
|
|
46
|
-
|
|
47
|
-
### Collection Validation
|
|
48
|
-
- **File**: `docs/COLLECTION_VALIDATION.adoc`
|
|
49
|
-
- **Purpose**: Guide for validating font collections (TTC/OTC/dfont)
|
|
50
|
-
- **Topics**: Collection-specific validation, profile selection
|
|
51
|
-
|
|
52
|
-
## CLI Commands Reference
|
|
53
|
-
|
|
54
|
-
Fontisan provides the following CLI commands:
|
|
55
|
-
|
|
56
|
-
| Command | Purpose |
|
|
57
|
-
|---------|---------|
|
|
58
|
-
| `info` | Display font information |
|
|
59
|
-
| `ls` | List contents (fonts in collection or font summary) |
|
|
60
|
-
| `tables` | List OpenType tables |
|
|
61
|
-
| `glyphs` | List glyph names |
|
|
62
|
-
| `unicode` | List Unicode to glyph mappings |
|
|
63
|
-
| `variable` | Display variable font information |
|
|
64
|
-
| `optical-size` | Display optical size information |
|
|
65
|
-
| `scripts` | List supported scripts from GSUB/GPOS tables |
|
|
66
|
-
| `features` | List GSUB/GPOS features |
|
|
67
|
-
| `subset` | Subset a font to specific glyphs |
|
|
68
|
-
| `convert` | Convert font to different format |
|
|
69
|
-
| `instance` | Generate static font instance from variable font |
|
|
70
|
-
| `pack` | Pack multiple fonts into TTC/OTC collection |
|
|
71
|
-
| `unpack` | Unpack fonts from TTC/OTC collection |
|
|
72
|
-
| `validate` | Validate font file |
|
|
73
|
-
| `export` | Export font to TTX/YAML/JSON format |
|
|
74
|
-
| `dump-table` | Dump raw table data to stdout |
|
|
75
|
-
| `version` | Display version information |
|
|
76
|
-
|
|
77
|
-
## Ruby API Reference
|
|
78
|
-
|
|
79
|
-
### Fontisan Module Methods
|
|
80
|
-
|
|
81
|
-
#### `Fontisan.info(path, brief: false, font_index: 0)`
|
|
82
|
-
Get font information. Supports both full and brief modes.
|
|
83
|
-
|
|
84
|
-
- **Parameters**:
|
|
85
|
-
- `path` (String): Path to font file
|
|
86
|
-
- `brief` (Boolean): Use brief mode for fast identification (default: false)
|
|
87
|
-
- `font_index` (Integer): Index for TTC/OTC files (default: 0)
|
|
88
|
-
- **Returns**: `Models::FontInfo`, `Models::CollectionInfo`, or `Models::CollectionBriefInfo`
|
|
89
|
-
- **Example**:
|
|
90
|
-
```ruby
|
|
91
|
-
info = Fontisan.info("font.ttf", brief: true)
|
|
92
|
-
puts info.family_name
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
#### `Fontisan.validate(path, profile: :default, options: {})`
|
|
96
|
-
Validate a font file using specified profile.
|
|
97
|
-
|
|
98
|
-
- **Parameters**:
|
|
99
|
-
- `path` (String): Path to font file
|
|
100
|
-
- `profile` (Symbol/String): Validation profile (default: :default)
|
|
101
|
-
- `options` (Hash): Additional validation options
|
|
102
|
-
- **Available Profiles**:
|
|
103
|
-
- `:indexability` - Fast validation for font discovery
|
|
104
|
-
- `:usability` - Basic usability for installation
|
|
105
|
-
- `:production` - Comprehensive quality checks (default)
|
|
106
|
-
- `:web` - Web embedding and optimization
|
|
107
|
-
- `:spec_compliance` - Full OpenType spec compliance
|
|
108
|
-
- `:default` - Alias for production profile
|
|
109
|
-
- **Returns**: `Models::ValidationReport`
|
|
110
|
-
- **Example**:
|
|
111
|
-
```ruby
|
|
112
|
-
report = Fontisan.validate("font.ttf", profile: :web)
|
|
113
|
-
puts "Errors: #{report.summary.errors}"
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Fontisan::FontLoader
|
|
117
|
-
|
|
118
|
-
Module for loading fonts in different modes.
|
|
119
|
-
|
|
120
|
-
- **Methods**:
|
|
121
|
-
- `load(path, mode: :full)` - Load a font file
|
|
122
|
-
- **Loading Modes**:
|
|
123
|
-
- `:full` - Load all tables
|
|
124
|
-
- `:metadata` - Load only metadata tables (name, head, hhea, maxp, OS/2, post)
|
|
125
|
-
- `:tables` - Load specific tables only
|
|
126
|
-
- `:structure` - Load structure tables only
|
|
127
|
-
|
|
128
|
-
## Verification
|
|
129
|
-
|
|
130
|
-
Documentation examples are verified by `spec/documentation_examples_spec.rb`.
|
|
131
|
-
|
|
132
|
-
This spec ensures that:
|
|
133
|
-
1. All CLI commands referenced in documentation exist
|
|
134
|
-
2. All Ruby API methods are available
|
|
135
|
-
3. All documentation files are present
|
|
136
|
-
4. Command examples reference valid commands
|
|
137
|
-
|
|
138
|
-
Run verification with:
|
|
139
|
-
```bash
|
|
140
|
-
bundle exec rspec spec/documentation_examples_spec.rb -v
|
|
141
|
-
```
|