Writer Region Plugin

Writer Region Plugin - Provides the ability to work with formatted text inside the Worksheet. - Messages

#1 Posted: 3/8/2015 5:26:21 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

SMath Studio compatibility SMath Viewer compatibility mono compatibility

extension page Sources MIT license


WYSIWYG word processing for your worksheets :d

2016-05-03 01_44_24-SMath Studio Desktop - [WR_hello.sm_].png




>>> PLEASE REPORT IN THIS TOPIC ANY ISSUE, MORE DETAILED AS POSSIBLE <<<


TODO LIST
  • Evaluable regions;
  • Styles (full implementation requires API improvements to get/set worksheets properties);
  • RTL/LTR support (see Unicode Bidirectional Algorithm);
  • new/alternative Hunspell wrapper (NHunspell no more updaqted, latest sources not available);
  • tables;



OLD documentation:

Show Spoiler

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
9 users liked this post
frapuano 12/3/2016 6:29:00 AM, IVR 12/22/2016 6:33:00 AM, zoom 1/17/2016 5:13:00 PM, Radovan Omorjan 3/8/2015 9:52:00 AM, sergio 3/9/2015 6:49:00 AM, Martin Kraska 3/9/2015 4:07:00 PM, Вячеслав Мезенцев 3/10/2015 6:01:00 AM, ioan92 3/8/2015 6:27:00 AM, Andrey Ivashov 11/16/2018 2:59:00 PM
#2 Posted: 3/8/2015 5:37:56 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Just for developpers

The code contains additional features (style limitations, region's rotation, ...) to use the plugin or the core of this plugin in your projects; let me know if there are issues/bugs to solve or possible improvements.


Examples of use:
- WriterRegion (basics)
- PieChartRegion (multiple regions, fields)
- BarChartRegion (under development)
- SectionRegions [under development]
WriterManager.sm (11 KiB) downloaded 337 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
3 users liked this post
Andrey Ivashov 4/11/2025 1:48:12 PM, Вячеслав Мезенцев 3/10/2015 6:02:00 AM, ioan92 3/8/2015 6:27:00 AM
#3 Posted: 3/8/2015 8:00:52 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hello Ioan


I know, I've tried a less disturbing "floating toolbar" but I've not (yet) found a good way to handle it (as for now the toolbar is called from the single region and may handle just that region - I have to handle in some way when the region looses the focus or is deleted from the canvas). When Andrey will provides a way to add toolbars from plugins I'll remove completely the form and this issue will be solved :d .


P.S. plugin updated (Math objects vs styles issues)
P.P.S. plugin updated (Copy format for Math objects; Save/read full style settings for empty lines)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
ioan92 3/8/2015 8:04:00 AM
#4 Posted: 3/9/2015 4:18:37 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Hi Davide, thank you for the great plugin.

Here is a preliminary wish-list.
- make the default line spacing customizable or sez it to 1 (this gives grid alignment with the default font setting on my system)
- set the default wrap depending on where the region is inserted. If it is at the left margin, set it to page, if elswhere, set it to custom
- open the hyperlink editor upon double-click on hyperlinks, just as the math editor on math insets.
- if possible, provide a choice, if a sm hyperlink target is to be opened in place of the current document (as with hyperlink text regions) or using the windows run command (leading to a new SMath instance). Currently, the writer region hyperlinks can't be used for interactive handbook cross linking. Thism however, would be very desirable, because they are much easier to edit than the hyperlink text regions.

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#5 Posted: 3/9/2015 7:53:23 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hello Martin

Wrote

Hi Davide, thank you for the great plugin.


You're welcome

Wrote

Here is a preliminary wish-list.
- make the default line spacing customizable or sez it to 1 (this gives grid alignment with the default font setting on my system)


Sure, I think I'll implement the first thing... Also, probably I'll provide the spacing as a paragraph's property, as for the word processors.

Wrote

- set the default wrap depending on where the region is inserted. If it is at the left margin, set it to page, if elswhere, set it to custom


That's an interesting idea. It may be matter of taste so I don't know, I have to think a little if should be possible to make it as a customizable option (f.e. my worksheets often are organized in two columns - description on the left and math on the right - thus this approach may be not the best in this or similar cases)
Wrote

- open the hyperlink editor upon double-click on hyperlinks, just as the math editor on math insets.


CTRL+SHIFT+H currently does this job (full edit of the hyperlink that surrounds the caret) without interferences with the normal text behaviour (double-click to select and edit/move a word, as for generic word processors); this can be done also from the toolbar button, even if I know is less accessible.
Wrote

- if possible, provide a choice, if a sm hyperlink target is to be opened in place of the current document (as with hyperlink text regions) or using the windows run command (leading to a new SMath instance). Currently, the writer region hyperlinks can't be used for interactive handbook cross linking. Thism however, would be very desirable, because they are much easier to edit than the hyperlink text regions.


Absolutely yes. I have to know if the function to open the document is available form within plugins or is hardcoded (in this case I'll ask Andrey to make it available)


P.S. PLUGIN UPDATED
- Custom wrap: fixed the size of empty regions;
- Blinking caret;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#6 Posted: 3/12/2015 10:04:16 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

There is another topic on my wish-list:

Could you please enable the shortcut Ctrl-G for greek letters (for text input and in the math editor)? Currently, you have to type greek letters elsewhere and copy them to the region.
Edit: One more productivity feature: Use ENTER as a shortcut to close the math editor. Then insets can be created without touching the mouse. This way you can easily give math formatting to any cited symbol in the text.

Thanks, Martin.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#7 Posted: 3/13/2015 6:19:50 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

I think is possible.

Inside the region should be better to have CTRL+G as for the style modifiers (CTRL+B f.e., that enable/disable the bold mode and converts the surrounding/selected word) or like in math regions (just the character before the caret is converted)?


P.S. error found in the greek paragraph of your activebook
2015-03-13 13_15_17-SMath Studio Desktop - [Greek Characters.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Martin Kraska 3/14/2015 2:17:00 PM
#8 Posted: 3/14/2015 2:22:10 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

reproducible (recoverable) crash:

selecting multiple characters and typing (for replacement) produces an exception (index out of range...)
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Davide Carpi 3/15/2015 5:24:00 AM
#9 Posted: 3/15/2015 5:50:01 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Reproduced, thank you!
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#10 Posted: 3/15/2015 1:59:01 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED

- added CTRL+G to swap between latin characters and greek symbols (on selection, on words, on further characters)
- math dialog: added CTRL+G to swap between latin characters and greek symbols (on selection, on further characters)
- math dialog now accepts RETURN and ESC keys;
- hyperlink dialog now accepts RETURN and ESC keys;
- fixed crash on text's replacement;
- fixed objects' focus issues when there are hyperlinks;
- minor changes/improvements;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
4 users liked this post
ioan92 3/16/2015 5:47:00 AM, IVR 3/17/2015 8:45:00 AM, Вячеслав Мезенцев 3/16/2015 12:19:00 AM, sergio 3/16/2015 5:35:00 AM
#11 Posted: 3/16/2015 10:15:39 AM
overlord

overlord

554 likes in 1333 posts.

Group: Moderator

Is there a reason this region saves a random png data on every change made or is it just junk data? It can easily be detected if you edit *.sm file with a notepad. If you delete this image data then there will be no difference at viewing or printing the document. Moving the region do not add the image data to region. However if you change anything at writer region the png data shall be added again.

Example-2 creates totally the same result on SMath with Example-1, actually Example-2 is notepad modified Example-1.

Example-1:

<region id="0" left="0" top="0" width="97" height="62" color="#000000" bgColor="#ffffff">
    <writer lang="eng"><![CDATA[<span style="font-family: 'Arial Unicode MS'; font-size: 10pt; font-weight: normal; font-style: normal; text-decoration: none; color: Black; background-color: Transparent; text-align: left; line-height: 115%">
<div><span style="font-family: 'Courier New'"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAAAwCAYAAABQQCeSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAICSURBVGhD7ZmJsYQgDEAtj4Ioh15sxU74BFCBD15EIWzeDDOL4yL7NoTDSTOPYXkVsLwKbsubpqlJ6ZFH8r6G5VXA8ipgeQPSUN6spWkL2oMi1OKv0+GWCcyoU2LScvYVL3Kv06CZvJRFSU0t+PqQtygthPIVOrSXN0vTriAXdUBTeYsSpk1pMh5Nmsmz4oKhCnVqM24beZDjTFvQXlhY3gC4dOL/1IP1E8tLmKURFqQTqJf8sbwTUOSdirNLDrr5KybYOmIM23N5c7TkUILm2i0l3kbGvBZ5VBe+/4CVQcEekjwI83ixO0ua8tJIg3opBeHIS/emhLdcLhCCEfRFzrNT/PZQqaWtDzJ0C6DJ+0UOjYTCepXXsl/ZJ7uh58oKSXnBHhpS177twjnJiZ7sGs4LCz/3xGm/rECfe5EnssMnrx0rdRCuv1lK5O5dS5YtAnHPDqvk9cCVvoWnJAcrj9sML8+JWyMO9y3d0PL2iHN5DjsCyctrCb68YHngykGSDg8TRnz1uP64y4C8C2MizkU0aSMP7iEYaSnvyPPfsSUnyQxXIU3Z7qMZgfjyEuzwTCJxnfW2y5D7MKa/j7kkr4rMMLbyoog0669RJ4w7pCevcM6XO4mN3nFcnGR645XIA4HwPVtKUqLcSPPQ9BV5vwLLq4DNVMDyKmB5FbC8x2j9B3wdVWeGEbvtAAAAAElFTkSuQmCC" width="79px" height="48px" alt="sqrt({a^2}/56)+x^3" data-style="font-family: 'Courier New'; font-size: 10pt; color: Black; background-color: Transparent"></span></div></span>]]></writer>
</region>

Example-2

  <region id="0" left="0" top="0" width="97" height="62" color="#000000" bgColor="#ffffff">
    <writer lang="eng"><![CDATA[<span style="font-family: 'Arial Unicode MS'; font-size: 10pt; font-weight: normal; font-style: normal; text-decoration: none; color: Black; background-color: Transparent; text-align: left; line-height: 115%">
<div><span style="font-family: 'Courier New'"><img alt="sqrt({a^2}/56)+x^3" data-style="font-family: 'Courier New'; font-size: 10pt; color: Black; background-color: Transparent"></span></div></span>]]></writer>
  </region>
#12 Posted: 3/16/2015 10:54:50 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

The src attribute contains a base64-encoded data URI, it is used to share the math objects to the external word processors as a PNG image. It is not essential in the worksheet code, but I need it for debug/testing purposes, at least for now.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#13 Posted: 3/31/2015 6:20:02 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

If a writer region with custom wrap setting is cloned using ctrl-drag, then the custom region width gets lost. The wrap setting is still custom but the width extends as if None was specified.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Davide Carpi 3/31/2015 8:13:00 PM
#14 Posted: 3/31/2015 8:14:01 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Thank you, will be fixed in the next relase.

P.S.

Wrote

- if possible, provide a choice, if a sm hyperlink target is to be opened in place of the current document (as with hyperlink text regions) or using the windows run command (leading to a new SMath instance).


I've asked Andrey to extend the APIs to be able to implement this feature
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#15 Posted: 4/7/2015 7:24:28 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED SMath Studio 0.97.5575 (07 April 2015)

- Plugin updated to respect changes in SS Core;
- Fixed missing WrapWidth on CTRL+DRAG;
- Toolstrips organization changed to have paragraph's properties grouped;
- Minor changes;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
ioan92 4/8/2015 1:19:00 AM
#16 Posted: 8/2/2015 2:14:59 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED SMath Studio 0.97.5581 (08 April 2015)

  • Toolbar new features:
    • Toolbar now is available as floating item (can be opened at once in the worksheet);
    • added "Symbol" menu;
      • windows "character map" available from here;
    • added "Change Case" menu;
      • added functions "sentence case", "capitalize each words", "toggle case";
    • "More" menu: New "Options..." item (introduced to set up global options);
      • you can choose between 2 different ways to export data to clipboard; this should enable the region to export math images to any external Word processor*;
      • you can choose the default wrap for the new regions;
      • you can choose to move the new regions on the leftmost page margin, regardless the insertion point;
      • [DEV] LOG utilities available from inside SMath (CTRL+SHIFT+D in this form)
    • fixed critical bugs about non valid values in the font-size DropDown menu;
    • icons reworked;
  • Math objects: the single object now can be copy-pasted as editable math in MS Word** ("paste special" still contains also the plain text and the bitmap image);
  • Changed handling of mouse cursor to avoid annoying flickering;
    • on text selection (noticed with some video drivers);
    • over links on CTRL key pressed (workaround for [url="http://smath.info/bts/Issues/IssueDetail.aspx?id=1239"]SS-1239[/url]);
  • Hotkeys: CTRL+SHIFT+F assigned to "Copy Format";
  • Fixed critical bug of math objects containing XML special characters;
  • Fixed non selectable hyperlinks written after adding math objects;
  • [DEV] code changes to enable batch TextRegion conversion from next TextRegionUtilities plugin;
  • minor changes & fixes;



PLEASE NOTE:
* Most of the Word processors are able to manage both the modes, however MS Word doesn't handle embedded images, Google Docs and MS Office Online doesn't handle (local) temporary files.
** Some MathML attributes such as colors and alignments are ignored (tests on MS Word up to 2010). It is possible to left-align the items (if, line, while, for, sys, cases) from inside MS Word (Column Alignment > Left).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
4 users liked this post
Вячеслав Мезенцев 8/4/2015 2:32:00 AM, IVR 8/2/2015 2:51:00 PM, ioan92 8/2/2015 4:32:00 PM, sergio 8/3/2015 4:52:00 AM
#17 Posted: 8/3/2015 11:50:56 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

PLUGIN UPDATED

- Fixed broken resize marker;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
Oscar Campo 8/5/2015 1:28:00 PM, Andrey Ivashov 8/5/2015 12:09:00 PM
#18 Posted: 8/5/2015 12:12:01 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Great! Thank you Davide!

What you think if together we will try to include Writer Region into SMath Studio in the Cloud? I believe it may be interesting...

Best regards!
1 users liked this post
Davide Carpi 8/5/2015 2:17:00 PM
#19 Posted: 8/5/2015 2:22:08 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hello Andrey

I think that would be great, we'll talk about it on Skype ASAP
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#20 Posted: 8/6/2015 7:45:18 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Sure!
  • New Posts New Posts
  • No New Posts No New Posts