It is currently 26 May 2020, 19:49

• 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

Custom Font Layers With Fixed Margins for Gimp 2.10

Share your Python Fu Scripts/plug-ins for GIMP here
Post Reply
skinnyhouse
Script Coder

Custom Font Layers With Fixed Margins for Gimp 2.10

Post#1 by skinnyhouse » 30 Nov 2019, 10:39


Custom_Fonts_Layers_With_Forced_Margins_V001.py
(23.33 KiB) Downloaded 104 times
This small custom font utility filter allows you to create a custom font file and set the exact size of the completed layers in pixels as opposed to points: Points are the default unit size when dealing with fonts in Gimp. It also allows you to set the exact size of the margins around the character. Normally, after converting a font to character layers with the current custom font tool, I would then resize the entire file to my usual standard size in pixels – now this step is no longer needed. The margin sizes would also be scaled and would no longer be the same as I originally intended.

The filter, once downloaded and installed to your user plug-ins folder, can be accessed from

Filters>>Custom Font Tools>>Custom Fonts Layers from Fonts With Fixed Margins

(Catchy title I know)
highlighted_dialog001.jpg
highlighted_dialog001.jpg (81.35 KiB) Viewed 4694 times
Use the size (red highlight) options to set the size of font and the space around the character within the layer. Although fairly forgiving, it is better to match the font size with the height of the scaled font in order to minimize any scaling issues.

The scaling options (green highlight) allow you to set the final font size to the pixel size or a size set by the height of the scaled font height value – with the margins in the values above.

If both scale options are set to ‘No’ the characters are given the Font size and will have no border space or margins set.

As an example I created three images using these options with a subset of characters from a font called Atlas; this font does not have a full set of characters to use and contains a number of letters that are actually not characters. Always check the layers to see what is there.

The filter will display a message to identify characters in the normal range that have not originally been created. Unicode characters (think non-current keyboard language characters) are created in the default unicode font by the python interpreter (I think).
Missing.jpg
Missing.jpg (26.74 KiB) Viewed 4694 times
I set the font size to 500 and the height of scaled font to 600.

With both the ‘Scale the custom font’ and the ‘Scale the custom font to actual pixel size’ set to ‘No’ the characters are placed on the smallest layer size that will fit the current set of characters. This resulted in an image with a width of 430 pixels and a height of 469 pixels.

With both scaling options set to ‘Yes’ the resultant image size (using the margin values) was scaled to a width of 475 pixels and a height of 500 pixels i.e. to the same value as the font size.

With only the ‘Scale the custom font’ set to ‘Yes’, however, the resultant image size (using the margin values) was scaled to a width of 570 pixels and a height of 600 pixels.
0


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
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 12 guests