Re: tdf#156333: Implementing Text Effects
Good day! We tried to bind tint into the existing tint_or_shade implementation used for theme effects. It looks like this implementation is maked only for themes. At least in the file “sw/source/filter/ww8/docxattributeoutput.cxx line:7782” everything that gets into ComplexColor is exported, in our understanding, as a theme. Are we doing the right thing by trying to binding tint with an already written implementation, or do we need to implement our own processing? If binding is the right solution, then can be will probably need to create separate models for the styles from the themes and the styles of the element itself. In this case, Tomaž Vajngerl, can we contact you with questions about your implementation? >On Mon, Sep 11, 2023, at 16:11 +04:00, Vladislav Tarakanov >: > >We created a new item "SvxTintItem" and updated include/vcl/font.hxx by adding >methods for reading and setting tint. We tried to add processing of this value >to vcl/source/outdev/text.cxx, to the ImplDrawSpecialText method. At the same >time, we started looking for where the tint value was exported. > >During the search we found that tint is already used in ComplexColor. We >re-checked the use of attributes in unomap1 and unomapproperties and found out >that UNO_NAME_CHAR_COLOR_TINT_OR_SHADE is used there. Is there a possibility >that we did not need to create a new item, but could have applied the existing >tint value processing? > >>On 31/08/2023, 13:36 +04:00, Michael Stahl < m...@libreoffice.org >: >> >>On 30/08/2023 20:24, Tomaž Vajngerl wrote: >>> Hi, >>> >>> On Tue, Aug 29, 2023 at 12:30PM Amin Irgaliev < irgalie...@mail.ru > wrote: It is possible that the model we need is in sw/source/core/inc/swfont.hxx. >>> >>> Yes, looks like the correct place (not exactly sure), but that would >>> add it only for Writer (which is fine for now). I would trace how the >>> "Relief" parameter (or "Shadow") is used and manipulated as that's >>> kind-of a text effect that's already implemented. Best to go down from >>> OOXML import and look how the font attributes are set... >>adding it to the model needs a new SfxPoolItem subclass, and a new >>WhichId in sw/inc/hintids.hxx, to be inserted before RES_CHRATR_END. >> >>the item is used in SwTextNode item set, in SwFormatColl item set, and >>in the SwFormatAutoFormat item set (which is used with >>RES_TXTATR_AUTOFMT for formatted text portions inside a paragraph). >> >>the SwFont is then used during the text formatting, there is an array >>somewhere ... in SwAttrHandler that will need an extra entry for the new >>item. > > >-- >Vladislav Tarakanov > -- Sincerely, Irgaliev Amin
Re: tdf#156333: Implementing Text Effects
We created a new item "SvxTintItem" and updated include/vcl/font.hxx by adding methods for reading and setting tint. We tried to add processing of this value to vcl/source/outdev/text.cxx, to the ImplDrawSpecialText method. At the same time, we started looking for where the tint value was exported. During the search we found that tint is already used in ComplexColor. We re-checked the use of attributes in unomap1 and unomapproperties and found out that UNO_NAME_CHAR_COLOR_TINT_OR_SHADE is used there. Is there a possibility that we did not need to create a new item, but could have applied the existing tint value processing? >On 31/08/2023, 13:36 +04:00, Michael Stahl : > >On 30/08/2023 20:24, Tomaž Vajngerl wrote: >> Hi, >> >> On Tue, Aug 29, 2023 at 12:30PM Амин Иргалиев < irgalie...@mail.ru > wrote: >>> >>> It is possible that the model we need is in sw/source/core/inc/swfont.hxx. >> >> Yes, looks like the correct place (not exactly sure), but that would >> add it only for Writer (which is fine for now). I would trace how the >> "Relief" parameter (or "Shadow") is used and manipulated as that's >> kind-of a text effect that's already implemented. Best to go down from >> OOXML import and look how the font attributes are set... >adding it to the model needs a new SfxPoolItem subclass, and a new >WhichId in sw/inc/hintids.hxx, to be inserted before RES_CHRATR_END. > >the item is used in SwTextNode item set, in SwFormatColl item set, and >in the SwFormatAutoFormat item set (which is used with >RES_TXTATR_AUTOFMT for formatted text portions inside a paragraph). > >the SwFont is then used during the text formatting, there is an array >somewhere ... in SwAttrHandler that will need an extra entry for the new >item. -- Vladislav Tarakanov
Re: tdf#156333: Implementing Text Effects
On 30/08/2023 20:24, Tomaž Vajngerl wrote: Hi, On Tue, Aug 29, 2023 at 12:30 PM Амин Иргалиев wrote: It is possible that the model we need is in sw/source/core/inc/swfont.hxx. Yes, looks like the correct place (not exactly sure), but that would add it only for Writer (which is fine for now). I would trace how the "Relief" parameter (or "Shadow") is used and manipulated as that's kind-of a text effect that's already implemented. Best to go down from OOXML import and look how the font attributes are set... adding it to the model needs a new SfxPoolItem subclass, and a new WhichId in sw/inc/hintids.hxx, to be inserted before RES_CHRATR_END. the item is used in SwTextNode item set, in SwFormatColl item set, and in the SwFormatAutoFormat item set (which is used with RES_TXTATR_AUTOFMT for formatted text portions inside a paragraph). the SwFont is then used during the text formatting, there is an array somewhere ... in SwAttrHandler that will need an extra entry for the new item.
Re: tdf#156333: Implementing Text Effects
Hi, On Tue, Aug 29, 2023 at 12:30 PM Амин Иргалиев wrote: > > It is possible that the model we need is in sw/source/core/inc/swfont.hxx. Yes, looks like the correct place (not exactly sure), but that would add it only for Writer (which is fine for now). I would trace how the "Relief" parameter (or "Shadow") is used and manipulated as that's kind-of a text effect that's already implemented. Best to go down from OOXML import and look how the font attributes are set... Tomaž
Re: tdf#156333: Implementing Text Effects
Hi, sorry it took so long to reply, just now we were able to start this task. We are found how to remove tint from GrabBug, but we still do not quite understand where the model can be located, in which we need to add a new attribute. As we understand it, you should look in the sw module, but could you tell us exactly where to look? >Суббота, 22 июля 2023, 13:48 +04:00 от Tomaž Vajngerl : > >Hi, > >On Thu, Jul 20, 2023 at 4:53PM владислав тараканов >< vladislav.taraka...@bk.ru > wrote: >> >> Hello >> >> We, together with irgalie...@mail.ru, want to try adding support for various >> text styles (glow, tint, shadow, etc.) in Writer. But we are still only >> beginner developers, so we would like to ask where exactly in the code >> should we start fixing this problem? We've previously looked at the oox and >> sfx2 modules but didn't find anything relevant. > >Great. There are multiple things you need to do to add a missing >feature like this: >- extend the model to store the additional data about the feature - >for example glow radius (inside sw) >- use the new data in the model to influence the rendering (inside sw) >- access the new data via UNO if needed (sw, offapi) >- add file format support for OOXML - import and export (mainly >writerfilter, also oox and sw) >- add support for ODF - import and export (sw, xmloff) >- extend the UI to manipulate the new data (sw) > >I would first make it so that you get the data into the model and that >it is properly filled when you open an OOXML file and properly saved >to an OOXML file when you save the document. Currently we preserve the >data of text effects, but we preserve it by putting it into what we >call a "GrabBag". This stores the data inside the model, but only for >the purpose that it survives a import/export cycle and not to be a >proper part of the model. Tests for these things are in [1] but the >import is located in [2] and export is located in [3] - so first you >have to change those to not use "GrabBag" anymore for the text effects >you want to implement (glow for example) and store the data at the >same level that the text color, outline or shadow data is already >saved. One you have this, then you can look into how to actually >render these things (probably very similar to how shadows are already >rendered), but first I would make sure that you have properly solved >the model part of this. > >[1] sw/qa/extras/ooxmlexport/ooxmlw14export.cxx >[2] writerfilter/source/dmapper/TextEffectsHandler.cxx >[3] sw/source/filter/ww8/docxattributeoutput.cxx > >If you have any questions, don't hesitate to ask. > >> -- >> Vladislav Tarakanov > >Best regards, >Tomaž Vajngerl -- Sincerely, Irgaliev Amin
Re: tdf#156333: Implementing Text Effects
It is possible that the model we need is in sw/source/core/inc/swfont.hxx. Also, sorry for the grammatical error, i meant GrabBag, not a GrabBug. >Вторник, 29 августа 2023, 13:26 +04:00 от Амин Иргалиев : > >Hi, sorry it took so long to reply, just now we were able to start this task. > >We are found how to remove tint from GrabBug, but we still do not quite >understand where the model can be located, in which we need to add a new >attribute. As we understand it, you should look in the sw module, but could >you tell us exactly where to look? > > >>Суббота, 22 июля 2023, 13:48 +04:00 от Tomaž Vajngerl < qui...@gmail.com >: >> >>Hi, >> >>On Thu, Jul 20, 2023 at 4:53PM владислав тараканов >>< vladislav.taraka...@bk.ru > wrote: >>> >>> Hello >>> >>> We, together with irgalie...@mail.ru, want to try adding support for >>> various text styles (glow, tint, shadow, etc.) in Writer. But we are still >>> only beginner developers, so we would like to ask where exactly in the code >>> should we start fixing this problem? We've previously looked at the oox and >>> sfx2 modules but didn't find anything relevant. >> >>Great. There are multiple things you need to do to add a missing >>feature like this: >>- extend the model to store the additional data about the feature - >>for example glow radius (inside sw) >>- use the new data in the model to influence the rendering (inside sw) >>- access the new data via UNO if needed (sw, offapi) >>- add file format support for OOXML - import and export (mainly >>writerfilter, also oox and sw) >>- add support for ODF - import and export (sw, xmloff) >>- extend the UI to manipulate the new data (sw) >> >>I would first make it so that you get the data into the model and that >>it is properly filled when you open an OOXML file and properly saved >>to an OOXML file when you save the document. Currently we preserve the >>data of text effects, but we preserve it by putting it into what we >>call a "GrabBag". This stores the data inside the model, but only for >>the purpose that it survives a import/export cycle and not to be a >>proper part of the model. Tests for these things are in [1] but the >>import is located in [2] and export is located in [3] - so first you >>have to change those to not use "GrabBag" anymore for the text effects >>you want to implement (glow for example) and store the data at the >>same level that the text color, outline or shadow data is already >>saved. One you have this, then you can look into how to actually >>render these things (probably very similar to how shadows are already >>rendered), but first I would make sure that you have properly solved >>the model part of this. >> >>[1] sw/qa/extras/ooxmlexport/ooxmlw14export.cxx >>[2] writerfilter/source/dmapper/TextEffectsHandler.cxx >>[3] sw/source/filter/ww8/docxattributeoutput.cxx >> >>If you have any questions, don't hesitate to ask. >> >>> -- >>> Vladislav Tarakanov >> >>Best regards, >>Tomaž Vajngerl > > >-- >Sincerely, >Irgaliev Amin > -- Sincerely, Irgaliev Amin
Re: tdf#156333: Implementing Text Effects
Hi, On Thu, Jul 20, 2023 at 4:53 PM владислав тараканов wrote: > > Hello > > We, together with irgalie...@mail.ru, want to try adding support for various > text styles (glow, tint, shadow, etc.) in Writer. But we are still only > beginner developers, so we would like to ask where exactly in the code should > we start fixing this problem? We've previously looked at the oox and sfx2 > modules but didn't find anything relevant. Great. There are multiple things you need to do to add a missing feature like this: - extend the model to store the additional data about the feature - for example glow radius (inside sw) - use the new data in the model to influence the rendering (inside sw) - access the new data via UNO if needed (sw, offapi) - add file format support for OOXML - import and export (mainly writerfilter, also oox and sw) - add support for ODF - import and export (sw, xmloff) - extend the UI to manipulate the new data (sw) I would first make it so that you get the data into the model and that it is properly filled when you open an OOXML file and properly saved to an OOXML file when you save the document. Currently we preserve the data of text effects, but we preserve it by putting it into what we call a "GrabBag". This stores the data inside the model, but only for the purpose that it survives a import/export cycle and not to be a proper part of the model. Tests for these things are in [1] but the import is located in [2] and export is located in [3] - so first you have to change those to not use "GrabBag" anymore for the text effects you want to implement (glow for example) and store the data at the same level that the text color, outline or shadow data is already saved. One you have this, then you can look into how to actually render these things (probably very similar to how shadows are already rendered), but first I would make sure that you have properly solved the model part of this. [1] sw/qa/extras/ooxmlexport/ooxmlw14export.cxx [2] writerfilter/source/dmapper/TextEffectsHandler.cxx [3] sw/source/filter/ww8/docxattributeoutput.cxx If you have any questions, don't hesitate to ask. > -- > Vladislav Tarakanov Best regards, Tomaž Vajngerl
Re: tdf#156333: Implementing Text Effects
Hi, sorry that you haven't got any answer so far. Please be patient, we have weekend and summertime with lots of vacations. Unfortunately this is not my area, but this is, what I would do: We have already character effects "embossed", "engrave", "outline" and "shadow" in the Font Effects tab of the character properties. I would search for these terms. Besides the .ui and token-files, you will find some related .cxx files. I would look there, how these effects are implemented. "Implemented" includes model, rendering, load-save in ODF, import-export filter OOXML, UI. You will find then involved classes and methods and other relevant terms you can search. Do you have already looked at core/README.md? It gives an overview about most important modules and tips for further information. Kind regards, Regina владислав тараканов schrieb am 20.07.2023 um 13:52: Hello We, together with irgalie...@mail.ru, want to try adding support for various text styles (glow, tint, shadow, etc.) in Writer. But we are still only beginner developers, so we would like to ask where exactly in the code should we start fixing this problem? We've previously looked at the oox and sfx2 modules but didn't find anything relevant. -- Vladislav Tarakanov