It is currently 21 Oct 2021, 02:47

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP
Sponsored content for World Food Program

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

Share your Python Fu Scripts/plug-ins for GIMP here
tim
GL Blogger
1st Place
5544 Post(s)

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

Post#1 by tim » 12 Mar 2017, 06: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.
Font-to-layers.zip #
zipped .py file (unzip, put in your GIMP's /plug-ins/ folder)
(1.87 KiB) Downloaded 128 times
version 1 doesn't work for w's and m's because it's still not wide enough so here's version 2
Font-to-layers (2).zip #
version 2
(2 KiB) Downloaded 129 times
Font-to-layers (3).zip #
version 3
(2.04 KiB) Downloaded 162 times
aka Tin
World Food Program | Good Deeds Forum

         

Wallace
Global Moderator
13th Place
899 Post(s)

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


tim wrote:
12 Mar 2017, 06: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 7337 times (Thumbnail | Recognize | Sq Tile | LNFI)
abcd.PNG
abcd.PNG # (72.19 KiB) Viewed 7337 times (Thumbnail | Recognize | Sq Tile | LNFI)
Here's what the "W" looks like...
wideawake_W.PNG
wideawake_W.PNG # (18.2 KiB) Viewed 7331 times (Thumbnail | Recognize | Sq Tile | LNFI)
Image

tim
GL Blogger
1st Place
5544 Post(s)

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


Please give version 2 a try.
aka Tin
World Food Program | Good Deeds Forum

         

Wallace
Global Moderator
13th Place
899 Post(s)

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


tim wrote:
12 Mar 2017, 17: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 7319 times (Thumbnail | Recognize | Sq Tile | LNFI)
---------------------------------------------------------------------------------------

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 7316 times (Thumbnail | Recognize | Sq Tile | LNFI)
Image

tim
GL Blogger
1st Place
5544 Post(s)

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


Please try version 3.
aka Tin
World Food Program | Good Deeds Forum

         

Wallace
Global Moderator
13th Place
899 Post(s)

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


tim wrote:
12 Mar 2017, 18: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 7303 times (Thumbnail | Recognize | Sq Tile | LNFI)
Image

tim
GL Blogger
1st Place
5544 Post(s)

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


only problem is now you gotta vertically align them.... as there is no information on the font to auto align.
aka Tin
World Food Program | Good Deeds Forum

         

Wallace
Global Moderator
13th Place
899 Post(s)

Post#8 by Wallace » 12 Mar 2017, 19:26


tim wrote:
12 Mar 2017, 19:01
only problem is now you gotta vertically align them.... as there is no information on the font to auto align.
youretheman.png
youretheman.png # (30.58 KiB) Viewed 7081 times (Thumbnail | Recognize | Sq Tile | LNFI)
Image

tim
GL Blogger
1st Place
5544 Post(s)

Post#9 by tim » 12 Mar 2017, 22:07


No, you're the man with all your useful requests and bugs
aka Tin
World Food Program | Good Deeds Forum

         

Wallace
Global Moderator
13th Place
899 Post(s)

Post#10 by Wallace » 14 Mar 2017, 02:45


tim wrote:
12 Mar 2017, 22:07
No, you're the man with all your useful requests and bugs
:yay_yay_purple:
Image


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply New Topic
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests