[WDX; Suggestion] Content Plugin for fonts

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

[WDX; Suggestion] Content Plugin for fonts

Post by *van Dusen »

I've a suggestion for plugin-authors:

What's about a content plugin, which offers information about font properties? (Or do I miss anything and there already is one :oops: ?) The plugin could support colums for some of the information, the lister plugin <Font 0.08> (http://www.totalcmd.net/plugring/font.html) shows in its <Info>-tab:
Image: http://img136.exs.cx/img136/2235/wlxfont0081sf.png

Regards, van Dusen
taohe
Junior Member
Junior Member
Posts: 47
Joined: 2004-12-26, 06:57 UTC

Post by *taohe »

What kind of inofrmation about fonts do you want the wdx plugin provides?

I've finished a wdx plugin called FontName.wdx, which only extracts the internal font name of a TTF file. If you are interested, please leave your mail address or send an email to

taohe (at) hotmail (dot) com

I'll send it to you.
LionTech
Junior Member
Junior Member
Posts: 41
Joined: 2003-06-12, 19:07 UTC
Location: Belgium

Post by *LionTech »

It shouldn't be too hard to add the WDX interface to the existing WLX plugin.
I'll have a look at it.

What info would you like to search?
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

2LionTech and taohe
Thanks for seizing my suggestion! :)

2taohe
Of course I'm interested :) ...I would be pleased, if you'll send me your FontName-Plugin to:
vandusen (at) epost (dot) de
Thank you in advance!


This is my proposal for information, which should be provided by a font-WDX:

x ! Name
x ! Family
x ! Style
n ! Style category1: Monospaced, Proportional
n ! Style category2: Serif, Sans Serif
n ! Style category3: Decorative, Script, Symbol
x ! Identifier
x . PostScript Name
x . PostScript CID
x ! Type
n ! Format (same as / similar to "Type"?): Raster, Vektor, TrueType, OpenType, Postscript Type 1, ...
x . Version
x . Copyright
x . Manufacturer


Font Metrics (in pixels)

x ! Width
x ! Weight
x . Height
x ! Italic
x ! Underline
x ! Strike-Out
x . Ascent
x . Descent
x . Internal Leading
x . External Leading
x . Avg. Width
x . Max. Width
x . Overhang
x . Horizontal Aspect
x . Vertical Aspect

Where:
x = Information is already available in lister plugin Font 0.08
n = Information is not yet available in lister plugin Font 0.08
! = Information, which is all-important (IMHO)
. = Information, which is (probably) less important (would be "nice to have" in a content plugin)
taohe
Junior Member
Junior Member
Posts: 47
Joined: 2004-12-26, 06:57 UTC

Post by *taohe »

2van Dusen

File has been sent to you. Please check your mailbox.

As for your requested information, frankly, I have no idea how to obtain them other than the font name. Sorry about that.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

As for your requested information, frankly, I have no idea how to obtain them other than the font name. Sorry about that.
You may try to load the font via CreateFont - set everything to "don't care" except for the font name - which you seem to have. Then use GetObject to get the LOGFONT structure, and GetFontData to get even more info from Truetype fonts.
Author of Total Commander
https://www.ghisler.com
taohe
Junior Member
Junior Member
Posts: 47
Joined: 2004-12-26, 06:57 UTC

Post by *taohe »

2ghisler
Thanks for the tip!

Very interesting. I'll try this later. Quite busy at this moment, though.
LionTech
Junior Member
Junior Member
Posts: 41
Joined: 2003-06-12, 19:07 UTC
Location: Belgium

Post by *LionTech »

I have posted version 0.09 of the Font plugin. It can be registered both as a lister plugin and as a content plugin.

http://users.pandora.be/liontech/wlxFont.zip

The following fields are available:

Name, Family, Style, Identifier, PostScript Name, PostScript CID, Type, Version, Copyright, Manufacturer, Designer and Width Class

The other fields don't make much sense unless the font is displayed because they are dependent on a particular use of a font in a particular device context.

Let me know what you think!
LionTech
Junior Member
Junior Member
Posts: 41
Joined: 2003-06-12, 19:07 UTC
Location: Belgium

Post by *LionTech »

ghisler(Author) wrote:
As for your requested information, frankly, I have no idea how to obtain them other than the font name. Sorry about that.
You may try to load the font via CreateFont - set everything to "don't care" except for the font name - which you seem to have. Then use GetObject to get the LOGFONT structure, and GetFontData to get even more info from Truetype fonts.
Christian,

that will only work for fonts that are registered to the system, not for fonts that are in other locations.

BTW, Is there a file type extension for plugins that support multiple interfaces? The user interface for adding a content plugin only shows *.wdx files. Since my plugin was a lister plugin first it doesn't show up (wlx). Might deter unexperienced users...
User avatar
deus-ex
Power Member
Power Member
Posts: 979
Joined: 2003-02-10, 17:45 UTC

Post by *deus-ex »

2LionTech

Though i choosed German language in the options menu and restarted TC
the plugin still uses default english language.

I checked Lsplugin.ini and found two entries of the plugin. [LionTech.Font]
which belongs to an earlier version and a fresh entry [Font.wlx.Font].
I removed the older entry, under the new section [Font.wlx.Font] it reads
Language=Deutsch but it still does'nt appear?
LionTech
Junior Member
Junior Member
Posts: 41
Joined: 2003-06-12, 19:07 UTC
Location: Belgium

Post by *LionTech »

deus-ex wrote:2LionTech

Though i choosed German language in the options menu and restarted TC
the plugin still uses default english language.

I checked Lsplugin.ini and found two entries of the plugin. [LionTech.Font]
which belongs to an earlier version and a fresh entry [Font.wlx.Font].
I removed the older entry, under the new section [Font.wlx.Font] it reads
Language=Deutsch but it still does'nt appear?
I broke some internal string parameters. I've uploaded a new build which uses the previous correct section again, [LionTech.Font]. But the field names aren't localized yet as explained in the ReadMe file. I need to get comfortable with the content API first.
User avatar
deus-ex
Power Member
Power Member
Posts: 979
Joined: 2003-02-10, 17:45 UTC

Post by *deus-ex »

2LionTech
Thank you, language issues fixed. :)
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

2taohe
Thank you very much! I've send a reply lately :)

2LionTech
Really great! That's the font plugin I've longed for. The other fields are less important for me... but I'am not a professional, so I don't know, which information could be desirable for other users.

What do you think about my proposals concerning the "style categories"? If these information would be available with Font.wlx/.wdx, your plugin would be nearly perfect :). I've a rather old version (V2.0) of Bitstream's Font Navigator, which provides these categories. Unfortunately I don't know, how the Font Navigator finds out the needed information from font files...

Thanks a lot for your awesome font plugin!
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

Yet another suggestion :) :
To get a preview to fonts, it would be nice & useful, if a font plugin could support thumbnail extraction / generation. Thumbnails could show a user defined sample text (with user defined size) or they could show a fixed (plugin-internal) sample at least.
User avatar
tridy
Junior Member
Junior Member
Posts: 92
Joined: 2003-11-27, 07:51 UTC
Location: Еurоpе

No Content Plugin

Post by *tridy »

Since I still haven't found the content plugin for Fonts, here is a utility that will rename TTF fonts in the directory:

http://www.styopkin.com/free_font_renamer.html

if someone has found a WDX plugin for fonts. please let me know.
[tridy]
License #: 79539
Post Reply