font2font - a better pfontview?

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
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

font2font - a better pfontview?

#1 Post by MochiMoppel »

In one of my recent comments on pfontview, Puppy's standard font viewer, I argued that this tool needs not only a fix but a rewrite.

I tried that, and the result is IMHO opinion more useful, but finally that's not for me to decide, so I'll better add a questionmark to my claim. I decided to do a complete rewrite because I wanted more functionality with less code and less files. Since I didn't use a single line of the original code I also had to come up with a new name.

What's different in font2font
⚫ Apart from TTF and OTF files, full support for TTC and PFB files

⚫ The selected font is always compared to a second font. I find it hard to judge a font by staring at the glyphs. Often only when I compare the font to a similar font I can see differences. And even when the glyphs look almost identical, the width very often is not.

⚫ No more jumping foxes. The preview text is customizable, can be changed on-the-fly and of course can be saved. This also eliminates the need for an extra preview entry field.

⚫ Preview size can also be changed on-the-fly (up to size 200)

⚫ No "style" display for the selected font. I've come to the conclusion that the "style" element is almost useless. It's just a more or less fancy name like the font name and may or may not reflect the characteristics of a font. It's all up to the font author to name the style. Interestingly the GTK font button for the comparison font returns a style calculated based on the font metrics, ignoring whatever name was selected in the dialog. E.g. in my font "Jedi" the style is named "Normal", but the GTK button returns "Jedi Bold Semi-Expanded" because weight is 200 and width is 113. This label would be added to the darkred name of the comparison font while "Jedi Normal" would be the label for the font button. Utterly confusing. That's why I let the font button only show the font name but not the style.

⚫ An additional Info diplay shows font properties and metrics. Here the user can see the "style" name(s) and more important information like weight or width.

⚫ The Save button will, among other things (see tooltip), save window position, not just window size.

⚫ font2font uses much less files (3 files vs. 18 files for pfontview, not including the obsolete sfontview).

⚫ Can be called without an argument (sometimes useful for testing)

What's the same
⚫ Ability to preview uninstalled fonts (by temporarily installing font for the duration of preview). Hmm, this sentence makes no sense but I hope you get the idea anyway.

⚫ Installation. There is none. Just copy script to /usr/bin, make executable if needed and associate TTF,TTC, OTC, PFB files in ROX-Filer by right-clicking such file, select "Set Run Action" and edit the command. Alternatively create a desktop icon and drag font files onto it.
Attachments
font2font.gz
(2.61 KiB) Downloaded 88 times
font2font.png
(113.68 KiB) Downloaded 248 times
Last edited by MochiMoppel on Sat 27 Jun 2020, 07:17, edited 1 time in total.

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

#2 Post by vovchik »

Dear MochiMoppel,

Thanks. Very nicely done - and the comparison is useful.

With kind regards,
vovchik

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#3 Post by greengeek »

Useful utility, thanks.

Can you suggest why I see the following symbols shown when I compare Dingbats? I assume something must be missing from my system or incorrectly set up.

I can use Dingbats within Abiword so as far as I know the actual font is installed.

Thanks!
Attachments
Compare_Dingbats.jpg
(63.39 KiB) Downloaded 150 times

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#4 Post by MochiMoppel »

greengeek wrote:I can use Dingbats within Abiword
No, you can not (assuming that you are still using Slacko 5.6).

You don't see numbers and letters in font2font because the Dingbats font doesn't contain these characters. It just contains (most) of the Unicode characters of the Dingbats block (hence the name :wink: ) and a few other ornamental characters. When you open Abiword with a new document, select Dingbats as your font, then type away, what happens? Can you type any alphanumeric character? I can't. When I type Shift+% Abiword prints a telephone. And if you think that this is one of the few characters contained in the Dingbats font, you are wrong. What you see is a DejaVu Sans telephone, not a Dingbats telephone

Try to paste these 3 characters (click on "Edit sample text") into the font2font sample text: ☎✑✒
You can see that these characters are different in DejaVu Sans and Dingbats.

[Edit] Retracted my claim that no application renders Dingbats glyphs. Geany and Leafpad do. Abiword does too but only via the Insert > Symbols menu, where Dingbats font needs to be selected from the dropdown list.

.
Last edited by MochiMoppel on Mon 29 Jun 2020, 06:20, edited 3 times in total.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#5 Post by greengeek »

MochiMoppel wrote:In fact you can't use the Dingbats font anywhere.
You don't see numbers and letters in font2font because the Dingbats font doesn't contain these characters. It just contains (most)
of the Unicode characters of the Dingbat Block ....
When you open Abiword with a new document, select Dingbats as your font, then type away, what happens? ...
When I type Shift+% Abiword prints a telephone. ...
Try to paste these 3 characters (click on "Edit sample text") into the font2font sample text: ☎✑✒ .
Oh my gosh. So many mysteries to be unravelled. Who knew this stuff was so complex? $%&*!??

Thanks for all the info. Much appreciated!
Attachments
f2f_dings.jpg
(24.24 KiB) Downloaded 76 times
AbiwordDingbatTest.jpg
(31.79 KiB) Downloaded 76 times

Post Reply