simmetric

Spaced text (variable letter and line spacing)

45 posts in this topic

Posted (edited)

@lynxster4 I'll look into it and get back to you.

 

Edit: so far I've found a bug when there's more than one consecutive spaces in the Text field. Is that the case for you? Otherwise could you please post which plugin settings you used? (Text, Fontsize, LetterSpacing, Text aligment, etc.)

 

Edit 2: OK, the bug seems to occur if the area of a line of text is to small (for example because the selection area is too small). This is now fixed. See the update in the opening post.

 

If anyone still experiences issues with the plugin, please don't hesitate to let me know.

Edited by simmetric
3

Share this post


Link to post
Share on other sites
11 hours ago, simmetric said:

@lynxster4 I'll look into it and get back to you.

 

Edit: so far I've found a bug when there's more than one consecutive spaces in the Text field. Is that the case for you? Otherwise could you please post which plugin settings you used? (Text, Fontsize, LetterSpacing, Text aligment, etc.)

 

Edit 2: OK, the bug seems to occur if the area of a line of text is to small (for example because the selection area is too small). This is now fixed. See the update in the opening post.

 

If anyone still experiences issues with the plugin, please don't hesitate to let me know.

 

Just tested the revised version.  Did the same steps as yesterday...it didn't crash...which is good.  :)

The only thing I see that is not working properly is the text alignment after you have spaced the letters....like it doesn't recognize that you've expanded the text.

Other than that, good job!   :beer:

0

Share this post


Link to post
Share on other sites
12 hours ago, lynxster4 said:

 

Just tested the revised version.  Did the same steps as yesterday...it didn't crash...which is good.  :)

The only thing I see that is not working properly is the text alignment after you have spaced the letters....like it doesn't recognize that you've expanded the text.

Other than that, good job!   :beer:

 

Could you post a screenshot of the settings you use when this happens?

0

Share this post


Link to post
Share on other sites

@simmetric The Center alignment is off to the left. There is also a little issue with the Underline and Strikeout options.

 

 spaced-text-testing-51d692c.png

0

Share this post


Link to post
Share on other sites

I would recommend tweaking the UI like this:

 

protected override ControlInfo OnCreateConfigUI(PropertyCollection props)
{
	var configUI = CreateDefaultConfigUI(props);

	configUI.SetPropertyControlValue(Constants.Properties.Text.ToString(), ControlInfoPropertyNames.Multiline, true);
	configUI.SetPropertyControlValue(Constants.Properties.Bold.ToString(), ControlInfoPropertyNames.DisplayName, "Formatting");
	configUI.SetPropertyControlValue(Constants.Properties.Bold.ToString(), ControlInfoPropertyNames.Description, Constants.Properties.Bold.ToString());
	configUI.SetPropertyControlValue(Constants.Properties.Italic.ToString(), ControlInfoPropertyNames.DisplayName, string.Empty);
	configUI.SetPropertyControlValue(Constants.Properties.Italic.ToString(), ControlInfoPropertyNames.Description, Constants.Properties.Italic.ToString());
	configUI.SetPropertyControlValue(Constants.Properties.Underline.ToString(), ControlInfoPropertyNames.DisplayName, string.Empty);
	configUI.SetPropertyControlValue(Constants.Properties.Underline.ToString(), ControlInfoPropertyNames.Description, Constants.Properties.Underline.ToString());
	configUI.SetPropertyControlValue(Constants.Properties.Strikeout.ToString(), ControlInfoPropertyNames.DisplayName, string.Empty);
	configUI.SetPropertyControlValue(Constants.Properties.Strikeout.ToString(), ControlInfoPropertyNames.Description, Constants.Properties.Strikeout.ToString());

	configUI.SetPropertyControlValue(Constants.Properties.LetterSpacing.ToString(),
		ControlInfoPropertyNames.SliderLargeChange, 0.25);
	configUI.SetPropertyControlValue(Constants.Properties.LetterSpacing.ToString(),
		ControlInfoPropertyNames.SliderSmallChange, 0.01);
	configUI.SetPropertyControlValue(Constants.Properties.LetterSpacing.ToString(),
		ControlInfoPropertyNames.UpDownIncrement, 0.01);

	configUI.SetPropertyControlValue(Constants.Properties.LineSpacing.ToString(),
		ControlInfoPropertyNames.SliderLargeChange, 0.25);
	configUI.SetPropertyControlValue(Constants.Properties.LineSpacing.ToString(),
		ControlInfoPropertyNames.SliderSmallChange, 0.01);
	configUI.SetPropertyControlValue(Constants.Properties.LineSpacing.ToString(),
		ControlInfoPropertyNames.UpDownIncrement, 0.01);

	return configUI;
}

 

1

Share this post


Link to post
Share on other sites

Posted (edited)

Thanks to @Eli's input I was able to fix a few alignment bugs.

Also many thanks to @BoltBait for the config UI suggestions, these have been worked into the plugin.

 

The zip file in the first post has been updated.

 

Bugs fixed:

- The last line always had a superfluous space at the end (if there's only one line, that's the last)

- Alignment to center or right produced inconsistently positioned lines because of a rounding difference between the functions to measure and render text

 

Thanks for bearing with me!

 

 

9 hours ago, Eli said:

@simmetric The Center alignment is off to the left. There is also a little issue with the Underline and Strikeout options.

 

 

Could you explain what issue you have with the Underline and Strikeout options? It's not immediately clear from the screenshot.

Edited by simmetric
0

Share this post


Link to post
Share on other sites

I think what Eli identified as issues with the strikeout and underline options can be explained by what simmetric described as "..a superfluous space at the end".

0

Share this post


Link to post
Share on other sites

The strikeout and underline issues have been corrected in the new version : :) 

spaced-text-testing-2-51d7ea8.png

0

Share this post


Link to post
Share on other sites

I've just tested new version. Alignment issues seem to be solved and thank you @Eli for posting image for the issue...I couldn't get to it.  :)

 

But, alas....I've found something else.  The AntiAliasLevel slider works at default (2) and 3 and 4.  As soon as you slide it (or use 'up' arrow) to 5 it goes in endless green progress loop, and if you think you can fix it by sliding back to 4, it crashes PDN.  If you try and adjust the slider (from 2) to more than 5, it crashes immediately.

Maybe you could look into it @simmetric.  Thank you!  :)

0

Share this post


Link to post
Share on other sites

It's been a busy week but I managed to spend some time on the plugin. Several minor crashing bugs were fixed, and support for IsCancelRequested was added. This means the overall user experience should be better and there should be little to no crashes anymore.

Antialiased text quality is slightly improved.

 

@lynxster4 I hope this fixes the issues you had.

1

Share this post


Link to post
Share on other sites

Posted (edited)

@simmetric When I move the AntiAliasLevel slider to 6  the effect stops and if I try to bring it down to less than 6 Paint.net crashes. I am posting the error. Otherwise, the effect works with the other AntiAliasLevels (1 to 5).

Spoiler

File: C:\Program Files\Paint.NET\Effects\SpacedTextPlugin.dll
      Name: SpacedTextPlugin.SpacedTextEffectsPlugin
      Version: 0.0.0.0
      Author: 
      Copyright: 
      Website: (Not Supplied)
      Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.OutOfMemoryException: Out of memory.
   at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
   at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
   at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
   at SpacedTextPlugin.SpacedText.DrawLines(List`1 lines, Graphics gr, Font font, Double letterSpacing, Bitmap bm)
   at SpacedTextPlugin.SpacedText.RenderText(Rectangle bounds)
   at SpacedTextPlugin.SpacedTextEffectsPlugin.OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs)
   at PaintDotNet.Effects.Effect`1.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) in D:\src\pdn\src\Effects\Effect`1.cs:line 65
   at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 224
   --- End of inner exception stack trace ---
   at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 418
   at PaintDotNet.Effects.BackgroundEffectRenderer.Abort() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 373
   at PaintDotNet.Effects.BackgroundEffectRenderer.Start() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 319
   at PaintDotNet.Menus.EffectMenuBase.<>c__DisplayClass42_3.<RunEffectImpl>b__2() in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 953
 

 

Edited by Eli
1

Share this post


Link to post
Share on other sites

A very useful plugin, but unfortunately does not display some characters.
No support for Unicode?

 

Spoiler

fMn9T6J.png

 

0

Share this post


Link to post
Share on other sites
On 2017-4-30 at 5:39 PM, xod said:

A very useful plugin, but unfortunately does not display some characters.
No support for Unicode?

 

  Hide contents

fMn9T6J.png

 

 

It should support Unicode. I'll look into this and get back to you over the weekend. 

1

Share this post


Link to post
Share on other sites

@xod: the issue with Unicode characters is fixed. Please note that European languages are fully supported (Cyrillic, Maltese, Romanian, etc.) but Asian and Hebrew characters do not support letter spacing.

 

Without letter spacing:

 

SpacedTextUnicode1.png.32a9378ca52a9fc51b65dadcb138f145.png

 

 

With letter spacing:

 

SpacedTextUnicode2.png.a301b644d5d15811d0d1aa0e5d308d0a.png

4

Share this post


Link to post
Share on other sites

Because I'm dealing with the restoration of some book covers I will use this plugin very often. It is extremely useful to me!
Thank you very very much.

0

Share this post


Link to post
Share on other sites

after installing and restarting, I don't see the "Text Formations" under Effects. I'm using version 4.0.16 on Windows 10

0

Share this post


Link to post
Share on other sites

Posted (edited)

nevermind. after a couple of reboots it worked. * shrugs *

Edited by meat
accuracy
0

Share this post


Link to post
Share on other sites
On 08/05/2017 at 1:54 PM, simmetric said:

... Please note that European languages are fully supported (Cyrillic, Maltese, Romanian, etc.) ...

Can also confirm full support for Greek:

 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now