RSS/Atom feed Twitter
Site is read-only, email is disabled

Text layer changes?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

Text layer changes? LightningIsMyName 03 Mar 16:29
  Text layer changes? Sven Neumann 03 Mar 20:17
   Text layer changes? LightningIsMyName 03 Mar 21:35
    Text layer changes? Sven Neumann 03 Mar 22:49
     Text layer changes? LightningIsMyName 30 Mar 23:28
      Text layer changes? Michael Natterer 31 Mar 14:21
LightningIsMyName
2010-03-03 16:29:46 UTC (over 14 years ago)

Text layer changes?

Hello,

I have seen in my latest GIMP build that the new text layer allows us to style different parts of the text in different styles. This is an amazing feature (I waited for it for a long time), but it's a pain in the neck for my PDF export plugin (see here https://bugzilla.gnome.org/show_bug.cgi?id=382688 )

Is there any way in which I can acces the style of the text? I can easily add a PDB procedure (to the GIMP's source) to export the PangoTextLayout object to plugins for using, but I doubt that it's a good idea (Since exposing the internal structure will be a big problem in backwards comptiablility if we ever change from pango).

The other option which I can think off, is something that will work but will not be ideal. This is to expose a function that renders a text layer to a cairo surface. This way, for vector surfaces It will still be a vector instead of bitmap, and it won't be any trouble for the programmer.
However, this method also has many problems...

Can anyone give me any hint on what should I do?

Thanks, LightningIsMyName

Sven Neumann
2010-03-03 20:17:13 UTC (over 14 years ago)

Text layer changes?

On Wed, 2010-03-03 at 17:29 +0200, LightningIsMyName wrote:

I have seen in my latest GIMP build that the new text layer allows us to style different parts of the text in different styles. This is an amazing feature (I waited for it for a long time), but it's a pain in the neck for my PDF export plugin (see here https://bugzilla.gnome.org/show_bug.cgi?id=382688 )

Is there any way in which I can acces the style of the text?=

Such a way will have to be added of course. We usually add the core functionality first, then expose it to plug-ins. It's easier this way around.

It should be unproblematic to add a procedure that exposes the new "markup" property of the text object.

Sven

LightningIsMyName
2010-03-03 21:35:40 UTC (over 14 years ago)

Text layer changes?

Hello Sven,

On Wed, Mar 3, 2010 at 9:17 PM, Sven Neumann wrote:

Is there any way in which I can acces the style of the text?=

Such a way will have to be added of course. We usually add the core functionality first, then expose it to plug-ins. It's easier this way around.

It should be unproblematic to add a procedure that exposes the new "markup" property of the text object.

OK, I found the markup property you are mentioned - It shouldn't be too problomatic to extract it (I'll probably be able to add the patch myself). However, before I continue working on the plugin, are there any other upcoming changes in the text-engine which will affect the plugin?

And another thing - with al the late discussions about color profiles, It made me wonder: exporting a PDF via cairo does not support color profiles. Do we need to warn the user if the image has some specific color profile, that the PDF will be exported in the default RGB profile? Or do we continue to stick to the fact that this is an extra feature (andnot a complete feature with CMYK and other PDF related features) in gimp and therfor we don't need to warn about such errors that don't bother most of the users?

Thanks for your help, ~LightningIsMyName

Sven Neumann
2010-03-03 22:49:05 UTC (over 14 years ago)

Text layer changes?

On Wed, 2010-03-03 at 22:35 +0200, LightningIsMyName wrote:

On Wed, Mar 3, 2010 at 9:17 PM, Sven Neumann wrote:

Is there any way in which I can acces the style of the text?=

Such a way will have to be added of course. We usually add the core functionality first, then expose it to plug-ins. It's easier this way around.

It should be unproblematic to add a procedure that exposes the new "markup" property of the text object.

OK, I found the markup property you are mentioned - It shouldn't be too problomatic to extract it (I'll probably be able to add the patch myself). However, before I continue working on the plugin, are there any other upcoming changes in the text-engine which will affect the plugin?

Almost certainly. The feature is brand-new, you should give it some time to settle.

And another thing - with al the late discussions about color profiles, It made me wonder: exporting a PDF via cairo does not support color profiles. Do we need to warn the user if the image has some specific color profile, that the PDF will be exported in the default RGB profile? Or do we continue to stick to the fact that this is an extra feature (andnot a complete feature with CMYK and other PDF related features) in gimp and therfor we don't need to warn about such errors that don't bother most of the users?

Almost all our file plug-ins are missing color profile support and we don't warn users in any of them.

Sven

LightningIsMyName
2010-03-30 23:28:47 UTC (over 14 years ago)

Text layer changes?

Hello,

I took a look on the commit logs, and I haven't seen any update to the text tool which should affect exporting it's markup, in the last 3 weeks.
So now it's time at least discuss which kind of export do we want for the markup:

- Do we want an export which exports pango's markup directly? Although this should be the easiest technique, it might be a burden if for some reason we change to a different text-rendering library in the future (This shouldn't happen, right? If so, this is probably OK)

- Do we want an export which exports to some HTML and CSS combination? Right now pango does something very close to this, however it includes some attributes which should be inside a style attribute in valid CSS. This is less "pango-dependant" and it is probably a better idea to use valid HTML/CSS if we want to allow other uses of the exported text (instead of just usage with Pango as in the PDF plugin). Note however that in this case, there are some elements that it's unclear how to export since Pango's markup supports several attributes (such as "fallback") which HTML and CSS don't support.

- Other export format?

I obviously tend to like the first option more (Pango-style markup) since it requires no writing of convertors for the markup from our current internal represenation, and as far as I know Pango is here to stay.
If this option is indeed the way to go, I have a fixed code ready that I can create the patch from.

I'll continue working on the PDF plugin as soon as we are done with this =) LightningIsMyName

On Thu, Mar 4, 2010 at 12:49 AM, Sven Neumann wrote:

On Wed, 2010-03-03 at 22:35 +0200, LightningIsMyName wrote:

On Wed, Mar 3, 2010 at 9:17 PM, Sven Neumann wrote:

Is there any way in which I can acces the style of the text?=

Such a way will have to be added of course. We usually add the core functionality first, then expose it to plug-ins. It's easier this way around.

It should be unproblematic to add a procedure that exposes the new "markup" property of the text object.

OK, I found the markup property you are mentioned - It shouldn't be too problomatic to extract it (I'll probably be able to add the patch myself). However, before I continue working on the plugin, are there any other upcoming changes in the text-engine which will affect the plugin?

Almost certainly. The feature is brand-new, you should give it some time to settle.

And another thing - with al the late discussions about color profiles, It made me wonder: exporting a PDF via cairo does not support color profiles. Do we need to warn the user if the image has some specific color profile, that the PDF will be exported in the default RGB profile? Or do we continue to stick to the fact that this is an extra feature (andnot a complete feature with CMYK and other PDF related features) in gimp and therfor we don't need to warn about such errors that don't bother most of the users?

Almost all our file plug-ins are missing color profile support and we don't warn users in any of them.

Sven

Michael Natterer
2010-03-31 14:21:22 UTC (over 14 years ago)

Text layer changes?

On Wed, 2010-03-31 at 00:28 +0300, LightningIsMyName wrote:

Hello,

I took a look on the commit logs, and I haven't seen any update to the text tool which should affect exporting it's markup, in the last 3 weeks.

That is because I didn't have much time, and is no indication that the text tool is finished. There are in fact a lot of things left, also with the internal representation.

So now it's time at least discuss which kind of export do we want for the markup:

- Do we want an export which exports pango's markup directly? Although this should be the easiest technique, it might be a burden if for some reason we change to a different text-rendering library in the future (This shouldn't happen, right? If so, this is probably OK)

- Do we want an export which exports to some HTML and CSS combination? Right now pango does something very close to this, however it includes some attributes which should be inside a style attribute in valid CSS. This is less "pango-dependant" and it is probably a better idea to use valid HTML/CSS if we want to allow other uses of the exported text (instead of just usage with Pango as in the PDF plugin). Note however that in this case, there are some elements that it's unclear how to export since Pango's markup supports several attributes (such as "fallback") which HTML and CSS don't support.

- Other export format?

I obviously tend to like the first option more (Pango-style markup) since it requires no writing of convertors for the markup from our current internal represenation, and as far as I know Pango is here to stay.
If this option is indeed the way to go, I have a fixed code ready that I can create the patch from.

It's most likely going to be pango markup. However, since GIMP will only understand pango markup it produced itself, let's call it GIMP markup right away. But as said, the exact set of features is undecided, and there is currently even a bad hack involved internally.

I'll continue working on the PDF plugin as soon as we are done with this =) LightningIsMyName

Great :) Let's discuss the details in #gimp some time next week.

ciao, --mitch

On Thu, Mar 4, 2010 at 12:49 AM, Sven Neumann wrote:

On Wed, 2010-03-03 at 22:35 +0200, LightningIsMyName wrote:

On Wed, Mar 3, 2010 at 9:17 PM, Sven Neumann wrote:

Is there any way in which I can acces the style of the text?=

Such a way will have to be added of course. We usually add the core functionality first, then expose it to plug-ins. It's easier this way around.

It should be unproblematic to add a procedure that exposes the new "markup" property of the text object.

OK, I found the markup property you are mentioned - It shouldn't be too problomatic to extract it (I'll probably be able to add the patch myself). However, before I continue working on the plugin, are there any other upcoming changes in the text-engine which will affect the plugin?

Almost certainly. The feature is brand-new, you should give it some time to settle.

And another thing - with al the late discussions about color profiles, It made me wonder: exporting a PDF via cairo does not support color profiles. Do we need to warn the user if the image has some specific color profile, that the PDF will be exported in the default RGB profile? Or do we continue to stick to the fact that this is an extra feature (andnot a complete feature with CMYK and other PDF related features) in gimp and therfor we don't need to warn about such errors that don't bother most of the users?

Almost all our file plug-ins are missing color profile support and we don't warn users in any of them.

Sven