typst icon indicating copy to clipboard operation
typst copied to clipboard

Let base be `stretch()`-able to accommodate wide attachments

Open Leedehai opened this issue 1 year ago • 4 comments

Leedehai avatar Jul 16 '24 22:07 Leedehai

Looking at the new reference image, it may be that this is actually only desirable for a subset of symbols. For arrows it seems very sensible, but for = it looks weird.

cc: @Enivex due to https://github.com/typst/typst/issues/1304#issuecomment-1723261507

laurmaedje avatar Jul 17 '24 08:07 laurmaedje

Looking at the new reference image, it may be that this is actually only desirable for a subset of symbols. For arrows it seems very sensible, but for = it looks weird.

cc: @Enivex due to #1304 (comment)

It makes more sense for some symbols than others, but I'd argue that this should be opt-in regardless. Perhaps through something like stretch().

Whether the behavior is desirable is both subjective and situational.

Enivex avatar Jul 17 '24 09:07 Enivex

@laurmaedje Introduced stretch(); please see the reference images.

Leedehai avatar Jul 19 '24 03:07 Leedehai

@laurmaedje Introduced stretch(); please see the reference images.

The image good to my eyes, but maybe you should also add tests with absolute lengths as well? Like 1cm or 2em, not just %-based.

Edit: And length < 100%. Maybe I'd like to scale an arrow, but not all the way to the length of the attachment.

Enivex avatar Jul 19 '24 12:07 Enivex

@mkorje Thanks for the review!

I'm not sure if there exists any glyph that have both horizontal and vertical variants, which would cause problems then.

I can't really think of a glyph where that would make sense. I feel like the hstretch/vstretch naming doesn't feel Typst-y, so I'd prefer to avoid it.

laurmaedje avatar Sep 06 '24 16:09 laurmaedje

Me neither, though I guess there's nothing stopping a font from including such things for a glyph. It wouldn't hurt then to have an axis parameter (or something like that) which is auto, just in case (but this is probably overkill).

And yeah I agree that it isn't very Typst like. Adding the word horizontal or vertical felt too verbose and I couldn't think of a nice shortening of both words.

mkorje avatar Sep 06 '24 17:09 mkorje

Is there anything blocking this?

Enivex avatar Sep 24 '24 16:09 Enivex

Hi - I became a bit busy recently so I'm fine with someone taking this work and create a new PR (hence the drop in my recent PR counts). I could come back to this later if that's not already done. Also, is a 0.12 release imminent?

Leedehai avatar Sep 24 '24 21:09 Leedehai

I'd be happy to continue on this PR's work. It'd be nice to get this into 0.12.

mkorje avatar Sep 25 '24 03:09 mkorje

Closing in favor of https://github.com/typst/typst/pull/5030. Thanks all!

laurmaedje avatar Sep 25 '24 18:09 laurmaedje