Printer’s Apprentice 8.00.32 Update

July 6th, 2009 by Bryan Kinkel

The next version of Printer’s Apprentice is being prepped for the beta team. Download notices should go out in the next day or so.

The next  update will have a pair of “fit & polish” features. These are nothing too serious. And they certainly did not take long to implement. But they simply make the application better.

Full Screen Toggle – This button simply maximizes Printer’s Apprentice to fill the full screen. The top title bar is hidden and the Printer’s Apprentice window covers the Windows Taskbar. The hotkey to toggle full screen mode is F11. (Microsoft Office and FireFox also use F11 for full screen modes.)

toggle1 toggle2

toggle3

This feature is great for when you really want to see your fonts blown up large. Or for when you are working with a client on font selection over a shared monitor.

Sorting Glyphs (Arrows) – Like Windows Explorer, Printer’s Apprentice now uses the built in sorting arrows in all the listviews throughout the application.

This should have been in the application a long time ago. However, the .NET listview control does not expose the arrow functionality directly. So the implementation uses Windows API calls. The code was not difficult at all. But it kept getting bumped down on the To Do list.

sort-installedfonts

Posted in .NET Framework 2.0, Printer's Apprentice, Programming | No Comments »

Printer’s Apprentice 8.0.22 – New Character Set Support

October 15th, 2008 by Bryan Kinkel

Printer’s Apprentice 8.0.22 adds support for displaying character sets besides the standard 255 glyphs in the standard Latin Windows set (1252). This enables you to easily display and print characters found in non-Western alphabets such as Hebrew, Greek and Cyrillic.

You can download this version from the following link:

icon_greenarrow16 Download Printer’s Apprentice 8.0.22 for Vista & XP

In this post, I want to review how non-Western characters are implemented under Windows and the new features in Printer’s Apprentice 8.0.22.

Windows supports the Unicode standard along with several code pages that are included for backward compatibility. Unicode supports over 65,000 characters with defined subsets for different languages and glyphs (Latin, Greek, Arabic, etc). More information about Unicode can be found at unicode.org. Wikipedia also has a good article covering the topic.

The Windows character set approach is an encoding implemented by Microsoft prior to Unicode. Each set contains 255 numbered spots that map to the glyphs in the particular set. A standard set of alphanumeric, symbol and control characters occupy the the first 128 positions. Additionally, Microsoft provides tables, hosted at unicode.org,  that map each character to its associated Unicode value. For example, the Windows Hebrew character set maps the Hebrew letter bet in slot 225 to code point 0x05D1 in Unicode. Printer’s Apprentice uses the Unicode values to draw glyphs on screen and on paper.

With Printer’s Apprentice, I chose to mimic the display of the Windows Character Map (charmap.exe) utility. This app displays glyphs using the full Unicode range, Unicode subsets and Windows Character sets.

charmap charmap2

 

This build, 8.0.22, uses the character set approach to group and display glyphs within a font. Eventually I will support full Unicode & Unicode subset displays. By using the Windows character sets, I minimized the changes to the existing code. It also meant that I did not have to design new printed sample sheets for the charts. The existing printed sample sheets work very will with non-Western sets.

One important note – internally, Printer’s Apprentice is a fully Unicode-based application. Strings in Microsoft’s .NET platform are represented as collections of Unicode characters which makes it easy to do the type of things I’m doing under the hood.

And in these example screen shots, I use Cyrillic. But Printer’s Apprentice supports the single byte character sets listed below. (Other sets and Unicode ranges are planned!)

When Printer’s Apprentice starts, it attempts to determine the locale that you are running. For example, if you are running a localized Russian version of Windows, PA will automatically default to displaying the Cyrillic character set.

You will notice the following minor changes in the user interface:

  • The Single Character and Character Set tabs display the ANSI and Unicode values in the upper right hand corner. You can toggle their display using the Options screen.
  • The current character set in use is displayed in the blue title bar in the upper right hand corner. It is a hotlink that will open the Options screen.
charset-cy charset-cy2

 

To change the change the character set being used, select Options from the Tools menu or click the set name in the blue title bar. This opens the Options dialog box where you can change the current character set. Also note the new sizes for the Character Set grid.

options gridsize

 

I also added support for printing the new character sets. So if Cyrillic is currently selected, you can print sheets that look like the sample below. The current character set name has also been added to the pages in the upper right hand corner. If you want to print a different set just click the Options tab on the Print dialog.

print1 print2

As always, we encourage feedback on how features are implemented in Printer’s Apprentice. Feel free to comment in the blog or shoot an email to helpdesk at lose your mind dot com. — Bryan

Posted in Printer's Apprentice, Programming, Windows | 1 Comment »

Printer’s Apprentice 8.0 – Character Sets

October 3rd, 2008 by Bryan Kinkel

Printer’s Apprentice 8.0, our font manager for Windows Vista & XP, has been out for a little over three weeks now. But I’m continuing work on new features.

If you take a look at the 8.0 Roadmap, you will see an entry for Unicode support. Since the early days, Printer’s Apprentice has only supported the Windows ANSI character set. Even the lowly charmap.exe application displays character sets and Unicode. Time to get that feature knocked off the To Do list.

This week I drafted out a plan for character sets & Unicode support. This touches on a couple of areas in Printer’s Apprentice:

  • The Single Character & Character Set tabs need to support slots 1-255 in any character set, not just Windows ANSI. They also need to support displaying the 65,000+ characters available in Unicode.
  • The Character Set tab itself is not as fast as I would like. It is a tad sluggish on redraw. Some working is needed here.
  • The printed Character Set sample sheets are Windows ANSI only. So these need to be retooled.

Printer's Apprentice 8.0 - Character Set tab I decided to start with the Character Set tab. This tab is actually a user control comprised of a .NET TableLayoutPanel that loads in a grid of surfaces used to draw each character (shown at the right). It is not very efficient. In a 4×4 grid, there are 16 different canvas surfaces loaded into memory. It would be faster to use a single canvas and do all the line drawing and text rendering myself.

I started a new project in Visual Studio 2005 and went to work. The goal was to build a new control that I could drop into the Printer’s Apprentice 8.0 codebase with minimal disruption. I duplicated all the properties, events and methods so it would be 100% compatible with the calling form.

Eventually I came up with something that looked very much like the Windows charmap.exe application. The image below, on the left, shows the first version of the map. The canvas is hosted inside an auto scrolling panel. The canvas is physically as “tall” as required to display 255 characters in a grid. It also supports additional character maps.

This version has two problems. I like the vertical scroll bar, but using this would require reworking of the Printer’s Apprentice UI. The host tab uses a horizontal slider below the grid to scroll through the character set. It is also not a virtual grid. In other words, all 255 characters are drawn on the canvas at once. That is fine for 255 characters, but creating a full sized canvas to hold 65,000+ Unicode characters would not be very efficient.

The second draft, below on the right, uses a virtual grid. Only the characters that are visible are actually on the canvas. If you are displaying a 5×5 grid, then the canvas is only as large as it needs to be to display those 25 characters. It uses a horizontal trackbar below the grid to scroll through the characters. Also note that this image is displaying characters from the Arabic set. Excellent!

New character grid - draft 1  New character grid - draft 2

Now that the character map control has been prototyped, it was very easy to drop it into the Printer’s Apprentice solution. Since the control handles all the drawing itself, it is much faster. I expanded the Character Set grid size option to allow for 20×20 grids. Here is a work in progress shot showing a 15×15 grid of Wingdings.

Printer's Apprentice - enhanced character set 

The new grid also supports alternate character sets. But I’m trying to figure out where to incorporate that option into the user interface. Once I get that sorted out, I’m going to add character set support to the the printed page and see what we can do about Unicode.

Any comments? Shoot them over to Bryan helpdesk at loseyourmind dot com. — BTK

Posted in Fonts, Printer's Apprentice, Programming | No Comments »

Printer’s Apprentice 8.0 – Software Publishing Certificate

September 3rd, 2008 by Bryan Kinkel

After a couple weeks, we finally received our Software Publishing Certificate (SPC) from Comodo. All future versions of Printer’s Apprentice will now have digital certificate attached to the main executable file identifying us as the publisher.

So… what does that mean for you, the Printer’s Apprentice user?

The primary purpose of the SPC is to identify the author and prevent tampering with the software after it has been published. So with the certificate attached, you know you are getting an unaltered copy of Printer’s Apprentice, just as we intended it to be.

cert2

The SPC adds an additional benefit with Vista. Vista takes advantage of the digital certificate to display the publisher information when a User Access Control prompt pops up. Because Printer’s Apprentice runs in administrator mode, Vista always displays a UAC prompt. (We need admin mode since PA manipulates files in the Windows Fonts folder.)

The left image, below, is a shot of the UAC prompt for our application with no SPC attached. On the right is the prompt after we added the SPC.

Printer's Apprentice - User Access Control   Printer's Apprentice - User Access Control

Needless to say, the dialog prompt on the right is far less alarming. All future versions of Printer’s Apprentice and Virtual Font Folder will be signed with our software publishing certificate. — Bryan

Posted in Printer's Apprentice, Programming | No Comments »

Printer’s Apprentice 8.0 Update – Font Categories

June 27th, 2008 by Bryan Kinkel

A beta tester sent me a nice email and mentioned an older font program that displayed a category for the font as one of the columns. This is something I have wanted to implement since the early days of Printer’s Apprentice, but simply never did.

I’ve been hip-deep in font related Win32 API calls and I remembered the PitchAndFamily enumeration member of the LogFont class. The PitchAndFamily field classifies a font as decorative,modern (fixed pitch), roman (serif), swiss (sans serif) and script. (There is also “dontcare” which means the font vendor did not add a classification to the font).

Printer’s Apprentice already makes heavy use of the Logfont structure, so it was very easy to expose the classification on screen as a “Family” column. Check out the shot below.

Unfortunately, the PitchAndFamily classification is very rough. And not all vendors use it. I’m looking into exposing the Panose values for a future version.

We continue to test Printer’s Apprentice 8.0. If you want to help out, fill out the sign up form and we will send you the information. — Bryan

pa

Posted in Printer's Apprentice, Programming | 1 Comment »

Printer’s Apprentice Objects

April 24th, 2007 by Bryan Kinkel

One of the goals for the Printer’s Apprentice rewrite is to significantly simplify the code base. The code in the current version, 7.58, has roots going back to 1992 and Visual Basic 1.0. Much of the code is overly complex and function, rather than object, oriented.

Visual development environments make it very easy to build a great UI and then integrate code into the events such as Button_Click. Then next thing you know you have a great looking form with a ton of code tucked into the events.

That is is precisely how the code in Printer’s Apprentice evolved. Bad, bad, bad. So I’m working to change that approach with the new version. What I want to do with this posting is give you an idea of how the user interface objects consolidate code and how they communicate with each other.

Lets take a look at two objects, ctlInstalledFonts and cEnumFonts. ctlInstalledFonts handles the UI for selecting installed fonts in Printer’s Apprentice. cEnumFonts is a data layer that does the grunt work of reading fonts from the OS, linking them to registry entries and so forth.

On the left is the design view of the UI object. On the right are simplified class diagrams for the ctlInstalledFonts and cEnumFonts.

          

 

cltInstalledFonts only job is to present the UI for installed fonts. It does not actually enumerate or read installed fonts, that is a data operation handled by the other object, cEnumFonts.

The Fields section lists controls, properties and data entities in the control. The actual control contains many more entities. I’m only showing a few important ones for this discussion. 

ctlInstalledFonts Fields
_EnumFonts Private instance of a cEnumFonts object.
lvInstalled Listview control to display fonts.
PropertyGrid PropertySheet control below the listview. This displays more details about a font than can be displayed in the listview.
mnuContext Context menu that appears when the user right clicks a font in the listview.

Again, cEnumFonts is what actually queries the system and returns the list of fonts to ctlInstalledFonts.

cEnumFonts Methods
CountFonts Gets an initial count of the fonts installed on the system.
EnumFontFamilies Function used by the Win32 EnumFontFamiliesEX() function. This is what steps through each font on a system.
ReadFonts A sub that starts the font enumeration process.
cEnumfonts Properties
FontCount Number of fonts that were enumerated.
FontList An array of fonts that were enumerated.
PropertyGrid The handle of the window listing the fonts.
IncludePostscript Do we include Postscript based fonts or not?
cEnumfonts Events
FontEnumStart Triggered when a font family is about to be read.
FontEnumFamilyCreated Triggered when a font family is read and created.
FontEnumEnd Triggered when reading a font family is complete.

When Printer’s Apprentice starts, the main form creates an instance of ctlInstalledfonts. It in turn directs its private cEnumFont object to examine the system font list.

 'walk the font list
 ctlInstalledFonts._EnumFonts.ReadFonts()

As ctlInstalledFonts._EnumFonts walks through the font list, it triggers the following events for each font that it reads.

 Public Event FontEnumStart(ByVal pFaceName As String)
 Public Event FontEnumEnd(ByVal pEnumIndex As Integer, ByVal pFontCount As Integer)

These events allow the calling form to modify the user interface as events are triggered in the ctlInstalledFonts._EnumFonts object. For example, by hooking into the events I can update the splash screen and show progress as Printer’s Apprentice loads.

Using events in a UI control also makes it easy for one menu handler to process selections for both the main window menu and context menus. The main window and ctlInstalledFonts both have a Print menu.

  

 ctlInstalledFonts has a series of customs events that all have the same signature as a standard menu call. Rather than handling print code right in the menu, the mnuPrint.Click() handler instead raises the event.

 Public Event emnuPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
 Public Event emnuUninstall_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
 Public Event emnuProperties_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
 Private Sub mnuPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPrint.Click
    RaiseEvent emnuPrint_Click(sender, e)
 End Sub

And back in the main form, a single handler processes the Print selection for both menus. 

 #Region "File menu"
   Private Sub mnuFilePrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
     Handles mnuFilePrint.Click, ctlInstalledFonts.emnuPrint_Click, ctlFontFiles.emnuPrint_Click
     Call Me.PrintFonts()
   End Sub #End Region 

So rather than having print code scattered around the application, I use a PrintFonts() call inside a menu handler that processes the Click event for multiple menus.

This approach is certainly reducing the amount of code in Printer’s Apprentice.

Posted in .NET Framework 2.0, Printer's Apprentice, Programming | No Comments »

Project – Web Site II

September 28th, 2006 by Bryan Kinkel

The web site redesign was finished and posted a few days ago. The design is rather stark. But the restructured HTML and CSS will make it very easy to add more flair later.

Now, back to work on Printer’s Apprentice code. — Bryan

Posted in General, Programming | 1 Comment »

Project – Web Site

September 7th, 2006 by Bryan Kinkel

Work on Printer’s Apprentice 8.0 has been put on the back burner for just a bit while I rework the web site. There are a couple of reasons for doing this.

  1. I want to improve the customer experience. 
  2. The HTML and CSS needs to be more standard complient. The existing code does not look so hot when viewed with Firefox and other newer browsers.
  3. The site looked good back in 2002. But the cosmetics simply don’t hold up against the bright gradients, polished round-corner, CSS-driven sites of late 2006.  Besides, I’m simply tired of how the site looks.

Revisiting a past project is also a good way to see how much you have learned! The old site has mis-matched tags and poor CSS all over the place. And I hand-coded the thing. So I can’t blame FrontPage for maligning my HTML!

The site currently uses traditional (classic?) ASP. I resisted the urge to redo the site using ASP.NET 2.0 simply because I can’t find any compelling reason to recode the whole thing. So hopefully this effort will not take to long. — Bryan

 

Posted in General, Programming | 1 Comment »

FontFamily() Collection Refresh – Resolved.

April 10th, 2006 by Bryan Kinkel

Sort of. Apparently this is a bug in the gdiplus.dll and not the .NET Framework. Therefore it will not likely be fixed with a Visual Studio service pack. It has to be fixed by the OS team.

And Microsoft can’t provide any details about the bug:

Yes, the bug detailed record may have some Microsoft confidential
information in it, so it is not suitable for public publishing. Thanks for
your understanding.

Very aggrevating.

See the full thread in the MSDN newsgroups.

 

Posted in .NET Framework 2.0, Programming | No Comments »

PrivateFontCollections & PrintPreview – Resolved.

April 10th, 2006 by Bryan Kinkel

After much back and forth with Microsoft staff running the MSDN Newsgroups, it was finally determined that the PrivateFontCollection / PrintPreview control bug is a bug in the Framework.

Microsoft has it tagged as a high priority bug. But there is no guarantee that it will get fixed in any of the upcoming Visual Studio Service packs. Bummer.

The full thread can be found in the MSDN Newsgroups.

PrintPreview with PrivateFontCollection

Be sure to visit the MSDN Newsgroups. They are a great resource and there are some good people running the operation.

Posted in .NET Framework 2.0, Programming | No Comments »

« Previous Entries