Sign in to follow this  
Followers 0
Ego Eram Reputo

WhichSymbolPlus (updated 12 Dec 2010)

63 posts in this topic

Updated 12 December 2010 - 'Recent History' buttons! B)

Update 24 October 2010 - New UI

WhichSymbolPlus allows a symbol or character to be chosen and applied to the canvas from any installed font.

Thanks to these guys for their help:

  • Pyrochild for his help with the XML loading & saving.
  • Simon Brown who revised and recoded the original codelab plug-in, and was most generous with his time and source.
  • BoltBait for the TextRenderingHint!
You will find this plugin located in the RENDER submenu.

(New) When you commit a character to the canvas (by clicking OK), the character is saved to the upper most 'History" button (the contents of the other buttons cascade downward). You can easily reproduce the character by running the plugin again and selecting the appropriate 'History' button. Note that the anti-aliasing setting is not saved, nor the color used (the plugin always uses the current primary color).

This is the fourth incarnation of this plugin. Here's how the new UI looks....,

WhichSymbolRedux2.png

The UI explained:

  • Select or change a font by clicking on the font name.
  • Choose your symbol by clicking directly on it (it will appear in the preview area and also on the canvas). Click OK to commit the symbol to the canvas.
  • Anti aliasing checkbox chooses between smooth & pixelated.
  • Symbol size is changed with the up/down arrows or by typing a number into the size box. Measurements are in pixels (maximum is 1000).
  • (New) Quickly recall any one of your 10 most recently chosen characters by clicking on one of the 'History' buttons.
To install the plugin, download my Plugin Pack and unzip it. Run the *.exe installer (written by BoltBait). Restart paint.net.
5

Share this post


Link to post
Share on other sites

This could be quite useful. Thanks :)

0

Share this post


Link to post
Share on other sites

Cool, thank you!

0

Share this post


Link to post
Share on other sites

excellent as a webding user I appreciate this will make it vastly easier for others to use these symbols more often.

0

Share this post


Link to post
Share on other sites

Thanks.

I was thinking of making this a while back.. but I know no C++.

:lol:

Anyway.. thanks. :D

0

Share this post


Link to post
Share on other sites
Thanks.

I was thinking of making this a while back.. but I know no C++.

:lol:

Anyway.. thanks. :D

I wrote this with codelab, which uses c# I believe. To be honest I find c# remarkably easy to understand and would recommend you grab codelab and go through some of the source files. You might find yourself coding plugins before you know it. :wink:

I am always happy to release the source (if requested), though I have to admit a certain brute-force style of getting things to happen rather than any coding finesse :)

0

Share this post


Link to post
Share on other sites
If this is CodeLab created than I want src.

Mike, your wish is my command (well, a list of commands anyway....,)

This is purely an exercise in getting-it-done, and should not be read as an example of best coding practice :!:

Feel free to ask if there is anything you want explained.

/*==============================================================================
WhichSymbol.cs 
(c) 2008 Ego Eram Reputo 

Description: Draws a selectable symbol from the Webdings/Webdings fonts. 

==============================================================================*/ 
#region UICode
int Amount1=42; // [32,255] Character
int Amount2=150; // [8,255] FontSize
int Amount3 = 1; // [1,4] Webdings Wingdings Wingdings2 Wingdings3
bool Amount4 = true; // [0,1] Show Entire Font
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{

// Init variables and settings

string symbol;

Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); 

Graphics g = new RenderArgs(dst).Graphics;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.Clip = new Region(rect);
ColorBgra PC = (ColorBgra)EnvironmentParameters.PrimaryColor;
SolidBrush B1 = new SolidBrush(Color.FromArgb(PC.A, PC.R, PC.G, PC.);
Font F1 = new Font("Webdings", Amount2);
Font F2 = new Font("Wingdings", Amount2);
Font F3 = new Font("Wingdings 2", Amount2);
Font F4 = new Font("Wingdings 3", Amount2);

Font F7 = new Font("Arial", 10); 

Font F11 = new Font("Webdings", 16);
Font F12 = new Font("Wingdings", 16);
Font F13 = new Font("Wingdings 2", 16);
Font F14 = new Font("Wingdings 3", 16); 

// Clear the canvas by copying existing image (source) to destination
for(int y = rect.Top; y < rect.Bottom; y++)
for (int x = rect.Left; x < rect.Right; x++) 
dst[x,y] = src[x,y]; 

// draw a single symbol if we are not drawing the whole lot

if (Amount4==false)
{

switch (Amount3)
{
case 1: 
symbol = Convert.ToString((char)Amount1);
g.DrawString(symbol, F1, B1, selection.Left, selection.Top); 
break;

case 2: 
symbol = Convert.ToString((char)Amount1);
g.DrawString(symbol, F2, B1, selection.Left, selection.Top); 
break;

case 3: 
symbol = Convert.ToString((char)Amount1);
g.DrawString(symbol, F3, B1, selection.Left, selection.Top); 
break;

case 4: 
symbol = Convert.ToString((char)Amount1);
g.DrawString(symbol, F4, B1, selection.Left, selection.Top); 
break;
}

}

// Or if we are drawing them all...,

if (Amount4==true)
{

// Start with a clear the canvas 
for(int y = rect.Top; y < rect.Bottom; y++)
for (int x = rect.Left; x < rect.Right; x++) 
dst[x,y] = src[x,y]; 

// loop to write top character codes

for (int File=1; File<=15; File++)
{
symbol = "+" + Convert.ToString(File);
g.DrawString(symbol, F7, B1, selection.Left+(File*32), selection.Top+1*16);
}

// loop to draw all characters
for (int Rank=0; Rank<=14; Rank++)
{
for (int File=0; File<15; File++)
{
// Draw characters
switch (Amount3)
{
case 1: 
symbol = Convert.ToString((char)(32+(Rank*15)+File));
g.DrawString(symbol, F11, B1, selection.Left+((File+1)*32), selection.Top+((Rank+1)*2*16));
break;

case 2: 
symbol = Convert.ToString((char)(32+(Rank*15)+File));
g.DrawString(symbol, F12, B1, selection.Left+((File+1)*32), selection.Top+((Rank+1)*2*16));
break;

case 3: 
symbol = Convert.ToString((char)(32+(Rank*15)+File));
g.DrawString(symbol, F13, B1, selection.Left+((File+1)*32), selection.Top+((Rank+1)*2*16));
break;

case 4: 
symbol = Convert.ToString((char)(32+(Rank*15)+File));
g.DrawString(symbol, F14, B1, selection.Left+((File+1)*32), selection.Top+((Rank+1)*2*16));
break;
}
}
// draw the number codes
symbol = Convert.ToString(31+(Rank*15));
g.DrawString(symbol, F7, B1, selection.Left, selection.Top+5+((Rank+1)*2*16));
}
}
}

0

Share this post


Link to post
Share on other sites

Found a bug of my own making!

The final column of symbols was not being drawn when the "Show All" mode was being used. See the top image in my first post, the top row ends with symbol 31+14=45, but the second row starts with symbol 46+1=47. Thus symbol 46 was missing (the missing link).

The *.zip file has been updated to correct this and the source listed above amended. I'm not going to change the images because I'm sure you all get the idea.

I only found this because I actually wanted to use a symbol I knew existed and couldn't find it - you can imagine my frustration as I searched for it!

0

Share this post


Link to post
Share on other sites

I just wanted to let you know that I simply LOVE this plugin. 8)

0

Share this post


Link to post
Share on other sites

thanks for the plugin it will really help in making psp and ps3 fonts :D

0

Share this post


Link to post
Share on other sites

Nice plugin!

When I need to input symbols, now I don't need to abuse MSWord anymore! :wink:

0

Share this post


Link to post
Share on other sites

Do you mind if I post a bit of a mini tutorial in here explaining how to add new font types and compile in Code Lab? I know that is the first thing I did with your code for all of my Dafont downloaded dingbats.

0

Share this post


Link to post
Share on other sites

actually Mike I'd be interested in that. I have a few fonts I use for lace making that I hit and pick at keyboard until I get the correct one.

0

Share this post


Link to post
Share on other sites
Do you mind if I post a bit of a mini tutorial in here explaining how to add new font types and compile in Code Lab? I know that is the first thing I did with your code for all of my Dafont downloaded dingbats.

I don't mind at all, but I think a new topic might be in order? You're probably best slotting it into the Effects/API forum.

0

Share this post


Link to post
Share on other sites

Here is my modification of this plugin that supports custom fonts and a (hopefully) simpler dialog. This ZIP only contains the assembley, I will leave the decision to EER over whether to publish the source.

1zg55yu.png

WhichSymbolPlus.zip

0

Share this post


Link to post
Share on other sites
Here is my modification of this plugin that supports custom fonts and a (hopefully) simpler dialog. This ZIP only contains the assembley, I will leave the decision to EER over whether to publish the source.

I've already published the codelab source, so these modifications are entirely yours. Please feel free to make the source available as you wish.

0

Share this post


Link to post
Share on other sites
Here is my modification of this plugin that supports custom fonts and a (hopefully) simpler dialog. This ZIP only contains the assembley, I will leave the decision to EER over whether to publish the source.

I've already published the codelab source, so these modifications are entirely yours. Please feel free to make the source available as you wish.

I made few changes to the source, so surely claiming the modifications as mine would be parasitic?

0

Share this post


Link to post
Share on other sites
I've already published the codelab source, so these modifications are entirely yours. Please feel free to make the source available as you wish.
I made few changes to the source, so surely claiming the modifications as mine would be parasitic?

Lets call it a joint effort :D

0

Share this post


Link to post
Share on other sites
I've already published the codelab source, so these modifications are entirely yours. Please feel free to make the source available as you wish.
I made few changes to the source, so surely claiming the modifications as mine would be parasitic?

Lets call it a joint effort :D

That would be similar to calling Babya PhotoPro a joint effort between Rick Brewster and aafuss. This plugin is your project and your work, all I did is add a UI and a few classes.

0

Share this post


Link to post
Share on other sites
....all I did is add a UI and a few classes.

That's enough for me to call it a joint effort. Seriously.

I have updated the original post to link to your version, and retained the original ( for users would like to follow Mikes' tutorial :http://paintdotnet.forumer.com/viewtopic.php?f=5&t=25502 and fiddle with it in codelab).

0

Share this post


Link to post
Share on other sites
That's enough for me to call it a joint effort. Seriously.

If you believe so I will accept this. One thing, I reccomend attaching the modification to the first post rather than linking to the direct post, as this will allow users to easily select which one they wish to download.

0

Share this post


Link to post
Share on other sites
I reccomend attaching the modification to the first post rather than linking to the direct post, as this will allow users to easily select which one they wish to download.

A couple of minor problems with your new version of the plug-in:

1. Spelling error in "Character" :wink:

2. Column numbering uses the selected font, so if the font doesn't have digits, the column offsets are not numerals. See Webdings/wingdings selections. You might want to tickle the font used for the column offsets (top) to the same one as the row offsets (left).

If you want to make these minor changes, I'll then provide the link in my original post.

0

Share this post


Link to post
Share on other sites

"Which Symbol" module

Tried it -

Feedback

It only allows one to select (or type a number) for a character upto 125

Which reminds me of the old ASCII limit of 124

Related?

Anyhoo - as I wanted little arrows and side facing triangles to bung over the top of

screen shots of medical software - I can't use it; which a pity really. I liked the idea.

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
Sign in to follow this  
Followers 0