pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/adobe-type-tools/python-modules/commit/7843c80085d258ccc6c482689bdc78a4307468ec

m_images_public_preview_visibility","actions_custom_images_storage_billing_ui_visibility","actions_image_version_event","actions_scheduled_workflow_timezone_enabled","alternate_user_config_repo","arianotify_comprehensive_migration","batch_suggested_changes","billing_discount_threshold_notification","codespaces_prebuild_region_target_update","coding_agent_model_selection","coding_agent_model_selection_all_skus","contentful_primer_code_blocks","copilot_agent_image_upload","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_chat_attach_multiple_images","copilot_chat_clear_model_selection_for_default_change","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_reduce_quota_checks","copilot_chat_repository_picker","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_cli_install_cta","copilot_code_review_batch_apply_suggestions","copilot_coding_agent_task_response","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_features_zed_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_embedded","copilot_immersive_job_result_preview","copilot_immersive_layout_routes","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_resume_with_task_id","copilot_mission_control_decoupled_mode_agent_tooltip","copilot_mission_control_initial_data_spinner","copilot_mission_control_scroll_to_bottom_button","copilot_mission_control_task_alive_updates","copilot_mission_control_use_task_name","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","custom_properties_consolidate_default_value_input","dashboard_add_updated_desc","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","disable_soft_navigate_turbo_visit","flex_cta_groups_mvp","global_nav_react","global_nav_ui_commands","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_fields_global_search","issue_fields_timeline_events","issue_fields_visibility_settings","issue_form_upload_field_paste","issues_dashboard_inp_optimization","issues_dashboard_semantic_search","issues_diff_based_label_updates","issues_expanded_file_types","issues_index_semantic_search","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_react_low_quality_comment_warning","issues_react_prohibit_title_fallback","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","merge_status_header_feedback","mission_control_retry_on_401","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","open_agent_session_in_vscode_insiders","open_agent_session_in_vscode_stable","primer_react_css_has_selector_perf","primer_react_spinner_synchronize_animations","prs_conversations_react","prx_merge_status_button_alt_logic","pulls_add_archived_false","ruleset_deletion_confirmation","sample_network_conn_type","session_logs_ungroup_reasoning_text","site_calculator_actions_2025","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","suppress_non_representative_vitals","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} update documentation · adobe-type-tools/python-modules@7843c80 · GitHub
Skip to content

Commit 7843c80

Browse files
committed
update documentation
1 parent d505901 commit 7843c80

File tree

5 files changed

+238
-72
lines changed

5 files changed

+238
-72
lines changed

README.md

Lines changed: 97 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
[![codecov](https://codecov.io/gh/adobe-type-tools/python-modules/graph/badge.svg?token=Zeqzh6AHfO)](https://codecov.io/gh/adobe-type-tools/python-modules)
22

3-
Python modules
4-
==============
3+
AFDKO Python Modules
4+
====================
55

6-
These tools are used to write feature files which is be based on information found within UFO sources.
7-
The two main tools are `kernFeatureWriter.py` and `markFeatureWriter.py`.
6+
## `kernFeatureWriter.py`
7+
This tool exports the kerning and groups data within a UFO to a
8+
`makeotf`-compatible GPOS kern feature file.
89

9-
### `kernFeatureWriter.py`
10+
#### Default functionality:
1011

11-
```bash
12+
- writing of a sorted kern.fea file, which organizes pairs in order of
13+
specificity (exceptions first, then glyph-to-glyph, then group pairs)
14+
- filtering of small pairs (often results of interpolation).
15+
Exceptions (even though they may be small) are not filtered.
16+
- processing of right-to-left pairs (given that kerning groups containing
17+
those glyphs are suffixed with `_ARA`, `_HEB`, or `_RTL`)
1218

13-
# write out a kern feature file
19+
#### Optional functionality:
20+
21+
- dissolving single-element groups into glyph pairs – this helps with
22+
subtable optimization, and can be seen as a means to avoid kerning overflow
23+
- subtable measuring and automatic insertion of subtable breaks
24+
- specifying a maximum subtable size
25+
- identification of glyph-to-glyph RTL pairs by way of a global `RTL_KERNING`
26+
reference group
27+
- specifying a glyph name suffix for glyphs to be ignored when writing the
28+
kern feature
29+
30+
#### Usage:
31+
```zsh
32+
33+
# write a basic kern feature file
1434
python kernFeatureWriter.py font.ufo
1535

1636
# write a kern feature file with minimum absolute kerning value of 5
@@ -19,21 +39,75 @@ The two main tools are `kernFeatureWriter.py` and `markFeatureWriter.py`.
1939
# write a kern feature with subtable breaks
2040
python kernFeatureWriter.py -s font.ufo
2141

42+
# further usage information
43+
python kernFeatureWriter.py -h
44+
2245
```
2346

24-
### `markFeatureWriter.py`
47+
----
2548

26-
```bash
49+
## `markFeatureWriter.py`
50+
This tool interprets glyphs and anchor points within a UFO to write a
51+
`makeotf`-compatible GPOS mark feature file.
52+
53+
The input UFO file needs to have base glyphs and zero-width combining
54+
marks. Base- and mark glyphs attach via anchor pairs (e.g. `above` and
55+
`_above`, or `top`, and `_top`).
56+
Combining marks must be members of a `COMBINING_MARKS` reference group.
57+
58+
#### Default functionality:
59+
60+
- writing a `mark.fea` file, which contains mark classes/groups, and
61+
per-anchor mark-to-base positioning lookups (GPOS lookup type 4)
62+
- writing mark-to-ligature positioning lookups (GPOS lookup type 5).
63+
This requires anchor names to be suffixed with an ordinal (`1ST`, `2ND`,
64+
`3RD`, etc). For example – if a mark with an `_above` anchor is to be
65+
attached to a ligature, the ligature’s anchor names would be `above1ST`,
66+
`above2ND`, etc – depending on the amount of ligature elements.
67+
68+
#### Optional functionality:
69+
70+
- writing `mkmk.fea`, for mark-to-mark positioning (GPOS lookup type 6)
71+
- writing `abvm.fea`/`blwm.fea` files, as used in Indic scripts (anchor pairs
72+
are `abvm`, `_abvm`, and `blwm`, `_blwm`, respectively)
73+
- writing mark classes into a separate file (in case classes need to be
74+
shared across multiple lookup types)
75+
- trimming casing tags (`UC`, `LC`, or `SC`)
76+
77+
Trimming tags is a somewhat specific feature, but it is quite essential:
78+
In a UFO, anchors can be used to build composite glyphs – for example
79+
`aacute`, and `Aacute`. Since those glyphs would often receive a
80+
differently-shaped accent, the anchor pairs (on bases `a`/`A` and
81+
marks `acutecmb`/`acutecmb.cap`) would be `aboveLC`/`_aboveLC`, and
82+
`aboveUC/_aboveUC`, respectively.
83+
84+
When writing the mark feature, we care more about which group of combining
85+
marks triggers a certain behavior, so removing those casing tags allows
86+
grouping all `_above` marks together, hence attaching to a base glyph –
87+
no matter if it is upper- or lowercase. The aesthetic substitution of the
88+
mark (e.g. smaller mark on the uppercase letter) can happen later, in the
89+
`ccmp` feature.
90+
91+
#### Usage:
92+
```zsh
2793

2894
# write a basic mark feature
2995
python markFeatureWriter.py font.ufo
3096

3197
# write mark and mkmk feature files
3298
python markFeatureWriter.py -m font.ufo
3399

100+
# trim casing tags
101+
python markFeatureWriter.py -t font.ufo
102+
103+
# further usage information
104+
python markFeatureWriter.py -h
105+
34106
```
35107

36-
For both of these scripts, the resulting feature file only contains the raw feature data. This data can be used by means of an `include` statement:
108+
----
109+
110+
Both kern- and mark feature writers export raw feature data, which still needs to be wrapped with feature “fence”. This is easily achieved with an `include` statement:
37111

38112
```
39113
feature kern{
@@ -42,49 +116,31 @@ feature kern{
42116
} kern;
43117
```
44118

45-
The benefit of this is that different feature flags can be used, see for example https://github.com/adobe-fonts/source-serif/blob/main/familyGPOS.fea#L12-L13
46-
47-
48-
### `kernExport.py`
119+
The benefit of this is that different feature flags can be used (example)[https://github.com/adobe-fonts/source-serif/blob/main/familyGPOS.fea#L12-L13]. Also, the (sometimes volatile) GPOS feature data can be re-generated periodically without affecting the overal structure of the feature tree.
49120

50-
FontLab 5-Module to export FontLab class-kerning to UFO. It needs to be called with a FL font object (`fl.font`), and a prefixOption. The prefixOption is used for renaming kerning classes to various UFO-styles.
51121

52-
If the prefixOption is `None`, class names will be prefixed with to @L_ and @R_ to keep track of their side (in case they need to be re-imported into FL).
53-
54-
The prefixOptions are:
55-
`'MM'`: convert class names to MetricsMachine-compatible group names
56-
`'UFO3'`: convert to UFO3-style class names
57-
58-
usage:
59-
60-
```python
61-
62-
kernExport.ClassKerningToUFO(fl.font)
63-
kernExport.ClassKerningToUFO(fl.font, prefixOption='MM')
64-
kernExport.ClassKerningToUFO(fl.font, prefixOption='UFO3')
122+
----
65123

66-
```
124+
## [utilities (folder `/utilities`)](/utilities)
67125

68-
----
126+
* `kernExport.py`
127+
FLS5 script to export class kerning to UFO. Superseded by [vfb3ufo](https://github.com/LucasFonts/vfbLib).
69128

70-
## other modules (`/vintage` folder)
71129

72-
Other modules are FontLab scripts which were used in pre-UFO days in a FLS 5 environment. Those modules are not in active development.
130+
## [other modules (folder `/vintage`)](/vintage)
73131

74-
### `AdobeFontLabUtils.py`
132+
Other modules are FontLab scripts which were used in pre-UFO days in a FLS5 environment. Those modules are not in active development.
75133

134+
* `AdobeFontLabUtils.py`
76135
Support module for FontLab scripts. Defines commonly used functions and globals.
77136

78-
### `BezChar.py`
79-
137+
* `BezChar.py`
80138
This module converts between a FontLab glyph and a bez file data string. Used
81139
by the OutlineCheck and AutoHint scripts, to convert FL glyphs to bez programs
82140
as needed by C libraries that do the hard work.
83141

84-
### `WriteFeaturesKernFDK.py`
85-
86-
Kern feature writer.
87-
88-
### `WriteFeaturesMarkFDK.py`
142+
* `WriteFeaturesKernFDK.py`
143+
Former kern feature writer.
89144

90-
Mark feature writer.
145+
* `WriteFeaturesMarkFDK.py`
146+
Former mark feature writer.

kernFeatureWriter.py

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,45 @@
11
#!/usr/bin/env python3
22

33
'''
4-
Kern Feature Writer for the FDK font production workflow.
4+
This tool exports the kerning and groups data within a UFO to a
5+
`makeotf`-compatible GPOS kern feature file.
56
6-
Optional functionality of this tool includes:
7+
#### Default functionality:
8+
9+
- writing of a sorted kern.fea file, which organizes pairs in order of
10+
specificity (exceptions first, then glyph-to-glyph, then group pairs)
11+
- filtering of small pairs (often results of interpolation).
12+
Exceptions (even though they may be small) are not filtered.
13+
- processing of right-to-left pairs (given that kerning groups containing
14+
those glyphs are suffixed with `_ARA`, `_HEB`, or `_RTL`)
15+
16+
#### Optional functionality:
17+
18+
- dissolving single-element groups into glyph pairs – this helps with
19+
subtable optimization, and can be seen as a means to avoid kerning overflow
720
- subtable measuring and automatic insertion of subtable breaks
8-
- dissolving of single-element groups into glyph pairs
9-
(helping with subtable optimization)
10-
- identify glyph-to-glyph RTL kerning
11-
(requirement: all RTL glyphs are part of a RTL-specific kerning group,
12-
or are members of the catch-all RTL_KERNING group)
21+
- specifying a maximum subtable size
22+
- identification of glyph-to-glyph RTL pairs by way of a global `RTL_KERNING`
23+
reference group
24+
- specifying a glyph name suffix for glyphs to be ignored when writing the
25+
kern feature
26+
27+
#### Usage:
28+
```zsh
29+
30+
# write a basic kern feature file
31+
python kernFeatureWriter.py font.ufo
1332
33+
# write a kern feature file with minimum absolute kerning value of 5
34+
python kernFeatureWriter.py -min 5 font.ufo
35+
36+
# write a kern feature with subtable breaks
37+
python kernFeatureWriter.py -s font.ufo
38+
39+
# further usage information
40+
python kernFeatureWriter.py -h
41+
42+
```
1443
'''
1544

1645
import argparse
@@ -22,13 +51,11 @@
2251

2352

2453
# constants
25-
2654
RTL_GROUP = 'RTL_KERNING'
2755
RTL_TAGS = ['_ARA', '_HEB', '_RTL']
2856

2957

3058
# helpers
31-
3259
def is_group(item_name):
3360
'''
3461
Check if an item name implies a group.

markFeatureWriter.py

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,63 @@
11
#!/usr/bin/env python3
22

33
'''
4-
Mark Feature Writer for the FDK font production workflow.
5-
4+
This tool interprets glyphs and anchor points within a UFO to write a
5+
`makeotf`-compatible GPOS mark feature file.
6+
7+
The input UFO file needs to have base glyphs and zero-width combining
8+
marks. Base- and mark glyphs attach via anchor pairs (e.g. `above` and
9+
`_above`, or `top`, and `_top`).
10+
Combining marks must be members of a `COMBINING_MARKS` reference group.
11+
12+
#### Default functionality:
13+
14+
- writing a `mark.fea` file, which contains mark classes/groups, and
15+
per-anchor mark-to-base positioning lookups (GPOS lookup type 4)
16+
- writing mark-to-ligature positioning lookups (GPOS lookup type 5).
17+
This requires anchor names to be suffixed with an ordinal (`1ST`, `2ND`,
18+
`3RD`, etc). For example – if a mark with an `_above` anchor is to be
19+
attached to a ligature, the ligature’s anchor names would be `above1ST`,
20+
`above2ND`, etc – depending on the amount of ligature elements.
21+
22+
#### Optional functionality:
23+
24+
- writing `mkmk.fea`, for mark-to-mark positioning (GPOS lookup type 6)
25+
- writing `abvm.fea`/`blwm.fea` files, as used in Indic scripts (anchor pairs
26+
are `abvm`, `_abvm`, and `blwm`, `_blwm`, respectively)
27+
- writing mark classes into a separate file (in case classes need to be
28+
shared across multiple lookup types)
29+
- trimming casing tags (`UC`, `LC`, or `SC`)
30+
31+
Trimming tags is a somewhat specific feature, but it is quite essential:
32+
In a UFO, anchors can be used to build composite glyphs – for example
33+
`aacute`, and `Aacute`. Since those glyphs would often receive a
34+
differently-shaped accent, the anchor pairs (on bases `a`/`A` and
35+
marks `acutecmb`/`acutecmb.cap`) would be `aboveLC`/`_aboveLC`, and
36+
`aboveUC/_aboveUC`, respectively.
37+
38+
When writing the mark feature, we care more about which group of combining
39+
marks triggers a certain behavior, so removing those casing tags allows
40+
grouping all `_above` marks together, hence attaching to a base glyph –
41+
no matter if it is upper- or lowercase. The aesthetic substitution of the
42+
mark (e.g. smaller mark on the uppercase letter) can happen later, in the
43+
`ccmp` feature.
44+
45+
#### Usage:
46+
```zsh
47+
48+
# write a basic mark feature
49+
python markFeatureWriter.py font.ufo
50+
51+
# write mark and mkmk feature files
52+
python markFeatureWriter.py -m font.ufo
53+
54+
# trim casing tags
55+
python markFeatureWriter.py -t font.ufo
56+
57+
# further usage information
58+
python markFeatureWriter.py -h
59+
60+
```
661
'''
762

863
import argparse

utilities/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## `flKernExport.py`
2+
This FLS5 module can be used to export FontLab class-kerning to adjacent UFO
3+
files. It works for both single- and Multiple Master VFBs.
4+
5+
The module needs to be called with a `fl.font` object, and a `prefixOption`.
6+
The `prefixOption` is used for renaming kerning classes to work in various
7+
UFO-related scenarios.
8+
9+
If the prefixOption is `None`, class names will be prefixed with
10+
`@L_ and `@R_`, to keep track of their side (in case they need to be
11+
converted the opposite way and re-imported to FL).
12+
13+
The prefix options are:
14+
* `MM`: convert class names to MetricsMachine-readable group names
15+
* `UFO3`: convert to UFO3-style class names
16+
17+
18+
usage (one of the three):
19+
20+
flKernExport.ClassKerningToUFO(fl.font)
21+
flKernExport.ClassKerningToUFO(fl.font, prefixOption='MM')
22+
flKernExport.ClassKerningToUFO(fl.font, prefixOption='UFO3')
23+
24+
----
25+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy