-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support fo rotation, scaling and clipping of content #6
Comments
The current version 2.0 of the HINT file format does not support rotation or clipping of images. Clipping and rotation might be added to the HINT file format at a later time. I personally think, however, that clipping and/or rotation should be done with an image processing program before or while running TeX. |
Note that scaling, etc., doesn't just apply to images: you might for example want to do that with a box of arbitrary content (think for example a 'zoomed in' blowup, or a logo-like rotation of text). |
OK I see the point for rotating text. For example too make vertical column headings for narrow columns with lengthy headings. An then it is probably the same effort implementing the rotation of arbitrary boxes. Rotating boxes in the viewer is simple. hitex would just need to compute the rotated dimensions of a box and continue as usual. |
on rotation, the macro layer already needs to do the trig and leave the actual space, so in practice it is enough if the back end just rotates the box content. So for latex+dvips for example, tex just sets a (typcally \rlap zero sized box) as usual. The rotation \special just locally changes the coordinate matrix with no feedback to the tex engine of the transformed coordinates so in
latex will already work out sin 30 and leave a box of the right size, it just needs a \special or hitex primitive to make the text rotate in the view. |
Asume a \vbox with a \par in it. hitex might not know the \hsize inside the box and because it will postpone the linebreaking, it will not know the height, the depth nor the width of the box. So computing sin 30 (how does LaTeX compute sin 30 ?) will not help much. Hitex has three kinds of boxes: normal boxes, boxes where it knows the natural dimensions and the viewer needs to set the glue ratio, and boxes where it knows nothing and the viewer has to do all the computations. Still rotating these boxes (and computing sin 30) is not a big problem for the viewer because in the viewer the line breaking is done anyway and the dimensions of the box are known. Would such a \HINTrotate primitive would work well with LaTeX? It's too late to add this in TL 2023, but it certainly could go into TL 2024 and could be available in the repository in a few month. |
It wouldn't work the same as other rotation back ends but I guess it will be workable (and probably necessary if you want to support delayed box dimensions). In general it's not clear how delayed box dimensions should work to be honest. On the main vertical list I can see it works well, If you experiment with some primitives in a branch here, we can certainly experiment with matching latex code, and hopefully have a plan in place for tl2024, certainly no need to rush something in to tl2023. |
Alignments with unknown box dimensions is still work in progress. But rotation is not an extra complication here. The HINT format specifies node types for such alignments with delayed layout but this is largely untested (still on my todo list). |
Linked to #5 in some ways, there are currently no details of how to scale/rotate content or to clip it. This can be done in some backends using dedicated support, and in others using general 'drawing' primitives (e.g. in pdfTeX where PDF provides such ideas). Although absolute graphics scale in HINT is not of the same importance as for other output formats, the relative sizes of content could well be important.
The text was updated successfully, but these errors were encountered: