Pfont2

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#16 Post by vovchik »

@ Maik.Murks:

In my little script called "pfont2", which is /usr/local/bin", you can replace the line 179:

Code: Select all

<action>gfontsel &</action>
with

Code: Select all

<action>Xdialog --fontsel "" 0 0 &</action>
I took Zigbert's code, if I remember correctly, but Xdialog does the exact same thing. This should work in all Puppies, since Xdialog is present in all of them, I think. Let me know whether it works for you. If so, I will change Pfont2 to use Xdialog for the installed font display.

@ disciple:

Good question :) I think a tiny script along the lines of the above will do the trick and we can reduce Puppy by a few kilobytes (gfontsel is 6k, but a script is much smaller), and "a byte saved is a byte earned".

With kind regards,
vovchik

PS. Rod/Gatordog has written a font display prog in BaCon. It is in Programming/Bacon Bits.

User avatar
maik.murks
Posts: 327
Joined: Mon 28 Mar 2011, 06:19
Location: at home, at work or on holidays

#17 Post by maik.murks »

vovchik wrote:@ Maik.Murks:

In my little script called "pfont2", which is /usr/local/bin", you can replace the line 179:

Code: Select all

<action>gfontsel &</action>
with

Code: Select all

<action>Xdialog --fontsel "" 0 0 &</action>
I took Zigbert's code, if I remember correctly, but Xdialog does the exact same thing. This should work in all Puppies, since Xdialog is present in all of them, I think. Let me know whether it works for you. If so, I will change Pfont2 to use Xdialog for the installed font display.

Hi vovchik.

I‘ve changed line 179 in that manner you‘ve told me. And what should I say? It simply works. Well, it works like a charme :D
Thank you very much for your help and your patience with me :D

Cheers :wink:

Maik.Murks

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

good news

#18 Post by vovchik »

Dear Maik.Murks,

I am glad you managed to do the edit and that it worked. I think I will do it that way in the next release, if I don't have my own previewer written by then :) What is important is that you pointed out (i) that gfontsel was missing in some Puppies, and (ii) that gfontsel is actually unnecessary in Puppy distros if Xdialog is present. So, thanks to you!

With kind regards,
vovchik

User avatar
darkcity
Posts: 2534
Joined: Sun 23 May 2010, 19:16
Location: near here
Contact:

#19 Post by darkcity »

http://puppylinux.org/wikka/PFont2

I've added to wiki.

I too get the problem of the preview image not showing next to the description and have to use Viewnior.

I've installed the gtk-splash - but then it show the [X] image not found icon next to description.

Cheers ; -)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#20 Post by disciple »

Are you making any progress with your previewer, vovchik? Will it be able to preview .ttf files which aren't installed? (EDIT - sorry, yes of course it will, that's the whole point of this app, and why I didn't ask this question when I first saw this thread.)
In the past I spent quite a long time searching for something lightweight to do that (the only thing for linux seems to be Opcion, written in Java :(), but I didn't quite have the expertise to write one myself.
Last edited by disciple on Sat 03 Sep 2011, 11:09, edited 1 time in total.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
darkcity
Posts: 2534
Joined: Sun 23 May 2010, 19:16
Location: near here
Contact:

#21 Post by darkcity »

It can preview ttf fonts- it create an image file in /tmp

however for some reason it doesn't display the image file correctly in the app itself.

---

When you click preview - do you get a window containing a description of the font but no image?

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#22 Post by thunor »

Great, works for me on Slacko 5.3.3 :)

I'm actually interested in the preview part only as you might've guessed from my pfontview program and I've found that changing ROX's "Set Run Action..." to ttf "@" does the trick.

The fonts which I've downloaded that gtk/Pango refuse to initialise to are successfully shown using your ttf program so that's good.

Regards,
Thunor

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#23 Post by thunor »

Hi vovchik

Can I recommend something?

In pfont2, in function make_gui() there is an entry widget for the filename, add this:

Code: Select all

<default>"'$1'"</default>
In pfont2, at the bottom where make_gui is called, change it to this:

Code: Select all

make_gui "$1"
Now you can pass in a filename from another program i.e. pfontview's Pfont2 menuitem.

In ttf, comment-out the following code to stop limiting files to *.ttf files:

Code: Select all

mylow=$(echo $mysuffix |tr '[A-Z]' '[a-z]')
...
...
if [[ "$mylow" == "ttf" ]]; then
...
...
else
	gtkdialog-splash -placement top -timeout 4 -fontsize medium -icon "gtk-dialog-error" -text "$msg_nottf"
fi
Now you can view *.otf files :)

Regards,
Thunor

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#24 Post by perdido »

The last version of puppy this worked correctly was Puppy Precise 5.7.1
Nice utility, would be nice if updated for later puppies.

Image


Image

.

Post Reply