Commit Graph

61 Commits

Author SHA1 Message Date
Nikc b48286009e Issue #2509: Adding support for 'locl' in Text Tool 2022-03-09 17:53:19 +00:00
Adam Fontenot 00bbeabaf4 Issue #6210: Subpixel font rendering system settings should only…
… apply to GIMP GUI not text layer rendering in image.

Reviewer note: this is the theoretical fix, but it won't work right now
because Cairo explicitly bypasses grayscale antialiasing when system set
subpixel one. Still let's push this first patch, but the issue will be
actually fixed when Cairo will merge my MR too:
https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/114
2021-01-19 13:47:27 +01:00
ONO Yoshio 587d9bbb03 MR !19: Add support for vertical text writing.
Squashed commit of the following:

commit ee1ff7d502658cfa1248a13a3f0348495db07eda
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Sun Jul 29 00:31:47 2018 +0900

    Fixed that gimp-text-dir-ttb-* icons are lacked in Symbolic.

commit d87d012d697628da28fe90199cc04b95b72ba8ef
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Sat Jul 28 16:23:10 2018 +0900

    Fix a typo.

commit cf0238bf7df56c384cdf3b7ec69557d14740f853
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Sat Jul 28 15:50:57 2018 +0900

    Fixed seg fault error.

commit b07f60d06f
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Fri Jul 27 17:15:34 2018 +0900

    Add support for vertical text writing.

    https://gitlab.gnome.org/GNOME/gimp/issues/641
2018-07-30 19:14:49 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 1415a78fa1 Bug 774383 - Text layer created by gimp-text-fontname doesn't...
...respect border when resized

gimp_text_layout_new(): in FIXED box mode, subtract (2 * border) when
setting the layout width.
2016-11-15 13:23:00 +01:00
Massimo Valentini 4eef125153 Bug 766706: Deleting text layer content does not clean canvas 2016-06-27 16:48:14 +02:00
Jehan 2aabbbd9c7 Bug 662787 - Segfaults when trying to set a large text size
If a font size is too big for cairo or pango to deal with, nicely back
up from rendering and alert the user via an error dialog.
2013-10-24 20:23:51 +13:00
Michael Natterer 3ad73b3658 libgimpcolor: add GdkPixbuf <-> GeglBuffer utility functions
and update tons of includes in libgimp and app.
2012-05-03 03:37:20 +02:00
Massimo Valentini 39368a410d plugged memory leaks 2012-02-07 17:32:02 +01:00
Michael Natterer f09360ba80 app: GimpTextLayout: use the unit conversion functions from gimpunit.[ch]
instead of duplicating them. Multiply by PANGO_SCALE in the callers
and ceil() fixed text box pixel extents so we don't cut off stuff by
fractions of a pixel.
2011-03-18 21:39:28 +01:00
Michael Natterer f13abfa3f0 app: change image parameter in gimp_text_layout_new() to xres,yres
Because GimpTextLayout doesn't depend on any image, it only needs a
resolution.
2011-03-18 02:31:20 +01:00
Michael Natterer 77a5999f13 Bug 634315 - gimptextlayout.c: typo in assignment 2010-11-25 00:04:41 +01:00
Michael Natterer dcdc09872d Bug 631934 - Interaction between Old text parameters and new region specific text attributes
This patch inserts GimpText's property values as attributes into the
rendered markup and work transparently for both the tool options and
the text PDB API.
2010-10-29 04:45:12 +02:00
Barak Itkin 8cf6695a50 Fix Bug 631742 - Can't change color of first letter
Fix the bug by making sure we set the base color before setting the markup which
contains color for specific regions. This is a temporary fix, it solves Bug
631742 and introduces a less critical bug (which is described as part of Bug
631934) that will be solved with upcoming design changes.
2010-10-12 02:13:28 +02:00
Sven Neumann d96b491050 Update use of Pango API and bump required version to 1.22.0
Uodate Pango required version and stop using the deprecated
pango_cairo_font_map_create_context(). Compile with
PANGO_DISABLED_DEPRECATED for pango < 1.30.
2010-09-07 00:53:17 +02:00
Michael Natterer 3759b3f0d1 app: render the text layout directly into the layer's pixels
instead of using a mask. Enables color tags. Set the default color
from the text object using a pango color attibute and factor out
GimpTextLayout attribute setting into a utility function.
2010-09-01 23:30:40 +02:00
Michael Natterer e22e881a9c app: more optional debug output (in #ifdef VERBOSE) 2010-03-28 20:46:23 +02:00
Michael Natterer 13cbdabcc3 app: fix publically reported layout offset for a couple of cases
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.
2010-03-11 20:58:11 +01:00
Michael Natterer 1d74c1f9cf app: don't overwrite all markup-set attributes with letter_spacing
if letter_spcaing is enabled. Instead add its attribute to the ones
which are already there.
2010-03-03 10:18:31 +01:00
Michael Natterer db6a669c4b app: add "markup" property to GimpText
And prefer it over "text" when rendering. Everything is exactly as
before if "markup" is never set.
2010-02-26 01:27:05 +01:00
Michael Natterer 0908e53148 app: use the new unit conversion functions
and get rid of the brainfuck idea that app/ has to use _gimp_unit_foo()
functions, passing a gimp pointer. Instead, simply use the libgimpbase
API all over the place. Should we ever allow more than one gimp instance,
they will simply have to share one unit database.
2010-02-21 16:46:39 +01:00
Tor Lillqvist 347d8db5d1 Explicitly ask for a FT font map for the text tool
Call pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT)
instead of pango_cairo_font_map_new ().

This avoids a crash on Windows where the default font map is for
CAIRO_FONT_TYPE_WIN32. For the text tool we want freetype and
fontconfig -based fonts.

This requires using a cairo that includes the freetype backend, and a
pango that has been built against such a cairo. That is not yet the
case for the "official" Windows binaries of cairo and pango, but I
will make it so in the future.
2009-08-27 00:08:22 +03:00
Michael Natterer afb8d07fcf Use PANGO_WRAP_WORD_CHAR so we don't cut off words which are wider than the layer 2009-06-27 21:10:34 +02:00
Michael Natterer 2a88723a40 Bug 573256 - Text tool appearance doesn't account for DPI
* 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-06-19 17:08:34 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
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
2009-01-17 22:28:01 +00:00
Sven Neumann 2409d06ddb app/text/Makefile.am removed this header file.
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-03 23:44:19 +00:00
Sven Neumann 7dc80b79be app/text/Makefile.am removed.
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-11-03 23:25:05 +00:00
Sven Neumann c214f41285 fixed order of includes.
2008-10-30  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextlayout.c: fixed order of includes.

	* app/text/gimptext-compat.c: ported to PangoCairo like the rest
	of the text rendering code.


svn path=/trunk/; revision=27481
2008-10-30 22:17:52 +00:00
Sven Neumann 63f6dcb111 use the Y resolution when creating the fontmap.
2008-10-27  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextlayout.c (gimp_text_get_pango_context): use 
the
	Y resolution when creating the fontmap.


svn path=/trunk/; revision=27436
2008-10-27 08:20:02 +00:00
Michael Natterer ee414d9e6f Merge on-canvas GSoC project:
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-10-26 17:39:55 +00:00
Michael Natterer 5503e6a055 Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h had a
2008-10-09  Michael Natterer  <mitch@gimp.org>

	Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
	had a GEGL dependency (they will have in the next commit, but I
	wanted to keep the commit separate).

	* app/dialogs/Makefile.am
	* app/file/Makefile.am
	* app/gui/Makefile.am
	* app/menus/Makefile.am
	* app/paint/Makefile.am
	* app/plug-in/Makefile.am
	* app/text/Makefile.am
	* app/vectors/Makefile.am
	* app/widgets/Makefile.am
	* app/xcf/Makefile.am: add GEGL_CFLAGS.

	* app/actions/*.c
	* app/core/*.c
	* app/dialogs/*.c
	* app/display/*.c
	* app/file/*.c
	* app/gui/*.c
	* app/menus/*.c
	* app/paint/*.c
	* app/pdb/gimppdb-utils.c
	* app/pdb/gimpprocedure.c
	* app/plug-in/*.c
	* app/text/*.c
	* app/tools/*.c
	* app/vectors/*.c
	* app/widgets/*.c
	* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
	to all files which include a drawable subclass or gimpimage.h

	* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
	in all generated files.

	* app/pdb/*-cmds.c: regenerated.

	* data/images/gimp-splash.png: the goat is still sleeping.
	By Aurore Derriennic.


svn path=/trunk/; revision=27202
2008-10-09 20:24:04 +00:00
William Skaggs 98e0671a85 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/text/gimptextlayout.c
	* app/tools/gimptexttool.[ch]
	* app/tools/gimprectangletool.[ch]
	* app/tools/gimptextoptions.c: allow resizing of text
	box.  This is work in progress, and needs some tweaks
	and fixes.  See bug #122707.

svn path=/trunk/; revision=25344
2008-04-02 21:32:32 +00:00
Simon Budig 340cd2f8e6 app/text/gimptext-private.h app/text/gimptextlayout.c Fix text rendering
2007-07-17  Simon Budig  <simon@gimp.org>

	* app/text/gimptext-private.h
	* app/text/gimptextlayout.c
	* app/text/gimptextlayout-render.c: Fix text rendering for xres != yres.


svn path=/trunk/; revision=22943
2007-07-17 11:00:56 +00:00
Michael Natterer 83d3a750d4 include "libgimpmath/gimpmathtypes.h" instead of "libgimpmath/gimpmath.h".
2007-03-09  Michael Natterer  <mitch@gimp.org>

	* app/core/core-types.h: include "libgimpmath/gimpmathtypes.h"
	instead of "libgimpmath/gimpmath.h".

	* app/core/gimpbrush.h
	* app/paint/gimppaintcore.h
	* app/paint/gimpperspectiveclone.h
	* app/text/gimptext.h
	* app/tools/gimptransformtool.h: include gimpvector.h and
	gimpmatrix.h explicitely where they are needed in public structs.

	* app/*/*.c
	* tools/pdbgen/pdb/paths.pdb: include "libgimpmath/gimpmath.h"
	where needed.

	* app/pdb/paths_cmds.c: regenerated.


svn path=/trunk/; revision=22084
2007-03-09 13:00:01 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Sven Neumann 6ebcf700d1 removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15  Sven Neumann  <sven@gimp.org>

	* app/*/*.c:
	* lib*/*.c: removed erroneous semicolon after G_DEFINE_TYPE macros.
2006-05-15 09:46:31 +00:00
Michael Natterer 0d4a10fee4 app/config/*.c app/core/*.c app/display/*.c app/text/*.c port to
2005-12-10  Michael Natterer  <mitch@gimp.org>

	* app/config/*.c
	* app/core/*.c
	* app/display/*.c
	* app/text/*.c
	* app/vectors/*.c: port to G_DEFINE_TYPE() and friends. Some related
	core reordering and cleanup.
2005-12-10 19:24:36 +00:00
Sven Neumann c3754839d4 app/text/gimptextlayout.[ch] allow to adjust letter-spacing.
2005-03-02  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextlayout.[ch]
	* app/tools/gimptextoptions.h: allow to adjust letter-spacing.
2005-03-02 12:54:54 +00:00
Manish Singh 4bfb3e26a5 new function to workaround pango bug #166540, by tacking on a ',' to font
2005-02-09  Manish Singh  <yosh@gimp.org>

        * app/text/gimpfont-utils.[ch]: new function to workaround pango
        bug #166540, by tacking on a ',' to font names that end in numbers,
        so pango_font_description_from_string doesn't interpret it as a size.

        * app/text/Makefile.am: add above files.

        * app/text/gimpfontlist.c
        * app/text/gimptext-compat.c: use new function.

        * app/text/gimptext-xlfd.c: also make sure font names pulled out
        from XLFD don't end in numbers.

        * app/text/gimpfont.c
        * app/text/gimptextlayout.c: remove some redundant checks.
2005-02-10 05:33:01 +00:00
Sven Neumann 6d73b20387 workaround Pango bug #143542 (PangoFT2Fontmap leak, see also bug #148997).
2004-09-22  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextlayout.c (gimp_text_get_pango_context):
	workaround Pango bug #143542 (PangoFT2Fontmap leak, see also bug
	#148997). Based on a patch by Robert gren.
2004-09-21 22:39:07 +00:00
Sven Neumann e9bc82c676 fixed text positioning for fonts where glyphs extend the logical rectangle
2004-01-25  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextlayout.c (gimp_text_layout_position): fixed
	text positioning for fonts where glyphs extend the logical
	rectangle (bug #132495).
2004-01-25 21:06:01 +00:00
Sven Neumann 4800d849ef app/text/gimptextlayout-render.c (gimp_text_layout_render) handle the case
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-11-08 18:36:49 +00:00
Sven Neumann c0ebe2a8a3 app/text/Makefile.am new files that load and save text layers to/from XCF.
2003-10-27  Sven Neumann  <sven@gimp.org>

	* app/text/Makefile.am
	* app/text/gimptextlayer-xcf.[ch]: new files that load and save
	text layers to/from XCF.

	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* app/text/gimptextlayer.c: removed that code here and use the new
	functions instead.

	* app/text/gimptext-parasite.[ch] (gimp_text_from_parasite): added
	a GError parameter.

	* app/text/gimptextlayer.[ch]: store the name of the parasite that
	the text layer was created from (if read from XCF). Remove the
	parasite when the text layer is edited. If a text layer wasn't
	touched, the original parasite is written back to the XCF file.

	* app/text/gimptextlayout.c (gimp_text_layout_new): handle a NULL
	text string.

	* app/tools/gimptextoptions.c: implement GimpToolOptions::reset
	and save the text across a reset.
2003-10-27 21:50:41 +00:00
Sven Neumann 142d0725ce app/text/gimptext.[ch] added back "box-unit" property; it makes sense to
2003-10-26  Sven Neumann  <sven@gimp.org>

	* app/text/gimptext.[ch]
	* app/text/gimptextlayout.c: added back "box-unit" property; it
	makes sense to have an extra unit for it.
2003-10-26 12:07:05 +00:00
Sven Neumann d533104de7 handle negative float and double values similar to how this is done for
2003-10-26  Sven Neumann  <sven@gimp.org>

	* app/config/gimpconfig-deserialize.c
	(gimp_config_deserialize_fundamental): handle negative float and
	double values similar to how this is done for integers and the
	like.

	* app/config/gimpconfig-params.h: added two new param flags and
	documented all flags in the header file (for now).

	* app/config/gimpconfig-serialize.h: handle the new param flags
	GIMP_PARAM_DEFAULTS and GIMP_PARAM_IGNORE.

	* app/text/text-enums.[ch]
	* app/text/gimptext.[ch]: added some properties that we will need
	sooner or later. Mark the new properties and a lot of the existing
	ones as GIMP_PARAM_DEFAULTS so that their values are not
	serialized unless changed from the default value.

	* app/text/gimptextlayout.c
	* app/tools/gimptextoptions.c: made all length properties in
	GimpText depend on a single unit.
2003-10-26 00:03:16 +00:00
Sven Neumann 74187d7d65 pango_font_description_set_size() takes points not pixels as the old code
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-10-01 11:52:52 +00:00
Sven Neumann ce54744b8a Generalized text rendering and added a framework for creating GimpVectors
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-20 21:23:01 +00:00
Sven Neumann 7cf24c4f86 app/text/Makefile.am app/text/gimptextlayout-private.h new files that
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.
2003-07-06 18:43:58 +00:00
Sven Neumann 6b581cc500 app/text/text-enums.[ch] app/text/gimptext.[ch] added some more text
2003-04-09  Sven Neumann  <sven@gimp.org>

	* app/text/text-enums.[ch]
	* app/text/gimptext.[ch]
	* app/text/gimptextlayout.c: added some more text properties that
	can't be accessed from the GUI yet.
2003-04-09 21:19:12 +00:00
Sven Neumann a93e91f38e themes/Default/images/Makefile.am
2003-03-31  Sven Neumann  <sven@gimp.org>

	* themes/Default/images/Makefile.am
	* themes/Default/images/stock-text-dir-ltr-24.png
	* themes/Default/images/stock-text-dir-rtl-24.png: placeholders
	for new icons.

	* libgimpwidgets/gimpstock.[ch]: register the new icons.

	* themes/Default/gtkrc: tweak GtkDialog in "gimp-default-style".

	* app/text/text-enums.[ch]
	* app/text/gimptext.[ch]
	* app/text/gimptextlayout.c: added new enum GimpTextDirection and
	use it instead of PangoDirection.

	* app/widgets/widgets-types.h
	* app/widgets/gimptexteditor.[ch]: made GimpTextEditor a real widget
	and added buttons to switch the text direction.

	* app/tools/gimptextoptions.[ch]
	* app/tools/gimptexttool.c: moved creation of the text editor to the
	text tool options, take care of GimpText::base-direction here.
2003-03-31 15:10:15 +00:00