roro69 Posted December 31, 2015 Share Posted December 31, 2015 Hello Thanks to this excellent forum and assistance I could create plugin for drawing text on the canvas; and now I want that when I use certain Font; I can reduce the spacing (Kerning Font) between each letter. Thank you for the help provided and the time spent. Quote Link to comment Share on other sites More sharing options...
Eli Posted December 31, 2015 Share Posted December 31, 2015 Hello Roro69, There is an effect that allows you to choose the font and change the kerning... Text+ Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted December 31, 2015 Share Posted December 31, 2015 Not a question about actual plugin development ... thus, moving to General Discussion 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...
Ego Eram Reputo Posted December 31, 2015 Share Posted December 31, 2015 Something like this? http://forums.getpaint.net/index.php?/topic/19846-how-to-make-text-align/#entry334305 Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
roro69 Posted January 1, 2016 Author Share Posted January 1, 2016 Hello thank you for your answers Too bad the topic and was moved because I would really like to know the code to achieve this. I repecte Decision Too bad the plugin link does not work for downloaded. Thank you for the help and time spent Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 1, 2016 Share Posted January 1, 2016 @BoltBait has written a fantastic series of CodeLab tutorials which you can find on his website BoltBait.com. You might find this one of interest http://boltbait.com/pdn/CodeLab/help/tutorial4.php. It covers rendering text which should get you started. As you will see, GDI+ is used to render the text. I'm not sure if you can configure kerning via GDI+, but thats where I would start looking. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Rick Brewster Posted January 1, 2016 Share Posted January 1, 2016 Are you trying to write your own plugin? It wasn't clear that you were asking about actual plugin development. If so then I can simply move this back to the Plugin Developer Center. 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...
roro69 Posted January 2, 2016 Author Share Posted January 2, 2016 Hello Yes I create a text effect plugins; and I wanted in my plugin manage the spacing of the letters; here is the code already implemented: code for transform text and drawtext // Write and transformation text g.ScaleTransform(Amount7, Amount8, System.Drawing.Drawing2D.MatrixOrder.Append); g.TranslateTransform(cx, cy,System.Drawing.Drawing2D.MatrixOrder.Append); StringFormat string_format = new StringFormat(); string_format.Alignment = StringAlignment.Center; string_format.LineAlignment = StringAlignment.Center; g.DrawString(Amount1, SelectedFont, Brush1, 0, 0, string_format); Thank you for their time and assistance provided : Quote Link to comment Share on other sites More sharing options...
midora Posted January 2, 2016 Share Posted January 2, 2016 You can't do this out of the box in .NET. Maybe google for "gdi+ character spacing". You may use SetTextCharacterExtra or ExtTextOut. [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern int SetTextCharacterExtra( IntPtr hdc, // DC handle int nCharExtra // extra-space value ); ... //set spacing between characters IntPtr hdc = g.GetHdc(); SetTextCharacterExtra(hdc, 10); g.ReleaseHdc(hdc); ... Quote Link to comment Share on other sites More sharing options...
roro69 Posted January 3, 2016 Author Share Posted January 3, 2016 Hello Thank you for your answers I tried but the result is not good; I tried going through a rather strinbuilder dessinner and a letter at a time and make a difference as I want Thank you for the help provided and the time spent Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 3, 2016 Share Posted January 3, 2016 The markup plugin/technique I demonstrate here http://forums.getpaint.net/index.php?/topic/106683-block-of-text-with-different-sizes/#entry509712 may be of interest. CSS allows some basic kerning (called letter-spacing in the code). Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker 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.