4

We are trying to solve How to get intersection point(s) of two glyphs? and there are some interesting subtasks. In word cloud algorithms they are converting glyphs (a vector form) to a raster form and they apply some algorithm (using spiral or other path) to position the glyphs/words/terms.

Are we able to do the same in the TeX world? We can convert resulting PDF file to raster graphics easily (GhostScript, ImageMagick, GraphicsMagick), or, we could use TikZ+externalization library. Well we are not processing them at a pixel level as we are able to do, e.g. in the GD library + PHP scripting language.

I've checked Lua rocks and it doesn't look we have a lot of options there to process bitmapped pictures. The only useful tool seems to be LuaGL, but it looks as a complicated tool. I'm thinking of Python and its packages, but that's a different story if we would like to try calculations on-the-fly.

One more time, I'm sorry I'm not providing MWE. It's likely I'm just searching for a proper Lua library. Lua is used in the game industry, they probably have a lot of useful libraries.

My very last idea is to use JavaScript which can be loaded into the PDF file. I'm not using this approach as I know it's browser-dependent.

For now, after I get a raster graphics I use ImageMagick, I modify the files, and then I'm loading the resulting pictures back at a TeX level.

  • I am not sure whether you want to save TeX box as image, or you want to load existing image with LuaTeX and work with it, or you want to process TeX boxes as images? – michal.h21 Jun 4 '14 at 15:57
  • @michal.h21 In a way, I'd like to convert glyphs (any typesetted material in general) to a bitmapped graphics and work with it at the pixel level on-the-fly. – Malipivo Jun 4 '14 at 18:38
  • 2
    Take a look at the pullquote package, see tex.stackexchange.com/a/70169/86, as I think that does something like that. – Loop Space Jun 4 '14 at 21:15
  • 1
    My answer here, tex.stackexchange.com/questions/313880/…, slices glyphs with a \clipbox and "operates" on each slice. It is not, to my mind, efficient, and may not even be in the same ballpark with your problem. But I mention it anyhow. – Steven B. Segletes Jul 21 '17 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.