Commit Graph

21 Commits

Author SHA1 Message Date
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 822a7228c4 Bug 794221 - Recently used colors on text don't get added to the color history
Add signal GimpTextBuffer::color-applied which is emitted when text is
inserted or when color is applied to a span of text.

In GimpTextTool, connect to the signal and update the global color
history.

Unrelated: rename gimp_text_tag_get_color() to get_fg_color() and add
boolean return values to get_fg_color() and get_fg_color() which
indicates if a color is set on the tag at all. This ended up unneeded
in the fix but is an improvement regardless.
2018-03-23 14:19:01 +01:00
Jehan cd641fa14f app: create separate tag lists for IME preedit colors.
In particular, I don't want the preedit foreground colors to be
displayed in the text style editor UI. They are only temporary hints
and should not be taken into account as user-chosen style.
2016-06-01 17:44:03 +02:00
Jehan a86b0cf0a2 app: create a different tag for underlined text during preedit.
It still shows up as underlined during preedit, but does not toggle the
underline button in the style editor.
2016-06-01 17:43:56 +02:00
Jehan f1dbd57d49 app: GimpText can be set background colors.
There is nothing in our UI to set background color to text, but this
can be used internally, for instance to display input method's preedit
texts with specific colors.
2016-06-01 17:43:25 +02:00
Michael Natterer 9f0e27307e app: change filename in gimp_text_buffer_load() and _save() to GFile 2014-07-02 15:10:53 +02:00
Michael Natterer abd2e78bdf Bug 683011 - Text tool discards text attributes in the on-canvas dialog...
When font, size or color were changed, set the text buffer's current
insert_tags just as we already do for the bold, italic etc. toggle
buttons.  Changed gimp_text_style_editor_list_tags() to also return
the tags for font, size or color.
2012-11-09 23:06:45 +01:00
Michael Natterer ad819263af Bug 620674 - Adding support for multi-colored text layer
Apply slightly modified patch from Barak Itkin that adds colors for
text spans plus GUI to edit these colors.
2010-09-02 00:20:04 +02:00
Michael Natterer 91cce1c81b app: add size control for text spans, does not work as expected yet 2010-03-28 21:38:31 +02:00
Michael Natterer f766215548 app: add baseline and kerning controls to the style editor overlay
Involves adding GimpTextBuffer API to *set* baseline and kerning (as
opposed to changing it relatively from what it was).
2010-03-04 14:33:19 +01:00
Michael Natterer bbd2d521f1 app: rename "spacing" to "kerning" because that's what it does 2010-03-03 10:48:42 +01:00
Michael Natterer 9a9d7489d1 app: make undo compression in the text tool work again
- in GimpText, make "text" and "markup" mutually exclusive, so that
  whenever one is set to non-NULL, the other is cleared automatically.
- add gimp_text_buffer_has_markup() which returns TRUE if any char
  in the buffer is tagged.
- in the text tool, only set "markup" on the text proxy if there is
  actually markup in the buffer, and set "text" otherwise.

This way we don't push "text" *and* "markup" undos on each keystroke,
and undo compression works the way it did before.
2010-03-02 21:54:24 +01:00
Michael Natterer 1ddef5d375 app: redo the buffer's tag-at-iter APIs and fix editor state update 2010-03-02 11:37:57 +01:00
Michael Natterer bea0c7f3d4 app: allow to select fonts on text spans
A bit hackish, will cleanup...
2010-03-02 11:11:06 +01:00
Michael Natterer b19db0dea9 app: don't remove all tags when toggling style buttons and then inserting
Instead, keep a list of tags to explicitely remove around (the list of
unchecked toggles), and remove only these tags, so the tags that have
no widget in the UI are not affected by the insert_tags logic.
2010-03-01 22:39:42 +01:00
Michael Natterer f8ac0c61ab app: make manual kerning / character spacing work
Add gimp_text_buffer_get_iter_at_index() which does the reverse thing
than the already existing function gimp_text_buffer_get_iter_index().
Use the new function when cursor-navigation lines. Add "gboolean
layout_index" to both functions, which if TRUE indicates that the
passed in/out index is an index into the PangoLayout's content rather
than the text buffer's. When dealing with layout indices, take into
account the additional characters we insert into the serialized markup
(and thus the layout) for each character that is tagged with spacing.
2010-03-01 16:27:34 +01:00
Michael Natterer 1e26bb1348 app: support baseline changing via Alt+Up and Alt+Down
Add a list of available baseline tags to GimpTextBuffer and
automatically create baseline tags as needed. They get serialized as
<span rise="value">, so add attribute and value parameters to the
buffer's tag_to_name() and name_to_tag() functions. Properly managing
the rise's amount is a TODO, currently each keystroke changes the
baseline by 1024 pango units, which might be whatever depending on the
output grid.
2010-02-27 18:00:39 +01:00
Michael Natterer 9a53cc11ca app: allow to toggle tags and then write text with that style
instead of using the toggles only to change the style of selected text.

Introduces a list of "insert tags" in GimpTextBuffer that is applied
on newly inserted text if it exists. Clear the list on each content
or cursor/selection change, so we always display wthe style at the
cursor unless the buttons were clicked explicitely.
2010-02-26 19:56:54 +01:00
Michael Natterer 6c556698e5 app: add gimp_text_buffer_insert() and use it
Does nothing special yet, but will soon apply the currently active
tags to the inserted text.
2010-02-26 02:34:01 +01:00
Michael Natterer 360f5739da app: add infrastructure for editing pango markup based text styles
- keep around tags for styles in GimpTextBuffer. For now only bold,
  italic, underline and strikethrough.
- add GimpTextStyleEditor, a widget which allows setting tags on
  a GimpTextBuffer's selection.
- add serialize/deserialize code to/from pango markup using
  GtkTextBuffer's rich text (de)serialization infrastructure.
  Doesn't produce or handle <span> yet.
2010-02-26 01:27:05 +01:00
Michael Natterer 0b4bdc5613 app: add GimpTextBuffer, a GtkTextBuffer subclass
Pull all text buffer utility functions as methods and use
GimpTextBuffer all over the place instead of GtkTextBuffer.
Some actually usefuly features coming soon...
2010-02-25 17:41:10 +01:00