GUI text-size utility gets width & height of text.

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

GUI text-size utility gets width & height of text.

#1 Post by sunburnt »

I posted this useful dev`s tool for sizing GUI text widgets.

# Now it takes Bash piped stdin, so it can do a list all at once
Example: echo -e 'abc\n01234567\n\n\nzzzzz' | /root/0_BaCon/label_pixels2/text-size -f Sans 20

# It also now takes /path/file as last argument to input a list.
Example: /root/0_BaCon/label_pixels2/text-size -l -w /root/0_BaCon/label_pixels2/test.tx

It reports the pixel size of each line, or it can report the entire list's block of text.
Before it only took one line at a time as an argument.

Now it can also work without trailing arguments. There are default: Font, W/H, & Angle.

It will output any combination of: PixelWidth:PixelHeight:TextLines ( so no parsing the output )


It`s written in BaCon, and it`s compiled on Precise-5.4.X.5. If problems I'll post code.
It`s UPXed, so hopefully it works with most Linuxes. If not, say so and I`ll post non UPXed.

For help type in rxvt: text-size -?

### Notice how the menu text is both Left & Right justified, making the buttons all the same width.
.
Attachments
text-size.zip
UnZip and move to: /usr/bin
(19.75 KiB) Downloaded 228 times
Menu_Xfe.png
(69.67 KiB) Downloaded 240 times

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#2 Post by slavvo67 »

Hi Sunburnt:

Forgive me but I'm curious what this application would be used for. I gather for document conversions or to confirm you have the same size text in an entire document?

Thanks and best regards,

Slavvo67

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#3 Post by sunburnt »

Hi slavvo67; Mostly I use it for text placement, as the pic shows.
The buttons have both left-justified and right-justified text on them.

Here is my original post that shows it`s markup text ability.
http://www.murga-linux.com/puppy/viewtopic.php?t=88292

Post Reply