-
Notifications
You must be signed in to change notification settings - Fork 1
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
Detail graphic 'drawing' support #5
Comments
In the current version 2.0 HINT file format there is no support for drawing primitives. |
SVG support, if it also includes the necessary steps to pick up the co-ordinate system, would allow 'drawing' from within the TeX run. I guess from my POV, something very similar to the
(I've only used Note that as well as 'explicit' graphics (TikZ, etc.), the drawing primitives in other engines are used for things like decorating tables, fancy-looking boxes, etc., i.e. content that can't really be covered by creating a graphic externally and including it. |
I am not sure what "drawing from within the TeX run" means. Note that hitex postpones running the page builder and breaking paragraphs into lines until displaying the HINT file in the viewer and that the viewer does NOT contain a TeX interpreter. As a consequence, while hitex is running there is absolutely no information available about positions on the page (except that \eject will cause a new page (of unknown size) to start); and while hintview is running there is not a single TeX macros around that could be expanded. |
@ruckertm I am thinking of tools such as TikZ (or PSTricks). Under the hood, TikZ produces a series of \documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\pgfpathmoveto{\pgfpoint{0cm}{0cm}}
\pgfpathlineto{\pgfpoint{1cm}{1cm}}
\pgfpatharcaxes{0}{90}{\pgfpoint{2cm}{5mm}}{\pgfpoint{0cm}{1cm}}
\pgfusepath{draw}
\end{tikzpicture}
\end{document} the output contains* .....\hbox(0.0+0.0)x0.0, shifted -0.2
......\pdfsave
......\pdfliteral{0.3985 w}
......\pdfcolorstack 0 push {0 g 0 G}
......\pdfliteral{0 J}
......\pdfliteral{0 j}
......\pdfliteral{10 M}
......\pdfliteral{[] 0 d}
......\hbox(0.0+0.0)x0.0
.......\pdfliteral{0 0 m}
.......\pdfliteral{28.34647 28.34647 l}
.......\pdfliteral{28.34647 44.00177 2.96419 50.34735 -28.34647 42.51968 c}
.......\pdfliteral{S}
.......\pdfcolorstack 0 push {0 g 1.0 0.0 0.0 RG}
.......\pdfliteral{0 0 m}
.......\pdfliteral{1613.06963 1209.80222 l}
.......\pdfliteral{S}
.......\pdfcolorstack 0 pop
......\pdfrestore
......\pdfcolorstack 0 pop when using pdfTeX. (* The actual output here is from As you can see, this is a collection of PDF primitives inside a box of fixed size. |
If a viewer has a pdf interpreter anyway, adding pdf code to the TeX output file is not an issue. HINT viewers do neither have/require a PS nor a pdf interpreter. Specifying such a mini-pdf language would be an (unnecessary) burden to any HINT viewer. So I look for an existing graphics language (SVG ?) and adding an existing interpreter for it to the HINT viewer. The burden is then on the hitex side, because it would need to translate something like \pgfpatharcaxes ... into e.g. SVG. |
couldn't you provide a \special that basically just pushed a path to openGL? that is line rather than bezier curve based but doing the extra arithmetic wouldn't be too much I think, something like https://www.geeksforgeeks.org/bezier-curves-in-opengl/ ? |
Yes I could extend hitex by implementing \HINTline and \HINTbezier and a couple more primitives, but where would it end. I could extend it by implementing \HINTdraw which would write a string in some syntax to the output file and leave it to the viewer to parse that string and do something with it. But in both cases I would implement some mini-language for drawing and an interpreter for it mapping the language to OpenGL. |
I should have been clearer: I was highlighting an example of 'TeX input to backend output'. For pdfTeX, that's PDF, for classical TeX it's PostScript, for HiTeX presumably it would be SVG. We already have code for SVG production with |
Currently, the manual gives no information on what type of 'drawing' support is available via
\special
. Other backends offer some approach to creating basic constructs such as lines, paths, fills, etc.The text was updated successfully, but these errors were encountered: