octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #31468] multi-line text objects


From: Vanya Sergeev
Subject: [Octave-bug-tracker] [bug #31468] multi-line text objects
Date: Tue, 16 Aug 2011 14:17:28 +0000
User-agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1

Follow-up Comment #49, bug #31468 (project octave):

Attached is an additional fix, this time as a mercurial patch
txt_eng_ft_rendering.patch:

More pixel accurate opengl multi-line text alignment, and fixed previously
out-of-bounds unrendered pixels.

txt-eng-ft.cc: Accounted for the face->glyph->bitmap_left x offset in both
rendering and bounding box mode, which was previously ignored and occasionally
led to scrunched characters (bitmap_left < 0 -> x0 = 0) or a column of missing
pixels (bitmap_left > 0 -> ignored out of bounds pixels). Added comments
explaining some of the glyph rendering code.

To see an example of the difference, render "world" with the old code versus
the new code, you'll notice "wo" are a scrunched up with the old version, and
render properly with the new version.


graphics_toolkit("fltk");
plot([1,2,3,4,5]);
set(get(gca(), "title"), "string", "world");


-------

Also attached is an experimental patch for gl2ps rendering of the TrueType
rendered pixels for the multi-line text labels. Currently the xlabel and
ylabels are offset from their correct position. Perhaps pos(0),pos(1),pos(2)
need to be adjusted with the pixels bbox size. But I need to look into the
internal methods for converting the bbox matrix into the units used in gl2ps
rendering. I'm also unsure if this is a desired feature (using the rendered
pixels). I was thinking that if LaTeX rendering ever comes to the opengl
backend, using the rendered pixel array would give it for free to the gl2ps
converter. An alternative for now is also spacing multiple separate
gl2psTextOpt() labels, but I imagine things might messy when things like
rotation need to be implemented.

Here is a test demonstrating the rendered pixels and xlabel/ylabel offset:

graphics_toolkit("fltk");
plot([1,2,3,4,5]);
set(get(gca(), "title"), "string", {"hello", "world"});
set(get(gca(), "xlabel"), "string", {"abc", "def", "abcdef"});
set(get(gca(), "ylabel"), "string", {"abc", "def", "abcdef"});
print("test.png", "-dpng");


Rendered gl2ps_ft_render_pixels_test.png is attached.

Thanks,
~vsergeev


(file #23813, file #23814, file #23815)
    _______________________________________________________

Additional Item Attachment:

File name: txt_eng_ft_rendering.patch     Size:5 KB
File name: gl2ps_ft_pixels_rendering.patch Size:2 KB
File name: gl2ps_ft_render_pixels_test.png Size:19 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31468>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]