Re: [csswg-drafts] Images with layout information (#4116)

The CSS Working Group just discussed `Images with layout information`.

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> Topic: Images with layout information<br>
&lt;emilio> GitHub: https://github.com/w3c/csswg-drafts/issues/4116<br>
&lt;emilio> myles: I'd like to present a problem and no suggestions about how to solve it, but I hope to leave with a sense of whether we're interested in solving it<br>
&lt;emilio> myles: there are images that need to be positioned similarly to text<br>
&lt;emilio> myles: like a math formula with a tall integral sign where most of the formula should be aligned to the baseline but the presence of the integral sign the whole image will sit on the baseline<br>
&lt;emilio> myles: so the formula won't align with the text<br>
&lt;fantasai> if we're talking about things like gaiji, which is inline images that should have a baseline and stuff... there was some proposal to add a property to specify a baseline table<br>
&lt;fantasai> we didn't spec it out because it wasn't a high priority<br>
&lt;emilio> myles: it'd be cool if the math formula could say "my baseline is in the middle of the image", and layout could align it correctly<br>
&lt;fantasai> but it's certainly possible to do<br>
&lt;emilio> myles: similarly with the apple pay logo and similar, because of the descender of the y<br>
&lt;emilio> myles: a similar case is for symbols like the play button in the ios music app, which is not fully horizontally centered, but visually centered<br>
&lt;emilio> myles: it's a triangle, so if you mathematically center it horizontally it would look wrong<br>
&lt;emilio> myles: so the layout moves it slightly horizontally<br>
&lt;emilio> myles: same for kanbun, which are cjk chars which are not in unicode and people use them using images<br>
&lt;emilio> myles: since they're images they behave wrong<br>
&lt;emilio> myles: three of the examples show the need for horizontal baselines, the other is a vertical baseline<br>
&lt;fantasai> s/kanbun/kaiji<br>
&lt;fantasai> s/kaiji/gaiji/<br>
&lt;tantek> There's another fairly common use-case of this, images used for decorative first/initial letters<br>
&lt;emilio> myles: there are various ways to do this, one option is using it on the image formats and such to provide the information<br>
&lt;emilio> myles: another option is to add a css properties<br>
&lt;emilio> myles: mac has these system assets that contain this information<br>
&lt;nmccully> unencoded glyphs = gaiji; Chinese poetry typeset for Japanese audiences = kanbun<br>
&lt;emilio> myles: another option would be to provide a css function that takes a name to these system assets, and returns the information<br>
&lt;emilio> myles: so at least we could use it for system assets<br>
&lt;emilio> myles: I wanted to get an indication of whether this is a problem worth solving, and if it is what's the solution could look like<br>
&lt;tantek> q+<br>
&lt;emilio> TabAtkins: chrome is fine with that, we have taken a look to the image formats to provide x-height and baseline<br>
&lt;smfr> ack<br>
&lt;stantonm> q+<br>
&lt;tantek> q+ to note use-case of decorative image first/initial letters and also prior art / related feature CSS cursors which reference the hotspot of the cursor image<br>
&lt;emilio> nmccully: a single baseline is fine, but multiple baselines may be needed for multiple writing systems<br>
&lt;heycam> q=<br>
&lt;astearns> ack tantek<br>
&lt;emilio> ack tantek<br>
&lt;Zakim> tantek, you wanted to note use-case of decorative image first/initial letters and also prior art / related feature CSS cursors which reference the hotspot of the cursor image<br>
&lt;heycam> q+<br>
&lt;smfr> q-<br>
&lt;emilio> tantek: I agree this is worth solving. Another use case is a decorative image for the first-letter which has decorations and borders alone<br>
&lt;emilio> s/alone/and such<br>
&lt;emilio> tantek: we have a similar feature / challenge in css-ui with the cursor property<br>
&lt;krit> q+<br>
&lt;emilio> tantek: cursor has a hotspot. May be something that we could reuse somehow<br>
&lt;emilio> TabAtkins: cursors are usually set once, but in this case you need the same information every time you set the image<br>
&lt;chrishtr> q+<br>
&lt;astearns> ack stantonm<br>
&lt;emilio> tantek: I think cursors can also have the same issue. Having the info in the image would be great, but maybe both<br>
&lt;emilio> TabAtkins: both is fine<br>
&lt;emilio> stantonm: we have a similar use case for @font-face / images and cjk, where adding a baseline to the font-face rule would be useful<br>
&lt;emilio> myles: can you link me to it?<br>
&lt;emilio> stantonm: we also have a use case to get rid of these images and use the font, so we wanted to use @font-face with the images, and for that the baseline would be great, but for the symbols it may not make sense<br>
&lt;fremy> @myles: if you want more details about the CUR format wrapper which can contain a PNG image and specify a hotspot: https://en.wikipedia.org/wiki/ICO_(file_format)#Icon_resource_structure<br>
&lt;emilio> stantonm: another thing we wanted to see if we can treat images more like a bitmap, to invert in dark mode<br>
&lt;emilio> myles: mix-blend-mode?<br>
&lt;emilio> stantonm: haven't looked into impl that much<br>
&lt;emilio> heycam: I wanted to express general agreement on the problem being worth solving<br>
&lt;emilio> heycam: have run into this with svg<br>
&lt;stantonm> creating @font-face from an CJK image (gaiji) - https://github.com/w3c/csswg-drafts/issues/4013<br>
&lt;astearns> q?<br>
&lt;astearns> ack heycam<br>
&lt;emilio> heycam: I think modifying image formats would be useful, though I'm concerned for compat if we run into a situation with image-orientation<br>
&lt;emilio> heycam: where we start reacting to image metadata and breaking pages<br>
&lt;emilio> myles: we still need some css integrations to define how these are read or what not<br>
&lt;tantek> FYI CSS UI cursors with optional hotspot x y that can override any built-in hotspot: https://www.w3.org/TR/css-ui-3/#cursor<br>
&lt;astearns> ack krit<br>
&lt;emilio> heycam: using vertical writing mode to getting centering and alignment seems a bit odd<br>
&lt;emilio> krit: file formats seems nice, but there are formats which we may not be able to modify<br>
&lt;emilio> krit: so we may want a css-only solution as well<br>
&lt;astearns> ack chrishtr<br>
&lt;emilio> chrishtr: what formats have this already, any examples?<br>
&lt;emilio> myles: nope, 0<br>
&lt;emilio> myles: the ui image in iOS apps have this, but it's not a file format<br>
&lt;bkardell_> q+<br>
&lt;emilio> chrishtr: so in an iOS app you create an image and set this and use it in your layout?<br>
&lt;emilio> myles: yes<br>
&lt;emilio> chrishtr: I'm curious about how feasible is it to modify the formats<br>
&lt;emilio> myles: people think it's a good idea so I'll try and come back if fail<br>
&lt;fantasai> myles, I think we need to make sure whatever we do can handle multiple baselines<br>
&lt;emilio> fremy: we may not need to change formats, the cursor format is a small wrapper file with some metadata. May be able to use a similar wrapper-format<br>
&lt;fantasai> e.g. alphabetic vs ideographic vs central vs mathematical<br>
&lt;emilio> chrishtr: you're proposing a new format?<br>
&lt;nmccully> Adobe's SING glyph format was one way to make an image with font metrics : https://web.archive.org/web/20080627183635/http://www.adobe.com/devnet/opentype/gdk/topic.html<br>
&lt;emilio> fremy: windows cursors do exist already, and include the hotspot. It already has the hotspot, but we don't want exactly that<br>
&lt;emilio> fremy: so we may want that instead<br>
&lt;astearns> ack bkardell_<br>
&lt;chrishtr> q+<br>
&lt;emilio> fremy: as changing formats is going to be a pain<br>
&lt;emilio> myles: only interested in jpeg and png really, and those do have optional tags<br>
&lt;emilio> myles: but yeah, first thing to try is changing those, second the wrapper format, third css-only solution<br>
&lt;myles> optional tags inside their existing formats<br>
&lt;emilio> bkardell_: We need to specify what do we do with these values, and people thought that a css solution would also be valuable too<br>
&lt;emilio> bkardell_: so it seems like we'd get into a situation where there are multiple sources of truth<br>
&lt;emilio> myles: image-orientation was like that until not long ago<br>
&lt;emilio> bkardell_: right, also aspect-ratio and such<br>
&lt;emilio> bkardell_: do you think a property of that sort would be valuable?<br>
&lt;astearns> ack chrishtr<br>
&lt;emilio> myles: I think the way I'd approach is the underline-{offset,thickness} where there is an auto value, then from-font (which would look and the image), then &lt;length><br>
&lt;emilio> chrishtr: we discussed something similar about mathml not long ago right?<br>
&lt;emilio> myles: I think the mathml proposal was to identify the baseline out of specific elements inside the formula<br>
&lt;emilio> myles: but that doesn't work for non-formula use-cases like the ones I've provided<br>
&lt;emilio> chrishtr: that makes sense<br>
&lt;emilio> cbiesinger: could potentially work for svg<br>
&lt;emilio> myles: yeah, true<br>
&lt;emilio> chrishtr: drott mentioned that fonts can be the wrapper format<br>
&lt;emilio> chrishtr: that may be a lot of overhead<br>
&lt;emilio> myles: I think making icon fonts is an anti-pattern<br>
&lt;emilio> drott: there are some ergonomic issues with them<br>
&lt;emilio> drott: but my point is that we don't need a new wrapper format, you could wrap an image in a font file<br>
&lt;emilio> myles: I'd prefer a new format, there's tons of unrelated stuff that you'd need to create a valid font<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4116#issuecomment-531644339 using your GitHub account

Received on Monday, 16 September 2019 05:20:23 UTC