-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit font infos metadata #2039
base: main
Are you sure you want to change the base?
Edit font infos metadata #2039
Conversation
Here a short demo: Fontra-CustomData.mp4 |
source.customData = {}; | ||
for (const item of event.newValue) { | ||
const value = parseFloat(item["value"]); | ||
// TODO: How do we handle different types of values? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can allow items to carry their own formatters, then the item would be able override the column-level formatter:
diff --git a/src/fontra/client/web-components/ui-list.js b/src/fontra/client/web-components/ui-list.js
index 614540b94..abc61bdac 100644
--- a/src/fontra/client/web-components/ui-list.js
+++ b/src/fontra/client/web-components/ui-list.js
@@ -273,7 +273,8 @@ export class UIList extends UnlitElement {
[colDesc.cellFactory(item, colDesc)]
);
} else {
- const formatter = colDesc.formatter || DefaultFormatter;
+ const formatter =
+ item.formatters?.[colDesc.key] || colDesc.formatter || DefaultFormatter;
cell = html.div(
{ class: `text-cell ${colDesc.key} ${colDesc.align || "left"}` },
(Maybe the key shouldn't be "formatter", but we can decide later.)
This reverts commit 98df6fb.
…ute which has no UFO mapping
…don't add placeholder "attributeName"
This is for discussion.
…omDataNameMapping
a13f394
to
f27e558
Compare
…b.com/googlefonts/fontra into issue-2023-edit-font-infos-metadata-2
…metadata-2 Edit font infos metadata 2
…custom data dialog
@justvanrossum About the label of customData, currently 'Advanced Information': What do you think about 'Low-level settings'? |
Fixes #2023
This is an early draft for feedback.
My main question: Is it the right direction to add and use a Fontra to UFO mapping for customData parameters (it's similar to
lineMetricsVerMapping
)?I am also wondering if
fontInfoNameMapping
should be a dict instead of a list? But this is not related to this issue. I am just noticing it and wondering if we should make it consistent?