n d Posted August 24, 2010 Share Posted August 24, 2010 Ergonomic? User-friendly? Nah, those things are for pussies! LOL! So basically, I was getting tired manually adjusting the kerning of some fonts, and so I started thinking... could I write a plugin to write kerning-adjusted text? So, quickly thinking, the first idea I got was to give a slider to each letter to adjust the kerning... so yeah, it sounded good in theory... but man, when I saw that huge stack of sliders I was like =O=O=O ...anyway, it works, but the UI is so horrible that I'm too embarassed to put it on the general plugins forum... if anyone wants to use this monstrosity, here you go: Kerned text plugin it also has x,y control and bold/italic options. ps. Imagine, initially I was going to set the string maximum to 100! 1 Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted August 24, 2010 Share Posted August 24, 2010 Worst UI ever, honestly ... Then again, IndirectUI doesn't give you all the most complete bestest UI flexibility ever. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
LFC4EVER Posted August 24, 2010 Share Posted August 24, 2010 why not have a drop down box for each character and just one slider? That way you can choose which letter to adjust the kerning on and adjust the slider for the chosen letter? btw, i have no idea whether or not the above is possible, i'm just throwing out an idea here. Quote ☆★☆★Merry Christmas★☆★☆  .::.My Gallery.::.Make Gold Text!.::. Link to comment Share on other sites More sharing options...
n d Posted August 24, 2010 Author Share Posted August 24, 2010 Worst UI ever, honestly ... Then again, IndirectUI doesn't give you all the most complete bestest UI flexibility ever. I'll take the liberty of taking that as a compliment why not have a drop down box for each character and just one slider? That way you can choose which letter to adjust the kerning on and adjust the slider for the chosen letter? btw, i have no idea whether or not the above is possible, i'm just throwing out an idea here. It's not possible with codelab... It could be if I would export the source to visual studio and edit it there, but I'm not all too sure about the details ... btw I just added an anti-alias function (re-download if needed, the link is the same.) Quote Link to comment Share on other sites More sharing options...
LFC4EVER Posted August 24, 2010 Share Posted August 24, 2010 oh, ok then. Igonoring the UI, the plugin is fantastic. Saves a lot of selecting and moving text letters individually to get the right look. thanks! Hope you wont mind some more suggestions, but i'll suggest anyway. - add an open type font compatability. - perhaps a kerning in the y axis option? - scale the text from the centre of the text, not the top left? anti-aliasing doesn't always work at larger font sizes if set to 2. it works pretty much all the time if set to 1. Thats.. about it. Great work though! Loving all of it, well, most of it. Quote ☆★☆★Merry Christmas★☆★☆  .::.My Gallery.::.Make Gold Text!.::. Link to comment Share on other sites More sharing options...
n d Posted August 24, 2010 Author Share Posted August 24, 2010 (edited) oh, ok then. Igonoring the UI, the plugin is fantastic. Saves a lot of selecting and moving text letters individually to get the right look. thanks! Glad you like it. Hope you wont mind some more suggestions, but i'll suggest anyway. I won't mind. - add an open type font compatability. It already is. At least, opentype fonts work on it on my computer. If they don't on yours... I honestly have no idea why that would be. - perhaps a kerning in the y axis option? You do realize this would double the amount of sliders? Are you sure you want this? - scale the text from the centre of the text, not the top left? Hm. The Graphics.DrawString method uses the top left corner for the text placement, so I don't know - I might be able to do this with the y axis, but doing it with the x axis would be kinda complicated .... anti-aliasing doesn't always work at larger font sizes if set to 2. it works pretty much all the time if set to 1. So just use 1. Honestly, I'm not even sure what the 2 option is useful for, but decided to include it anyways... Thats.. about it. Great work though! Loving all of it, well, most of it. Thanks. Something I am going to add is an "overall" slider which adjusts the overall x-spacing of the letters... I noticed, with longer words and fonts that need lots of adjusting, the sliders may not go far enough... so this would fix this problem without making the sliders too big and hard to adjust (the UI is bad enough already...) Edited August 24, 2010 by n d Quote Link to comment Share on other sites More sharing options...
Simon Brown Posted August 24, 2010 Share Posted August 24, 2010 It could be if I would export the source to visual studio and edit it there, but I'm not all too sure about the details ... Create a new class library in VS, add the main PDN DLLs (Base, Core, Data and Effects) as references, run the save as DLL command in CodeLab and check view source, then paste it into your VS code file. Quote Link to comment Share on other sites More sharing options...
n d Posted August 24, 2010 Author Share Posted August 24, 2010 Create a new class library in VS, add the main PDN DLLs (Base, Core, Data and Effects) as references, run the save as DLL command in CodeLab and check view source, then paste it into your VS code file. Yep, I had gotten that far... I'm just not all too sure how to implement the drop-down + slider functionality on the plugin. Can I use the VS winforms designer to design the plugin interface? Sorry, I'm quite a noob at this still.. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted August 24, 2010 Share Posted August 24, 2010 You can do whatever UI you want, but you'll have to stop using IndirectUI and implement all of the WinForms layout and data binding yourself. Not very fun, honestly. That's the whole reason I created IndirectUI. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
n d Posted August 24, 2010 Author Share Posted August 24, 2010 Is there any way to do a drop-down box using the indirectUI? Quote Link to comment Share on other sites More sharing options...
Simon Brown Posted August 24, 2010 Share Posted August 24, 2010 Have you considered just using a slider to select which character to adjust? If you wanted to have a dropdown box listing every letter you'd presumably have to OCR the image. Quote Link to comment Share on other sites More sharing options...
pyrochild Posted August 24, 2010 Share Posted August 24, 2010 Is there any way to do a drop-down box using the indirectUI? Yes, using the StaticListChoiceProperty, but as the name implies, it's static. You can't change its items once it's been created. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
n d Posted August 24, 2010 Author Share Posted August 24, 2010 (edited) Have you considered just using a slider to select which character to adjust? If you wanted to have a dropdown box listing every letter you'd presumably have to OCR the image. Yeah, a slider would probably work. I can't believe I didn't think of that... So, I should make two sliders. Let's name them Amount1 and Amount2 for simplicity... Amount1 would control which character Amount2 moves. So, every time Amount2 is changed my code should check the value in Amount1 and then it adjusts the number in the kerning array[Amount1] according to the value of Amount2. So what I need to know, is there a method that can be used (in codelab if possible?) to check if the value of Amount2 changes? Edited August 24, 2010 by n d Quote Link to comment Share on other sites More sharing options...
Simon Brown Posted August 24, 2010 Share Posted August 24, 2010 Every time any IndirectUI value is changed the render method is automatically called. One downside with the approach I suggested is IIRC you can't change the slider boundaries dynamically, so you'll have to make Amount1 relatively large and show an error message if it exceeds the number of letters. Quote Link to comment Share on other sites More sharing options...
n d Posted August 24, 2010 Author Share Posted August 24, 2010 (edited) One downside with the approach I suggested is IIRC you can't change the slider boundaries dynamically, so you'll have to make Amount1 relatively large and show an error message if it exceeds the number of letters. Hm. couldn't I also just transfer the string into an array of char and pad it with spaces, so it will always be long enough? Edited August 24, 2010 by n d Quote Link to comment Share on other sites More sharing options...
Simon Brown Posted August 24, 2010 Share Posted August 24, 2010 Having it do nothing might be confusing. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted August 25, 2010 Share Posted August 25, 2010 You can come up with all sorts of clever things, but in the end the only thing you'll get is an inbox full of confused users. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
pyrochild Posted August 25, 2010 Share Posted August 25, 2010 Pesky users. Hate 'em. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
n d Posted August 25, 2010 Author Share Posted August 25, 2010 Well... personally I feel if the users can't understand that a slider that controls which character you move doesn't move anything if you set it on letter #20 on a 10-letter word, then I would recommend some basic math lessons before they even try to use a computer. But yeah, if anyone can think of a better solution I'm all ears (or should I say eyes.) Quote Link to comment Share on other sites More sharing options...
csm725 Posted August 25, 2010 Share Posted August 25, 2010 (edited) Not sure if this has already been mentioned, but why not convert the string to an array, get rid of spaces, and run a for (int i=0, i<array.length, i++) loop and declare a new array in the for code block and make the text under newArray be "character i"? This could be horrendously stupid, I'm just wondering. Edited August 25, 2010 by csm725 Quote My deviantART | Sig Battles | My Tutorials | csm725.com Click to enter or vote in the official Paint.NET competitions! COMPETITIONS: LOGO OF THE WEEK Link to comment Share on other sites More sharing options...
n d Posted August 25, 2010 Author Share Posted August 25, 2010 CSM, that's similar to what I'm already doing, and doesn't really address the issue at hand - the problem isn't controlling the values, the problem is the user interface... I'm trying to figure out a way to implement this with a better interface - ie. less sliders. Thanks though. Quote Link to comment Share on other sites More sharing options...
n d Posted August 25, 2010 Author Share Posted August 25, 2010 (edited) Ok, as for the 2 sliders thing, apparently I can't do that on codelab. I would need to declare the array where the kerning values will be stored outside the render loop, so that it is declared only once when the effect is started. Otherwise the effect keeps resetting the array everytime the render loop is called... So where should I declare the array? edit. never mind, figured that out (I made a new public static class at the start of the effect and that seems to work.) Edited August 25, 2010 by n d Quote Link to comment Share on other sites More sharing options...
n d Posted August 25, 2010 Author Share Posted August 25, 2010 (edited) Now there's a new problem though: Every time slider1 is moved, it automatically sets the kerning values to whatever slider2 happens to be at that time. So this would mean that the values would have to be adjusted in order, and you can't move back to change anything or you'll have to adjust everything in between again... not a big improvement from the previous UI. Is there a way to move the sliders from inside the plugin? I would like the value that's stored in the array to be restored to the second slider when the first slider is moved. But can I do that, and if so, how? Edited August 25, 2010 by n d Quote Link to comment Share on other sites More sharing options...
Simon Brown Posted August 25, 2010 Share Posted August 25, 2010 One solution would be to replace the 2nd slider with increase and decrease buttons, although this obviously wouldn't be as convenient as a slider. Quote Link to comment Share on other sites More sharing options...
n d Posted August 25, 2010 Author Share Posted August 25, 2010 One solution would be to replace the 2nd slider with increase and decrease buttons, although this obviously wouldn't be as convenient as a slider. True.. it would be kinda inconvenient. is there no way the value of the indirectUI controls can be manipulated from within the code? Do I need to create a winforms interface for this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.