In gimp_text_layout_render() do a cairo_save/restore() around drawing
the (possibly offset and transformed) text, so we can later get the
rendered path from cairo_copy_path() relative to the original coords
and not relative to the offset and transformed coords.
Move the code that adjusts the layout's x-offset for fixed-width text
boxes and RTL, centered- and right justified text. It was living in
gimp_text_layout_render() and was correctly applied at rendering time,
so everything looked fine. Move it to gimp_text_layout_position() so
it becomes part of the layout's permanent properties, is reported by
gimp_text_layout_get_offsets() and thus used by the text tool which
can draw cursor and selection at the right place.
* app/text/gimptextlayout-render.c: remove private function which
creates the transform matrix.
* app/text/gimptextlayout.[ch]: add it here as public API. Also add
function which transform and untransform PangoRectangles, points and
distances using the transform matrix.
* app/tools/gimptexttool.c: convert coordinates using above new
transform functions when drawing selection and cursor, and when
processing mouse events.
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-11-04 Sven Neumann <sven@gimp.org>
* app/text/Makefile.am
* app/text/gimptext-private.h: removed this header file.
* app/text/gimptextlayout.[ch]: added getters to access the
resolution, text and PangoLayout.
* app/text/gimptextlayout-render.c
* app/tools/gimptexttool.c: use the new getters instead of
poking
into the GimpTextLayout struct.
svn path=/trunk/; revision=27543
2008-11-04 Sven Neumann <sven@gimp.org>
* app/text/Makefile.am
* app/text/gimptext-bitmap.[ch]: removed.
* app/text/gimptext-private.h
* app/text/gimptext-vectors.c
* app/text/gimptextlayer.c
* app/text/gimptextlayout-render.[ch]
* app/text/gimptextlayout.c: removed text render abstraction as
this is now sufficiently provided by PangoCairo.
svn path=/trunk/; revision=27542
2008-10-30 Sven Neumann <sven@gimp.org>
* app/text/gimptextlayout-render.c: removed an obsolete and
misleading comment.
svn path=/trunk/; revision=27480
2008-10-27 Sven Neumann <sven@gimp.org>
* libgimpbase/gimpbaseenums.[ch]: added new enum
GimpTextHintStyle.
* libgimp/gimpenums.c.tail
* tools/pdbgen/enums.pl: regenerated.
* app/text/gimptext.[ch]: added new property "hint-style".
Removed
"autohint" property and mapped the boolean property "hinting" to
the new enum property "hint-style".
* app/text/gimptextlayout-render.c
(gimp_text_layout_render_flags):
use "hint-style".
* app/tools/gimptextoptions.[ch]: changed tool options
accordingly.
* tools/pdbgen/pdb/text_layer.pdb: deprecated the "hinting" API
and introduced getters and setters for "hint-style".
* app/pdb/text-layer-cmds.c
* app/pdb/internal-procs.c
* libgimp/gimptextlayer_pdb.[ch]: regenerated.
svn path=/trunk/; revision=27432
2008-10-26 Michael Natterer <mitch@gimp.org>
Merge on-canvas GSoC project:
* configure.in: check for pangocairo.
* app/Makefile.am
* app/text/Makefile.am: add its CFLAGS and LIBS.
* app/text/gimptext-bitmap.[ch]
* app/text/gimptext-private.h
* app/text/gimptext-vectors.[ch]
* app/text/gimptextlayer.c
* app/text/gimptextlayout-render.c
* app/text/gimptextlayout.c: port to pangocairo.
* menus/Makefile.am
* menus/text-tool-menu.xml
* app/menus/menus.c
* app/actions/Makefile.am
* app/actions/actions.c
* app/actions/text-tool-actions.[ch]
* app/actions/text-tool-commands.[ch]: add a context menu for the
text tool similar to GtkEntry's context menu.
* app/tools/gimprectangletool.[ch]: add "narrow-mode" property.
* app/tools/gimptextoptions.[ch]
* app/widgets/gimptexteditor.[ch]: take a text buffer for the
standalone text editor window instead of creating one internally.
* app/tools/gimptexttool.[ch]: all the new wonderful on-canvas
text editing logic. Wheee!
svn path=/trunk/; revision=27419
2008-08-20 Michael Natterer <mitch@gimp.org>
* app/text/gimptextlayout-render.c (gimp_text_layout_render): add
PANGO_ALIGN_LEFT to the switch to fix warning about unhandled value.
svn path=/trunk/; revision=26682
2008-08-15 Daniel Eddeland <danedde@svn.gnome.org>
* app/text/gimptextlayout-render.c: make text align correctly if
text-box is FIXED.
svn path=/trunk/; revision=26580
2008-07-27 Sven Neumann <sven@gimp.org>
* app/text/gimptext-compat.c (text_get_extents)
* app/text/gimptextlayout-render.c (gimp_text_layout_render):
use the readonly variant of pango_layout_iter_get_line().
svn path=/trunk/; revision=26323
2003-12-16 Michael Natterer <mitch@gimp.org>
* app/text/gimptextlayout-render.c (gimp_text_layout_render):
multiply the layout's offsets with PANGO_SCALE, not -PANGO_SCALE.
Fixes bug #129405.
2003-11-08 Sven Neumann <sven@gimp.org>
* app/text/gimptextlayout-render.c (gimp_text_layout_render)
* app/text/gimptextlayout.c (gimp_text_layout_position): handle
the case where the ink rectangle exceeds the logical rectangle.
Fixes bug #126480.
2003-10-01 Sven Neumann <sven@gimp.org>
* app/text/gimptextlayout.c: pango_font_description_set_size()
takes points not pixels as the old code assumed.
* app/text/gimptext.c
* app/text/gimptextlayout-render.c: fixed includes.
2003-08-15 Sven Neumann <sven@gimp.org>
* app/text/Makefile.am
* app/text/gimptextlayer-transform.[ch]: new files that hold yet
unused GimpItem transform methods.
* app/text/gimptextlayer.[ch]: export gimp_text_layer_render().
* app/text/gimptext-bitmap.[ch]
* app/text/gimptext-private.h
* app/text/gimptext-vectors.c
* app/text/gimptextlayout-render.c: use the transformation matrix.
This doesn't change anything since it's still always the identity
matrix.
2003-07-22 Sven Neumann <sven@gimp.org>
* app/text/gimptext-bitmap.c
* app/text/gimptextlayout-render.c: define FT_LOAD_TARGET_MONO to
FT_LOAD_MONOCHROME if it is undefined. This avoids a dependency on
recent versions of Freetype (bug #118066).
2003-07-20 Sven Neumann <sven@gimp.org>
Generalized text rendering and added a framework for creating
GimpVectors objects with text outlines.
* app/text/Makefile.am
* app/text/gimptext-bitmap.[ch]: new files with bitmap render
function.
* app/text/gimptext-vectors.[ch]: new files for rendering to
vectors.
* app/text/gimptextlayout-private.h: removed ...
* app/text/gimptext-private.h: ... and readded with this name.
* app/text/gimptextlayout-render.[ch]: reduced to the generic parts
of text rendering.
* app/text/gimptextlayer.c
* app/text/gimptextlayout.c: changed accordingly.
2003-07-06 Sven Neumann <sven@gimp.org>
* app/text/Makefile.am
* app/text/gimptextlayout-private.h
* app/text/gimptextlayout-render.[ch]: new files that implement
text rendering. Right now it's basically code copied from PangoFT2
but having it here will allow me to implement text transformations.
* app/text/gimptextlayout.[ch]
* app/text/gimptextlayer.c: changed accordingly.