Jump to content


Photo

WhichSymbolPlus (updated 12 Dec 2010)


  • Please log in to reply
53 replies to this topic

#1 Ego Eram Reputo

Ego Eram Reputo

    Master of Competition Ideas and 2012 Proton Award Winner

  • Moderators
  • 5,761 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:231

Posted 07 July 2008 - 06:11 AM

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....,

Posted Image


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.

After downloading:

1. Unzip the file and place WhichSymbolRedux.dll in your Paint.Net/Effects folder.
2. While you're there, delete any other files named WhichSymbol*.
3. Restart Paint.Net.

Attached Files



#2 D3z

D3z
  • Members
  • 230 posts
  • LocationSouth Africa
  • Reputation:0

Posted 07 July 2008 - 06:31 AM

This could be quite useful. Thanks :)
Posted Image
"Confusion is the welcome mat at the door of creativity." -Michaul Gelb
My Gallery Check it out!

#3 Ash

Ash

    Former Moderator

  • Members
  • 6,381 posts
  • Locationhttp://tinyurl.com/6kqz9v
  • Reputation:5

Posted 07 July 2008 - 07:04 AM

Cool, thank you!

Posted Image
All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ]


#4 oma

oma

    2012 Hit & Miss Award Winner

  • Members
  • 4,432 posts
  • Reputation:12

Posted 07 July 2008 - 03:20 PM

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

#5 Dalton

Dalton
  • Members
  • 572 posts
  • Reputation:1

Posted 07 July 2008 - 05:57 PM

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

Anyway.. thanks. :D
MyBB Tutorials, check out my site. :)

#6 Ego Eram Reputo

Ego Eram Reputo

    Master of Competition Ideas and 2012 Proton Award Winner

  • Moderators
  • 5,761 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:231

Posted 09 July 2008 - 12:16 AM

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 :)

#7 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 09 July 2008 - 12:22 AM

If this is CodeLab created than I want src.

Posted Image


#8 Ego Eram Reputo

Ego Eram Reputo

    Master of Competition Ideas and 2012 Proton Award Winner

  • Moderators
  • 5,761 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:231

Posted 09 July 2008 - 08:13 AM

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 
 © 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.<img src='http://forums.getpaint.net/public/style_emoticons/<#EMO_DIR#>/boltbait.cool.png' class='bbc_emoticon' alt='B)' />);
 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));
 }
 }
}


#9 Ego Eram Reputo

Ego Eram Reputo

    Master of Competition Ideas and 2012 Proton Award Winner

  • Moderators
  • 5,761 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:231

Posted 09 July 2008 - 09:07 AM

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!

#10 BoltBait

BoltBait
  • Administrators
  • 8,933 posts
  • LocationCalifornia, USA
  • Reputation:103

Posted 09 July 2008 - 04:12 PM

I just wanted to let you know that I simply LOVE this plugin. 8)
Click to play:
Posted ImagePosted ImagePosted ImagePosted ImagePosted Image
Download: BoltBait's Plugin Pack | CodeLab | More... and how about a Computer Dominos Game

#11 R3VENGE

R3VENGE
  • Members
  • 1,162 posts
  • Reputation:0

Posted 09 July 2008 - 04:37 PM

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

Posted Image
psn id: R3V-fiR3


#12 rwp80

rwp80
  • Members
  • 49 posts
  • Reputation:0

Posted 10 July 2008 - 04:30 PM

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

#13 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 11 July 2008 - 03:03 AM

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.

Posted Image


#14 oma

oma

    2012 Hit & Miss Award Winner

  • Members
  • 4,432 posts
  • Reputation:12

Posted 11 July 2008 - 03:07 AM

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.

#15 Ego Eram Reputo

Ego Eram Reputo

    Master of Competition Ideas and 2012 Proton Award Winner

  • Moderators
  • 5,761 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:231

Posted 11 July 2008 - 03:08 AM

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.

#16 Mike Ryan

Mike Ryan
  • Competition Hosts
  • 4,263 posts
  • Reputation:9

Posted 14 July 2008 - 02:54 PM

For those interested in a basic tutorial on adding font types, please read this tutorial: viewtopic.php?f=5&t=25502

Posted Image


#17 Simon Brown

Simon Brown
  • Members
  • 10,187 posts
  • Reputation:15

Posted 15 July 2008 - 03:08 PM

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.

Posted Image

Attached Files


Posted Image

#18 Ego Eram Reputo

Ego Eram Reputo

    Master of Competition Ideas and 2012 Proton Award Winner

  • Moderators
  • 5,761 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:231

Posted 15 July 2008 - 10:11 PM

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.

#19 Simon Brown

Simon Brown
  • Members
  • 10,187 posts
  • Reputation:15

Posted 15 July 2008 - 10:26 PM

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?
Posted Image

#20 Ego Eram Reputo

Ego Eram Reputo

    Master of Competition Ideas and 2012 Proton Award Winner

  • Moderators
  • 5,761 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:231

Posted 16 July 2008 - 12:12 AM

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