Mercurial > hg > octave-lyh
changeset 16206:9ba5c5ed3aeb
Add new verticalalignment option 'cap' for OpenGL plotting.
* libinterp/interp-core/txt-eng-ft.cc(ft_render::text_to_pixels): Implement new
'cap' vertical alignment which is glyph_max_height - glyph_descender_height. This
approximates height of a capital letter.
* libinterp/interpfcn/graphics.cc (text::properties::update_text_extent):
Add 'cap' to if/else if/ tree checking possible verticalalignment options.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 06 Mar 2013 15:10:22 -0800 |
parents | 92f8bfae9b13 |
children | 0467d68ca891 |
files | libinterp/interp-core/txt-eng-ft.cc libinterp/interpfcn/graphics.cc |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/interp-core/txt-eng-ft.cc +++ b/libinterp/interp-core/txt-eng-ft.cc @@ -650,6 +650,7 @@ case 1: box(1) = -box(3)/2; break; case 2: box(1) = -box(3); break; case 3: break; + case 4: box(1) = -box(3)-box(1); break; } switch (rot_mode)
--- a/libinterp/interpfcn/graphics.cc +++ b/libinterp/interpfcn/graphics.cc @@ -7022,12 +7022,14 @@ else if (horizontalalignment_is ("right")) halign = 2; - if (verticalalignment_is ("top")) + if (verticalalignment_is ("middle")) + valign = 1; + else if (verticalalignment_is ("top")) valign = 2; else if (verticalalignment_is ("baseline")) valign = 3; - else if (verticalalignment_is ("middle")) - valign = 1; + else if (verticalalignment_is ("cap")) + valign = 4; Matrix bbox;