It is currently 17 Dec 2017, 17:09

GIMP Python Fu ScriptsFont to layers Python Script for GIMP (fixed for wideawakeblack.ttf) (Showcase | Slideshow)

Share your Python Fu scripts for GIMP here
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 5/10
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1005
x 217
Contact:
Canada

Font to layers Python Script for GIMP (fixed for wideawakeblack.ttf)

Post#1 by tim » 11 Mar 2017, 22:49


This is a script by MareroQ on Gimpchat.com.
Wallace reported a bug with wideawakeblack.ttf.

The problem isn't the script, the problem is with the font, it gets wrong numbers for width so text is chopped of.
As a work around I created layers with max_width, to allow characters to fit.
Then i autocrop layers to get proper width.
Then afterwards, i resize layers to have this proper width, and restore height to whatever the height is supposed to be.
Seems to work okay for this wideawakeblack.ttf.

:download:
Font-to-layers.zip #
zipped .py file (unzip, put in your GIMP's /plug-ins/ folder)
(1.87 KiB) Downloaded 16 times
version 1 doesn't work for w's and m's because it's still not wide enough so here's version 2
:download:
Font-to-layers (2).zip #
(2 KiB) Downloaded 17 times
:download:
Font-to-layers (3).zip #
(2.04 KiB) Downloaded 36 times
0 x



aka Tin
Image gimplearn.net                                              

Registered members enjoy ads-free content
User avatar
Wallace
Forum Member
View: Showcase | Slideshow
Topic Posts: 5/10
Posts: 191
Joined: 11 Oct 2016, 14:24
Cash on hand: 1,330.17 GLP
Gender: Guy
Location: Arizona USA
Website: http://gimpchat.com
Operating System: Windows
GIMP Version: 2.8.18
My YouTube Channel
My deviantart Account
x 3
x 29
Contact:
Gimp Nation

Post#2 by Wallace » 12 Mar 2017, 07:27


tim wrote:
11 Mar 2017, 22:49
This is a script by MareroQ on Gimpchat.com.
Wallace reported a bug with wideawakeblack.ttf.

The problem isn't the script, the problem is with the font, it gets wrong numbers for width so text is chopped of.
As a work around I created layers with max_width, to allow characters to fit.
Then i autocrop layers to get proper width.
Then afterwards, i resize layers to have this proper width, and restore height to whatever the height is supposed to be.
Seems to work okay for this wideawakeblack.ttf.

:download:
Font-to-layers.zip
Thanks Tim!
Much better then before.
However,
it looks like the "M" is getting chopped now. :(
The "W" was not rendered in my first example below,
but it too gets chopped off.
Screenshot (47).png
Screenshot (47).png # (372.31 KiB) Viewed 350 times (Watermarked | Thumbnail)
abcd.PNG
abcd.PNG # (72.19 KiB) Viewed 350 times (Watermarked | Thumbnail)
Here's what the "W" looks like...
wideawake_W.PNG
wideawake_W.PNG # (18.2 KiB) Viewed 344 times (Watermarked | Thumbnail)
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 5/10
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1005
x 217
Contact:
Canada

Post#3 by tim » 12 Mar 2017, 10:01


Please give version 2 a try.
0 x



aka Tin
Image gimplearn.net                                              

User avatar
Wallace
Forum Member
View: Showcase | Slideshow
Topic Posts: 5/10
Posts: 191
Joined: 11 Oct 2016, 14:24
Cash on hand: 1,330.17 GLP
Gender: Guy
Location: Arizona USA
Website: http://gimpchat.com
Operating System: Windows
GIMP Version: 2.8.18
My YouTube Channel
My deviantart Account
x 3
x 29
Contact:
Gimp Nation

Post#4 by Wallace » 12 Mar 2017, 10:27


tim wrote:
12 Mar 2017, 10:01
Please give version 2 a try.
This time it rendered correctly! :yay_yay_purple:

Thank you Tin!

However...
These errors were thrown.
errormessageftl.PNG
errormessageftl.PNG # (52.45 KiB) Viewed 332 times (Watermarked | Thumbnail)
---------------------------------------------------------------------------------------

I also tested the second script using font Radio1875_Bold.ttf,
which is one of my most favorite fonts.

As you can see from my screenshot.
The capital letters are all chopped off at the bottom.
Screenshot (48).png
Screenshot (48).png # (256.59 KiB) Viewed 329 times (Watermarked | Thumbnail)
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 5/10
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1005
x 217
Contact:
Canada

Post#5 by tim » 12 Mar 2017, 11:33


Please try version 3.
0 x



aka Tin
Image gimplearn.net                                              

User avatar
Wallace
Forum Member
View: Showcase | Slideshow
Topic Posts: 5/10
Posts: 191
Joined: 11 Oct 2016, 14:24
Cash on hand: 1,330.17 GLP
Gender: Guy
Location: Arizona USA
Website: http://gimpchat.com
Operating System: Windows
GIMP Version: 2.8.18
My YouTube Channel
My deviantart Account
x 3
x 29
Contact:
Gimp Nation

Post#6 by Wallace » 12 Mar 2017, 11:56


tim wrote:
12 Mar 2017, 11:33
Please try version 3.
Thanks again T!

This one worked well,
using the Radio Bold font. :yay_yay_purple:
wafont.PNG
wafont.PNG # (54.32 KiB) Viewed 316 times (Watermarked | Thumbnail)
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 5/10
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1005
x 217
Contact:
Canada

Post#7 by tim » 12 Mar 2017, 12:01


only problem is now you gotta vertically align them.... as there is no information on the font to auto align.
0 x



aka Tin
Image gimplearn.net                                              

Post Reply

Last 20 Members Who Visited This Topic

User avatar Pat625 (2), User avatar gnerd (3)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: Issabella
2: Pat625
3: tim
4: oldmangrumpy
5: Conbagui
6: Pat625
7: Ella

Who is online

Users browsing this forum: No registered users and 2 guests