VPF Info Reader - Manual


Version 1.0
DLL: VPFInfo.dll
 

 

Contents

 
Copyright
Welcome to VPF Info Reader
Installing VPF Info Reader
Uninstalling VPF Info Reader
The VPF fonts
The Reader object
The Data object
The Collection object
Code examples
 
 
 

goto top  

Copyright

 
We have done our best to ensure that the information in this manual is both accurate and useful; however, please be aware that errors may exist, and that Dimac Development / Duplo AB (hereafter referred to as Duplo) does not give any guarantees concerning the accuracy of the information here or in the use to which it may be put.

Duplo may have patents and/or pending patent applications covering subject matter in this document.

Copyright © 2004 Duplo AB. All rights reserved.

This document may only be reproduced (in whole or part), copied, photocopied, translated, or converted to any electronic or machine readable form with the prior permission of Duplo.

Dimac Development      Phone: +46 42 35 94 00
Duplo AB    Fax: +46 42 15 80 50
Prästgatan 12    Homepage: http://www.dimac.net
252 24 Helsingborg    E-mail: info@dimac.net
Sweden    Support: support@dimac.net

If any problems occur using this application, please visit our web site http://www.dimac.net
 

goto top  

Welcome to VPF Info Reader

 
The VPF Info Reader is a free ASP compatible COM object that you use to read font information from VPF files, such as "Author", "Description", "Copyright" etc without reading the actual image data.

The component is easily integrated in your ASP solutions. The object can also be used in other environments such as Windows applications. As a COM based solution, it is possible to use the component in several programming languages such as C++, Visual Basic, and other COM supported languages.
 

goto top  

Installing VPF Info Reader

 
To use Dimac’s VPF Info Reader you must have the VPFInfo.dll registered on your server. This is done by either running the installation program or copying the VPFInfo.dll file to your server and manually registering it with the command:

regsvr32 VPFInfo.dll.

Any previous installations of VPF Info Reader must first be removed, as described below.

To run the installation program you must have administration permission on the server. Double click the setup.exe file to run the installation program. The installation will by default install at:

c:\Program Files\Dimac Development\VPF\VPF Info Reader\

together with the manual, the reference, and some ASP and vpf font example files. The installation will register the VPFInfo.dll file as a COM object.
 

goto top  

Uninstalling VPF Info Reader

 
Uninstall is available in the Add/Remove Programs in the Control Panel. You can also do this manually by unregistering the VPFInfo.dll component (type: regsvr32 /u VPFInfo.dll) and then deleting the files.
 

goto top  

The VPF fonts

 
The VPF Heading Generator and the VPF Info Reader component uses font files (vpf) created by VPF Heading Composer. The font files are created from a source image that contains all the characters that you want your font to be able to handle. You can create the source image with your favorite image editor, and let VPF Heading Composer generate a nice vpf font out of it. When creating the source image it is important that the characters are positioned using some kind of grid line, so that it is possible for the image to be divided in equally sized grids. Each grid should contain one character.

When creating a source image you must be sure that:

    - The image is saved in BMP, PNG or GIF format (recommended with 32-bit PNG, ARGB)
    - The image does not contain noise.
    - The characters can be separated in equally sizes grids.

 

goto top  

The Reader object

 
Creating a Reader object is the first step to make when you want to extract information
from the vpf font files. Once created, the reader object has three methods available which can
be used for gathering information.

These methods are called:

LoadFromFile
(returns a dataobject containing the info for a single fontfile)

LoadFromStream
(returns a dataobject containing the info for a single fontfile from a stream)

LoadFontCollectionFromFile
(returns a collection of dataobjects from a specified folder)

(see the Reader Object reference for a complete list)
 

goto top  

The Data object

 
The Data object holds all the information gathered from the font files, and you can easily
get the desired information from it by calling one/all of it's 22 properties stored within.

(see the Data Object reference for a complete list)
 

goto top  

The Collection object

 
The Collection object contains all the fontfiles of a specified folder, stored as Data objects.
The Reader will find all fontfiles (.vpf) in the folder and ignore any other file.
You can iterate through the collection, or use its Item property to extract
a dataobject from it.
You can also use its GetFontInfoByGUID method to get a unique font from the collection.

(see the CollectionObject reference for a complete list)
 

goto top  

Code examples

 
The following code creates a font collection using a reader object, and presents all available information of a single font using a html table.

For more info run Examples\Example01-03\JScript and VBScript.


<%@ Language=JScript %>
<%

try
{
    // Create the Reader object
    var readobj = Server.CreateObject("VPFInfo.Reader");

    // Create the Collection object
    var collectionobj = readobj.LoadFontCollectionFromFile("C:\\MyFonts\\");

    // Get the third font in the collection
    var dataobj = collectionobj.Item(2);

    // Get information from font
    var filepath = dataobj.FilePath;
    var fileversion = dataobj.FileVersion;
    var fontID = dataobj.FontID;
    var fontnamn = dataobj.FontName;
    var description = dataobj.Description;
    var author = dataobj.Author;
    var email = dataobj.Email;
    var homepage = dataobj.HomePage;
    var copyright = dataobj.Copyright;
    var created = dataobj.CreatedDate;
    var modified = dataobj.ModifiedDate;
    var imagepath = dataobj.ImagePath;
    var charstring = dataobj.CharString;
    var gridLineWidth = dataobj.GridLineWidth;
    var fontheight = dataobj.FontHeight;
    var background = dataobj.BgColor;
    var adkerning = dataobj.AdditionalKerning;
    var spacewidth = dataobj.SpaceWidth;
%>
    <table border="0">
        <tr><%Response.Write("<td>"+ "FileVersion:"    +"</td><td>"+ fileversion   +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "FontID:"         +"</td><td>"+ fontID        +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "FontName:"       +"</td><td>"+ fontnamn      +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "FilePath:"       +"</td><td>"+ filepath      +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "Description:"    +"</td><td>"+ description   +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "Author:"         +"</td><td>"+ author        +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "Email:"          +"</td><td>"+ email         +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "HomePage:"       +"</td><td>"+ homepage      +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "Copyright:"      +"</td><td>"+ copyright     +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "Created:"        +"</td><td>"+ created       +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "Modified:"       +"</td><td>"+ modified      +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "ImagePath:"      +"</td><td>"+ imagepath     +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "Characters:"     +"</td><td>"+ charstring    +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "GridLineWidth:"  +"</td><td>"+ gridLineWidth +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "FontHeight:"     +"</td><td>"+ fontheight    +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "Background:"     +"</td><td>"+ background    +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "AdKerning:"      +"</td><td>"+ adkerning     +"</td>");%></tr>
        <tr><%Response.Write("<td>"+ "Space Width:"    +"</td><td>"+ spacewidth    +"</td>");%></tr>
    </table>
<%
}
catch(e)
{
    // Display error message
    Response.Write("Error: " + e.message);
}

%>