3

I try to convert Pascal-Code Files to an image (jpg, png) an find pongo-view as a good solution. Is there a way to add syntax-highlighting in the Output files?

I am happy about any hints :) Thanks

thiemol
  • 61
  • 4

1 Answers1

3

I found an old repo to add syntax highligthing with pango markup (https://github.com/LinuxJedi/pango-syntax-highlighter/). So the new one can now convert Pascal files to images with syntax highligthing.

https://github.com/thiemol/pango-syntax-highlighter

python3 pangosyntaxhighlight.py cpp myfile.cpp output.txt && pango-view --markup --font=mono -qo image.png output.txt

Works with:C,C++,Java, Go', Python,Scala, GLShaderLexer, xml. Now also with Delphi/Pacal, PhP. You can simple add the right lexer.

enter image description here

thiemol
  • 61
  • 4