-
Notifications
You must be signed in to change notification settings - Fork 30
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
Note: We will add UI for |
@justvanrossum I think this requires more and thorough consideration of how we really want to deal with it. There are too many open questions: How would a UI look like? Does it look like "Line metrics" or like "Custom Data". Is it always there, like "Guidelines", even though we don't really need it always? In general I would think it should look like "Line metrics", but we don't set these values always (which differs from "Line Metrics"), and we don't have an add or remove concept for that UI, yet. |
Notes from todays call together with @justvanrossum:
|
I just realized there are several items that you currently propose to edit as part of font sources, that are actually font-level bits of data, that we should incorporate in the "Font info" panel. Examples:
We should very carefully select which items are potentially interpolatable (see also: the MVAR table), and which are not, and therefore do not belong in the font sources panel. |
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?