Dear all,

Some months ago I wrote a patch for xournal which makes line endings 
more beautiful.

I had already uploaded the patch to sourceforge 
(https://sourceforge.net/p/xournal/patches/82/) (and had a little mail 
exchange with Denis about it); now I just saw in some readme file that I 
should rather discuss things here, so here I am.


Let me describe the patch in some detail:

- One thing which makes variable-width lines in xournal somewhat less 
beautiful than e.g. those in inkscape is that the pen pressure at the 
very end of the lines is not taken into account. This is the main thing 
that I intended to improve.

- It turned out that the result was ugly: The pen pressure at the ends 
is often close to zero, with the effect that near the end, the lines 
changed from normal-thick to very thin apruptly. Therefore, I also 
implemented that lines are drawn in a way so that thickness varies 
continuously, by drawing each segment as a trapeze.

- This looked very good, but it made xournal unusably slow on large and 
complicated files. Therefore, I made a third change, namely drawing 
trapezes only when "it's worth it", i.e., the line width changes by a 
sufficient amount. And since I was already implementing such kind of 
optimization, I also changed xournal to draw consecutive line segments 
in a single stroke when they have almost the same thickness. The outcome 
is that the patched xournal is now a lot faster than the original one. 
(Also, the produced pdf files tend to open faster in pdf viewers, though 
that seems less consistent.)

- Another problem of the patch is how files are saved: The current 
version of xournal doesn't save the line thickness at the beginning and 
the end, and instead uses the first (*and* the last (?)) thickness value 
to store the pencil width. I see two sensible solutions to that:

(a) What I did now: store the pencil width separately and use the 
thickness values to store the actual line thickness.

(b) Store the first and last line thickness separately.


(a) is obviously the cleaner solution. However, (b) is more backward 
compatible: When using (b), old xournal version are able to open files 
created by the new version without any problems (with only the side 
effect that the line endings will become ugly again). (In both cases, 
the new version can deal properly with old files, by checking whether 
that separately stored information is there or not.)



Any wishes what I should do with this?

Things I can do:

- I noticed that I used the wrong git repository (with experimental 
stuff) to implement the patch, but I can move it to the non-experimental 
one.

- If the above (b) is preferred, I can change it accordingly. (By now I 
think I prefer (b).)

Best,
      Immi



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Xournal-devel mailing list
Xournal-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xournal-devel

Reply via email to