Thursday, August 26, 2010

Playing cards

The upcoming Unicode 6.0 standard brings us a host of symbol characters, among them a block called “Playing Cards” at U+1F0A0. The symbols there represent the Minor Arcana of the Tarot deck (or the traditional western 52-card deck plus four Knights, if you prefer), of which at least some are usually illustrated in more or less detail.

The Unicode code charts shows complete cards, albeit with stylized illustrations. This is a sensible design choice for representative glyphs. George Douros’ Symbola even features full-fledged b/w illustrations, but the level of detail requires the card symbols to be set apart from the text body at larger point sizes.

Since the DejaVu fonts is first and foremost a screen font, playing cards would not fit in with this approach. Fortunately the semantics of a playing card symbol is relatively simple: it is a card, it belongs to one of the four suits (♠♥♦♣) and it has a rank. The following poker game example shows a minimalistic approach to get this information across:

Rendered point size 8 the cards are still recognizable

This kind of graphical representation should be familiar to most people, either from television (before HDTV) or from mobile games, where space is at a premium.

One thing to keep in mind is, that while the playing cards are depicted with French suits in the code charts, they are unified with equivalent suits in other cultures. So U+1F0AB PLAYING CARD JACK OF SPADES for instance could also be shown as page of swords of the Minor Arcana or Grün-Bube in German suits.

The patch containing the card glyphs is more or less ready, they will be included in version 2.33 of DejaVu.

References:

Sunday, August 22, 2010

Joining behavior in N'Ko (or ߒߞߏ)

N'Ko is an alphabetic right-to-left writing system for the Mande languages in West Africa. It is relatively modern, as it was invented in 1949 by Solomana Kante.

The letters usually connect on the baseline, a feature reminiscent of the Arabic script. It should be noted though, that in contrast to Arabic, joining behavior is not mandatory but rather a design choice.

DejaVu Sans has been one of the first Unicode fonts to include the N'Ko range along with the characteristic joining behavior, both added by Євгеній Мещеряков in version 2.18. To get the letters render correctly, two things are needed. First, you need to have appropriate OpenType tables, i.e. ‘init’ for initial forms, ‘medi’ for medial and ‘fina’ for terminal or final forms. Second, the rendering engine has to recognize those and apply them.

And that's where the problem starts. Windows 7 comes with a font that includes N'Ko, but its rendering engine Uniscribe does not know what to do with the N'Ko tables. As a workaround, I have added a ‘␣RQD’ (= required feature) table which specifies when to apply which of the three aforementioned tables.

Rendered with Firefox 4.0b3 in Windows 7
This fix is included in version 2.32 of DejaVu (just released while I was writing this post), see sidebar for download link.

Unfortunately this does not work in every application in Windows, as some do not make use of all Uniscribe features or rely on alternative renderers.

Additionally this workaround seems to have no effect on XeTeX as of version 0.9997.

References: