15:03:23 RRSAgent has joined #formatted-text 15:03:23 logging to https://www.w3.org/2021/08/18-formatted-text-irc 15:04:22 Present+ Travis Leithead 15:05:22 yjbanov_ has joined #formatted-text 15:07:30 Present+ Yegor Jbanov 15:07:40 sushraja has joined #formatted-text 15:08:05 Travis: Today's primary topic is metrics 15:08:29 ah thanks yjbanov_ if you are picking it up :) 15:08:30 Ill scribe - though I am not experienced at this. 15:09:01 Neither am I, but I'm happy to do it :) 15:11:10 Travis gives a summary of https://github.com/WICG/canvas-formatted-text/blob/main/explainer-metrics.md 15:13:27 brb: need laptop charger 15:19:07 fserb: formatted text paragraph is same as a block? 15:19:10 Travis: yes 15:20:35 Fernando: need to figure how/if the runs are joined during layout 15:22:22 Fernando: what is "inlineSize" 15:22:40 Travis: it's the dimension along which the text wraps 15:24:37 fernando: 'width' is available on the FormattedText... doesn't that define inlinesize? 15:24:54 sushraja: it allows auto/width to do min-max sizing. 15:25:58 sushraja: inlineSize is availableWidth (not sure about containers) 15:27:06 fserb: not 100% sure that inlineSize is the only properly the matters at this point... device-pixel ratio? Still need to think about this. 15:27:08 Fernando: inlineSize may not be the only property that's needed 15:27:35 Julia: height limitation may also matter 15:27:35 Julia: height limitation might also affect it. Lots of different factors. 15:28:20 Mouad: maybe other properties are already on the FormattedText object? 15:28:35 .. elipses property? 15:28:44 Mouad: ellipsis information is typically on the FormattedText onjrvy 15:28:48 *object 15:32:16 yjbanov_: can it be made more explicit--in the lifecycle? to explicitly take a snapshot that you intend to keep around? 15:33:03 ... use case: transition animation. Rather than pay cost of layout in the middle of layout; I pre-compute it before the start. Then store it and blast it into the rendering system w/out re-layout. 15:33:44 .. if the underlying system has collected the metrics, then if you try to use the object, it will throw exceptions. 15:34:33 fserb: fairly confident that you can't do that (throw exceptions)--or shouldn't. 15:35:04 .. one solution is to say format() always returns a new object, but the metrics has an "update" 15:35:16 .. this would give us the hybrid approach that we are looking for. 15:35:26 .. don't like "magically" invalidating 15:36:10 mike: still not seeing the problem... 15:36:18 fserb: seems trying to avoid object creation (in JS) 15:36:26 .. would suggest just leave it be. 15:36:35 .. might need to see how this looks in practice. 15:36:40 julia: what about editing? 15:36:55 .. the key is when you slightly update the data 15:37:32 sushraja: in old model, we let the web author have a combination of metrics where some are correct and others maybe stale. 15:37:45 Sushanth: the API could return the same object ot the developer, who can then compute the delta 15:38:31 Sushanth: one issue if devs add new properties to objects returned by metrics. 15:38:48 fserb: unrelated issue: potential support for web workers. 15:38:50 fserb: potential support for web workers. 15:39:01 .. each time I look at this, I see it might be tricky. 15:39:10 sushraja: on dev side, I'm looking at this problem. 15:39:17 Sushanth: the difficult part is layout blocks. 15:40:02 mike: from my client's perspective, workers are a requirement. 15:41:06 Mike: let's figure out if data model and API make sense in all threads, then we can add more on threads where document model is available 15:41:14 fserb: just want to make sure the spec isn't impossible to implement. 15:43:16 Mike: it's valuable to bring up alternative sources of metrics, because this way we can avoid bias of the only source we considered 15:43:32 (DOM, Houdini, workers, etc) 15:47:15 Julia: need to consider early in the design process that one character can produce multiple glyphs 15:48:17 Example: รก 15:49:24 Travis: one idea: the engine could split glyphs into multiple fragments so that fragments can overlap and be positioned on top of each other 15:50:09 Julia: HarfBuzz would put combining character next to the main character. This can be engine-dependent. 15:51:02 Travis: trying to avoid M:N mapping between characters and glyphs 15:51:08 Julia: let's embrace it! :) 15:51:40 fserb: mapping is too useful to avoid it (ligatures is another example) 15:52:35 Julia: people think about text and graphemes, which consist of many glyphs. 15:52:53 So we might need to map to graphemes and/or grapheme clusters. 15:53:49 Julia: in text editors, if you click mouse, you need to put the cursor somewhere; cannot be glyph, cannot go inside the grapheme, as it will produce incorrect encoding. 15:54:23 Julia: an editor that allows editing graphemes internally is a different use-case 15:54:46 Julia: we need to provide both, normal text editor use-case, and one that goes _into_ the glyph 15:55:19 fserb: need to know the reason for the n-to-n mapping. 15:55:42 .. for emoji... you never want to put in between, but for arabic you might. 15:56:09 yjbanov_: Folks may want to render the accent marks with different fonts! 15:56:45 fserb: there are languages in which the n-to-n mapping doesn't exist. 15:58:01 mike: one possible way to ofganize the complexity... 15:58:22 .. purpose for metrics to allow the client to do their own drawing. 15:58:29 .. then almost all of this can go away. 15:58:39 .. must have x/y positions to draw 15:58:47 .. but for editing, it can be pretty hairy. 15:59:33 fserb: that was the conclusion we reached after last three attempts to solve this problem. 15:59:39 .. there is a use case to draw on the screen. 15:59:52 .. the other use case is a high-level API, but the mid-layer is hell. 16:00:08 .. the low-level ops are aweful and intractable. 16:00:51 fserb: you do it the way the browser does... 16:01:12 .. it takes decades to solve these problems. 16:01:36 julia: the only reasonable approach, I agree. 16:02:07 sushraja: for caret movement, if your caret is right of several consecutive glyph. 16:02:17 fserb: you provide high-level ops for this scenario. 16:03:26 .. backspace and movement are different things! 16:03:46 .. must find a set of ops that are meaningful and abstract from there. 16:03:56 sushraja: I understand the general approach. 16:06:45 mike: we should focus on drawing scenarios (which should make some scenarios tractable) 16:06:57 .. back mapping is hard, maybe we hide it. 16:07:50 .. maybe give less instead of more. 16:08:46 sushraja: if we define high-level as what the browser does, but the app want's a different data, then it's less useful for that client. 16:09:00 mike: some apps may not take any API we give them. 16:09:00 Sushanth: if we expose browser behavior it may be counter-productive for specialized editors (e.g. Word) that do something custom 16:10:31 julia: is it visual order or logical order (e.g., RTL) 16:11:04 fserb: with coordinate systems, be sure the ordering in the lists makes sense. 16:12:58 mike: the font id is useless if I don't know which font it was resovled ot. 16:13:14 *glyph id is useless if... 16:13:45 mike: advance may not be important, but x/y is for drawing. 16:16:57 sushraja: q on level of detail for glyphs... 16:17:06 .. seems useful for downloaded fonts. 16:17:14 .. what do you need to know (beyond size)? 16:17:33 mike: if there's backmapping for size from the data model 16:17:53 .. there may be fallback even among my downloaded fonts 16:18:02 .. to be sure I have the right font file. 16:18:15 Mike: need to know which font was picked 16:18:21 Julia: who defines which font goes where? 16:18:33 .. how is it represented here? 16:18:38 sushraja: it's not. 16:18:49 .. who implements the font fallback? 16:18:57 mike: whatever the browser would have done. 16:19:05 julia: so it's hidden from the API 16:19:22 sushraja: if we just give the string for the downloaded font, is that sufficient? 16:19:32 mike: as long as it's unique, then yes, it's useful. 16:19:58 yjbanov_: is there ambiguity within the font? 16:20:10 sushraja: with glyph id, that may be enough? 16:21:29 yjbanov_: is font-family enough to not have ambiguity? 16:21:39 mike: it is for downloaded fonts, not for built-in fonts. 16:22:08 sushraja: there may be issues with exposing font-fallback for local fonts. 16:22:17 yjbanov_: being done in "local font access" 16:23:00 https://web.dev/local-fonts/ 16:23:04 mike: might need something more than just font-family (good note) 16:23:21 .. font-family will be a unique identifier -- should be noted in the spec. 16:23:39 sushraja: note that we are limiting to downloaded fonts for glyph-level metrics. 16:25:00 yjbanov_: speaking of downloaded fonts.. (in Flutter by canvas-kit) have canvas-kit tell us what fonts are missing. 16:25:13 .. this is done lazily. 16:25:28 .. so if there are fonts that are missing, then it would be nice to know that. 16:26:58 mike: having the ability to know a missing font-mapping is very useful. 16:27:36 Travis: and this could be a good signal for fragments backed by system fonts. 16:30:18 rrsagent, make logs public 16:30:43 Travis: thanks everyone for attending, and for the collaborative discussion! 16:30:57 RRSAgent, please make the minutes 16:30:57 I have made the request to generate https://www.w3.org/2021/08/18-formatted-text-minutes.html Travis 17:10:17 bye, Zakim 17:10:31 Zakim, bye 17:10:31 leaving. As of this point the attendees have been Travis, Leithead, Yegor, Jbanov 17:10:31 Zakim has left #formatted-text 17:10:40 RRSAgent, bye! 17:10:40 I see no action items