Font Preview

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
misko_2083
Posts: 114
Joined: Tue 08 Nov 2016, 13:42

#31 Post by misko_2083 »

vovchik wrote:Dear step,

Nice job. I like that scaling button - it is useful. I modded some of the character categories in my latest, adding a few missing cyrillic glyphs. I think we are getting somewhere. :) Thanks.

With kind regards,
vovchik
^Cyrillic Ј ј and Ћћ are missing.
Interesting effect when --tooltip-column=1 is added to the Preview tab.
Pango markup is passed on to the tooltip.
Tooltip is also usefull in the font list too.

Step those are very usefull functions.
P.S. The '\' character isn't removed, some fonts are displayed like this

Code: Select all

Abecedario_punt\-pautada
instead of

Code: Select all

Abecedario_punt-pautada
Mochi It takes forever to load all the fonts. I have ~1300 of them.
For some reason, at some point in the list, the right column goes to the left and vice versa.

:roll: It's hard to keep track of all the versions in a single thread.

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

#32 Post by vovchik »

Dear Misko,

As for cyrillic, I have all Serbian chars in my latest version (posted near the bottom of page one, where I list the mods under UPDATES), and Bulgarian, Ukrainian, Russian and Belarusian. And I think I have all Polish, Czech and Croatian. I know there is an important "J" in Serbian, but I thought that it usually maps to a Latin "J". Should I add it - and its unicode value - to the cyrillic chars?

With kind regards,
vovchik

PS: Weird font names and funky fonts - mostly ttf. They exist and contain chars that Unix/Linux hate. For those fonts, you can use fontforge to edit the name within the font's text tables. The fonts then become Linux-friendly forever.

User avatar
misko_2083
Posts: 114
Joined: Tue 08 Nov 2016, 13:42

#33 Post by misko_2083 »

vovchik wrote:Dear Misko,

As for cyrillic, I have all Serbian chars in my latest version (posted near the bottom of page one, where I list the mods under UPDATES), and Bulgarian, Ukrainian, Russian and Belarusian. And I think I have all Polish, Czech and Croatian. I know there is an important "J" in Serbian, but I thought that it usually maps to a Latin "J". Should I add it - and its unicode value - to the cyrillic chars?
Well then cyrilic A would map to latin A.
Whenever I do search in cyrilic J it gives me different results from the web search with latin J.
There is this font with reconstruction of the letters from the 12th century book Miroslav's Gospel that doesn't contain anything else but Serbian Azbuka if you want to try.
https://fonts2u.com/miroslavljevooriginal.font

Thanks for the fontforge tip,
with kindest regards

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

#34 Post by vovchik »

Dear Misko,

I will add the unicode "J" to the cyrillic set. I also came across izhitsa, which looks similar to Miroslav -- what old Slavic monastic documents looked like https://github.com/semperos/kliros/blob ... ZHITSA.TTF. I will look at both now.

With kind regards,
vovchik

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#35 Post by step »

Thanks, rockedge, vovchik, misko_2083.

misko_2083> The '\' character isn't removed,...
Fixed in my next update (#3).

> ^Cyrillic Ј ј and Ћћ are missing...
Hopefully not anymore; update #3 incorporates vovchik's additions (up to his edit #10). I will include whatever characters additions he will add to yfontview.

> Interesting effect when --tooltip-column=1 is added to the Preview tab.
Will take a look.

I'm not uploading update #3 yet because it isn't finished.

Cheers!
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#36 Post by SFR »


[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

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

#37 Post by vovchik »

Dear SFR,

Yes, "jak głupio". I actually speak Polish OK, and do so at least one a week, and read the Polish news daily, so that was a totally idiotic omission. Thanks. I will post an update now - page one, near the bottom. When doing those tables I was focusing on "kreskowane", and forgot the most obvious.

Ironically, Marina Mniszek is actually a great-great-great... auntie of mine (via Ossoliński) and my great-great...-grandfather - a reputedly educated guy and her cousin, tutored the tsarevich for many years. I am not making this up, and it has and confirmed by DNA testing, so I should not really be making such silly mistakes.

Thanks.

With kind regards,
vovchik

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#38 Post by SFR »

vovchik wrote:Yes, "jak głupio". I actually speak Polish OK, and do so at least one a week, and read the Polish news daily, so that was a totally idiotic omission. Thanks. I will post an update now - page one, near the bottom. When doing those tables I was focusing on "kreskowane", and forgot the most obvious.
Nic się nie stało. 8)
Thanks for the update.
vovchik wrote:Ironically, Marina Mniszek is actually a great-great-great... auntie of mine (via Ossoliński) and my great-great...-grandfather - a reputedly educated guy and her cousin, tutored the tsarevich for many years. I am not making this up, and it has and confirmed by DNA testing, so I should not really be making such silly mistakes.
Small world! Well, I guess after all we all have a common ancestor. ;)

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

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

#39 Post by vovchik »

Dear SFR,

What is most striking about all the recent genome mapping is that human DNA is roughly 50% identical with that of bananas, which I now treat with great respect. They are some of my favourite relatives. :)

With kind regards,
vovchik

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

#40 Post by MochiMoppel »

misko_2083 wrote:Mochi It takes forever to load all the fonts. I have ~1300 of them.
Thanks for testing. Yes, yad is slow, but I can't say that it takes "forever". I tested with 450 fonts, yad window shows instantly with the first dozens of fonts. Takes ~20sec for complete loading.

Speed increases dramatically when changing yad for gtkdialog. My gtkdialog version, with more functionality and more code, loads all 450 font samples in 2 sec.
For some reason, at some point in the list, the right column goes to the left and vice versa.
Weird, but cause should be easy to detect. Could you please send me the output of the uniq command (output to text file instead of piping to sed)?

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#41 Post by step »

MochiMoppel wrote:
For some reason, at some point in the list, the right column goes to the left and vice versa.
Weird, but cause should be easy to detect. Could you please send me the output of the uniq command (output to text file instead of piping to sed)?
My script too occasionally writes a yad list item in the wrong place. When it happens, terminal output shows pango markup parsing failure warnings. This issue is definitely speed-dependent. It only happens when I hold the down arrow key pressed, which fills the dialog input buffer with requests to display all the fonts in the list, and possibly overloads the fclist-pango-gtk-yad system. It's hard to tell which actor is the culprit. Interestingly, I tried the same test with ydialog and there are no warnings.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#42 Post by step »

My third update is here.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

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

#43 Post by vovchik »

Dear step,

It's very good. Thanks. I wonder whether you can restore fstyle in the header. It is, I think, useful, and easy to reintroduce.

With kind regards,
vovchik

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

#44 Post by MochiMoppel »

Short test:
1) Styles are missing. E.g. all different DejaVu Sans fonts display the same font
2) 2 of my fonts don't display at all. Happened with my script too and I had to fix it. One font contains an ampersand in family name, the other an apostrophe.
3) My biggest concern: None of the presented scripts, including mine, can reliably display the glyphs of a font. Pango itself doesn't claim that it can and despite the fallback=false option it too often fails to show a font correctly even if it supports the characters it is supposed to show. See example in screenshot. All glyphs are "borrowed" from DejaVu Sans although the ASCII characters should display in Alpha Thin and the rest as hex boxes.

The GTK font button does a better job and I wonder if it is worthwhile to pursue the pango road if the results cannot be trusted. Pango certainly works for the majority of fonts, but is this good enough? Just a thought....
Attachments
PANGOvsGTKFONTBUTTONpng.png
(85.07 KiB) Downloaded 94 times

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

#45 Post by vovchik »

Dear Mochi (and all),

I, too ran across the same problem with a number of ttf fonts. I usually load them into fontforge or ttfedit - a java app - edit the font info text (not the glyphs) - and save them back. The glyphs in the font then become visible via our scripts with pango markup. A good many ttf fonts are "funky", for lack of a better word (written using Windows editors), and have to be cleaned up in the interest of proper multi-platform display and functionalty. The use of ampersands, exclamation points, hashes, brackets, quotes and colons might be problematic in such fonts, as well as badly or oddly named sub-families. When in doubt use "Regular".

With kind regards,
vovchik

PS. Some fonts have an internal attribute set that prevents embedding and preview (typical flag is 2). You can set it to 12, which allows both. See https://github.com/rmuch/ttfpatch.

User avatar
misko_2083
Posts: 114
Joined: Tue 08 Nov 2016, 13:42

#46 Post by misko_2083 »


Attachments
Peek 2020-05-27 19-20.gif
(76.12 KiB) Downloaded 42 times

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#47 Post by step »

vovchik wrote: ...I wonder whether you can restore fstyle in the header. It is, I think, useful, and easy to reintroduce.
It is there already but not on a separate line anymore. The font style is the blue section of the single-line heading, name + style + size. Or do you mean that you want name and style on separate lines (with "Font:" and "Style:" labels) as it was before?

Edit: The picture attached to MochiMoppel's last post shows that the style section isn't displayed. So I supposed the same happens to you. That's why you asked for fstyle to be added back.
MochiMoppel also reports failures displaying his fonts. Can we all state which versions of the following packages are installed on your systems? Mine are for Fatdog64-810.
freetype2-2.9.1-x86_64-1
gtk2-2.24.32-x86_64-1
pango-1.42.4-x86_64-1
yad_gtk2-0.42.14-x86_64-1


Thank you
Attachments
yad-fontview-20200527.png
(18.39 KiB) Downloaded 454 times
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#48 Post by step »

MochiMoppel wrote:Short test:
1) Styles are missing. E.g. all different DejaVu Sans fonts display the same font
That's easily explained. As Vovchik's noted, fstyle is missing from the heading. But also from the HTML tags that tell pango which font style to display. Hence the default font style is shown.

The question stands why can the fc-list version installed in my system extract font tags more reliably than the fc-list in your system and vovchik's?
2) 2 of my fonts don't display at all. Happened with my script too and I had to fix it. One font contains an ampersand in family name, the other an apostrophe.
I will test font names containing "&" and "'". They should work.
3) My biggest concern: None of the presented scripts, including mine, can reliably display the glyphs of a font. Pango itself doesn't claim that it can and despite the fallback=false option it too often fails to show a font correctly even if it supports the characters it is supposed to show. See example in screenshot. All glyphs are "borrowed" from DejaVu Sans although the ASCII characters should display in Alpha Thin and the rest as hex boxes.
Would you please be able to upload that font file somewhere? I want to see how it displays in my system.
The GTK font button does a better job and I wonder if it is worthwhile to pursue the pango road if the results cannot be trusted.
It's a valid concern. I don't understand the issues well enough to take a position, yet.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

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

#49 Post by vovchik »

Dear step (and all),

TTF files with an internal attribute set to "no preview" will not display in preview mode. I posted a link above to ttfpatch, which fixes that "feature" for good.

The syntax is:

Code: Select all

ttfpach ttfont.ttf 12
to permit preview and embedding (e.g. in pdf files).

That attribute might be the source of various display problems.

UPDATED: I added 32-bit and 64-bit binaries.

With kind regards,
vovchik
Attachments
ttfpatch_64_and_32_bit.tar.gz
(11.63 KiB) Downloaded 38 times

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

#50 Post by MochiMoppel »


Last edited by MochiMoppel on Fri 29 May 2020, 09:03, edited 1 time in total.

Post Reply