Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cantarell-fonts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
cantarell-fonts
Commits
fbdfa986
Commit
fbdfa986
authored
May 11, 2019
by
Nikolaus Waxweiler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instantiator: Copy glyph.unicodes from default font
parent
ee0ca1b5
Pipeline
#81306
passed with stage
in 2 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
scripts/instantiator.py
scripts/instantiator.py
+7
-2
No files found.
scripts/instantiator.py
View file @
fbdfa986
...
...
@@ -47,6 +47,7 @@ class Instantiator:
copy_lib
:
Mapping
[
str
,
Any
]
designspace_rules
:
List
[
designspaceLib
.
RuleDescriptor
]
glyph_mutators
:
Mapping
[
str
,
"Variator"
]
glyph_name_to_unicodes
:
Dict
[
str
,
List
[
int
]]
info_mutator
:
"Variator"
kerning_mutator
:
"Variator"
round_geometry
:
bool
...
...
@@ -93,11 +94,14 @@ class Instantiator:
masters_kerning
=
collect_kerning_masters
(
designspace
,
axis_bounds
)
kerning_mutator
=
Variator
.
from_masters
(
masters_kerning
,
axis_order
)
default_font
=
designspace
.
findDefault
().
font
glyph_mutators
:
Dict
[
str
,
Variator
]
=
{}
glyph_name_to_unicodes
:
Dict
[
str
,
List
[
int
]]
=
{}
for
glyph_name
in
glyph_names
:
items
=
collect_glyph_masters
(
designspace
,
glyph_name
,
axis_bounds
)
mutator
=
Variator
.
from_masters
(
items
,
axis_order
)
glyph_mutators
[
glyph_name
]
=
mutator
glyph_name_to_unicodes
[
glyph_name
]
=
default_font
[
glyph_name
].
unicodes
# Construct defaults to copy over
copy_feature_text
:
str
=
default_font
.
features
.
text
...
...
@@ -119,6 +123,7 @@ class Instantiator:
copy_lib
,
designspace
.
rules
,
glyph_mutators
,
glyph_name_to_unicodes
,
info_mutator
,
kerning_mutator
,
round_geometry
,
...
...
@@ -204,9 +209,9 @@ class Instantiator:
glyph_instance
=
glyph_instance
.
round
()
# onlyGeometry=True does not set name and unicodes, in ufoLib2 we can't
# modify a glyph's name. Copy unicodes.
# modify a glyph's name. Copy unicodes
from default font
.
glyph_instance
.
extractGlyph
(
glyph
,
onlyGeometry
=
True
)
glyph
.
unicodes
=
glyph_instance
.
unicodes
glyph
.
unicodes
=
self
.
glyph_name_to_unicodes
[
glyph_name
]
# Process rules
glyph_names_list
=
self
.
glyph_mutators
.
keys
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment