You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the scale function only supports values of the type ratio, making it somewhat difficult to resize content to an absolute width/height such as that of the current page or container. This is possible in LaTeX using \resizebox{width}{height}{Foo} (for possible reference, not to add any pressure) and can currently be achieved in Typst by "normalizing" the size of the content to be scaled and multiplying it by a given length as in:
Notably, setting contents to something that spans multiple lines such as lorem(50) here would produce questionable output due to the nature of measure.
Use Case
While I don't like tautologies, I'm feeling the urge to simply say that this would make scaling to an absolute length easier, which in turn would facilitate the use case presented above, among others, without needing to resort to using math explicitly. Admittedly, the uses of this are limited by the fact that most people resize images, where absolute lengths are indeed valid; however, I've seen a question from three different people on the Discord server about resizing text, a fletcher diagram as well as an equation to fit exactly in a page. This may not be a lot in terms of demand, but is indicative of utility.
The text was updated successfully, but these errors were encountered:
Would it also make sense for scale to allow at most one of x and y to be auto to indicate that that axis should be scaled with the same ratio as the other?
Description
Currently, the
scale
function only supports values of the typeratio
, making it somewhat difficult to resize content to an absolute width/height such as that of the current page or container. This is possible in LaTeX using\resizebox{width}{height}{Foo}
(for possible reference, not to add any pressure) and can currently be achieved in Typst by "normalizing" the size of the content to be scaled and multiplying it by a given length as in:Notably, setting
contents
to something that spans multiple lines such aslorem(50)
here would produce questionable output due to the nature ofmeasure
.Use Case
While I don't like tautologies, I'm feeling the urge to simply say that this would make scaling to an absolute length easier, which in turn would facilitate the use case presented above, among others, without needing to resort to using math explicitly. Admittedly, the uses of this are limited by the fact that most people resize images, where absolute lengths are indeed valid; however, I've seen a question from three different people on the Discord server about resizing text, a fletcher diagram as well as an equation to fit exactly in a page. This may not be a lot in terms of demand, but is indicative of utility.
The text was updated successfully, but these errors were encountered: