Text/PDF Color, Themes, & Highlighting

Zeniff
2012-06-01
2013-04-16
  • Zeniff
    Zeniff
    2012-06-01

    Hi!
    I was wondering about 3 things related to colors as possible suggestions…

    1. Customization for background/foreground colors of the text file panel?

    2. Ability to invert colors on the PDF viewer, like evince does via Ctrl-I?

    3. Syntax highlighting in text file panel?

    I like dark colors on my screen, since bright white backgrounds really strain my eyes.  I could use Compiz and its plugin which inverts screen/window colors, but that makes the rest of Eagle Mode ugly IMO.  I rather like EM's default theme, but viewing text or PDFs is kind of hard to do for me unless I use an external viewer which can show it darker (which is easy thanks to the DefaultFor property :) ).

    I know you recently added themes, which I really like, but I couldn't find any mention for colors of text and background of the text or PDF file panels in the theme files.  Is it possible you might add that in the future?

    I found these in /src/emText/emTextFilePanel.cpp :
            static const emColor textBgColor(255,255,255);
            static const emColor textFgColor(0,0,0);
            static const emColor textFgColor96(textFgColor,96);

    I'm not a programmer, but I tried swapping the first two variable values, compiled it and it seems to work as I hoped.  But, I didn't change "textFgColor96" because I couldn't think of what it might do?

    As for syntax highlighting, I was sort of able to make it work in a plugin by outputting into postscript a text file using a program called "highlight" and then converting that with EM's Abiword temporary conversion plugin.  It works okay, but I don't know how to get a dark background on the PDF viewer.

    Do you know if you might include/change any features/abilities related to these in the future?

    Anyway, thanks for making a wonderful program!!! Have a great day!! :D

     
  • Oliver Hamann
    Oliver Hamann
    2012-06-01

    I will take your suggestions into consideration.

    For inverting PDF permanentely, you can change line 275 in src/emPdf/emPdfServerProc.c from:
        v=*(unsigned int*)ps;
    to:
        v=-1^*(unsigned int*)ps;

    Leaving textFgColor96 unchanged is correct, because it is calculated from textFgColor with some alpha blending. It is used as the foreground color when text lines are shown as rectangles because of a very small display on the screen.

     
  • Zeniff
    Zeniff
    2012-06-02

    Wow, thank you very much!!!  That worked perfectly!  :D

    After making your suggested change, I also made using the PDF to PS temporary conversion plugin so that I can see the original non-inverted file in an Alternative Content Panel if needed.

    Unimportant EDIT for what I said about syntax highlighting:  I originally got it to work by outputting a highlighted RTF file, not a postscript, sorry.  It was the Abiword temporary conversion plugin code which changed it to postscript.  Also, I just today got it to output onto a dark background in EM by outputting it to SVG format instead of RTF.  Although it produces only one long page, I'm still satisfied with the result, especially since it also displays CJK characters correctly! :D

    Thanks again! :)