Archive for Mai, 2008

London Underground Typeface

Donnerstag, Mai 22nd, 2008

Monday 2nd July 1979, straight after five years of student life in the UK, was my first day at Banks and Miles, a London based graphic design company. That morning was a bit of a shock. I was given a few large broadsheets with litho printed Johnston type. I was definitely confounded by being asked straightaway to design a new Johnston family with three weights — Light, Medium and Bold — within a month or two. (…) Colin Banks, an external assessor for the LCP, had asked me if I would be interested in redesigning a typeface. I was grateful for the job (…), but the prospect was daunting because I had no experience in type design and very little English language. (…) I expected that in the office there would be at least a kind of preliminary training or guidance for a novice designer — what drawing tools to be used, what size the original artwork should be, how to typeset with newly drawn letters. I remembered one college day in 1975 when our tutor took us to the drawing office of the Monotype Corporation in Salfords. They had impressive purpose-built drawing equipment, precision machines and many skilled draughtsmen and women. In contrast, my tools were very basic: pencils, felt tip pens, a Rotring pen with 0.1 mm nib, Winsor & Newton’s fine brushes and some photographic equipment in the darkroom.

type
Interesting article about Eiichi Kono’s1979 redesign of the „Johnston“ typeface that London Transport has been using in the Underground since 1913.

Removing PDF Restrictions.

Montag, Mai 19th, 2008

Adobe’s PDF file format comes with the possibility to restrict the things you’re allowed to do with a PDF document. This has nothing do do with encrypting the document to keep unauthorized people from reading it. Instead, authors may want to disallow printing, modifying or copy&pasting parts of a document. It’s still possible to view the documents on the screen.

Apparently, on older versions of Mac OSX’s Preview, it was possible to just „Save as …“ a restricted PDF, the resulting saved file would be a PDF without restrictions. This was fixed, but the ColoySync utility still had the possibility to use the „Save as …“ trick. Apparently at some point, they fixed ColorSync as well.

As far as I can tell, the easiest way to print a restricted document nowadays is to use ColorSync to „Export …“ the PDF to a TIFF file, open the TIFF (it will be huge) in Preview and either print it directly, or print to a PDF. Of course, the resulting PDF won’t be searchable, but as far as I know, Adobe hasn’t come up with a „disallow search“ restriction (which no doubt, a lot of publishers would use) so you can search in the original, restricted PDF.

Slides for LRUG tonight.

Montag, Mai 12th, 2008

Introducing Weave
Introducing Bytes

Bit-twiddling with Ruby

Dienstag, Mai 6th, 2008

I’ve always wanted to write some routines that help out with bit twiddling. Since I’m working on some byte level stuff recently (Smartcards, ISO7816 to be precise) I’ve finally gotten around to writing an API to make handling bytes easier and self-documenting. Basically, it’s a –attention buzzword– DSL for bitfield description. Not really gotten very far, but this is how it looks up to now: if you’ve got a byte composed of bits with the following semantics:

   |8|7|5|4|3|2|1|Desc
   ================================
   |1|-|-|-|-|-|-|Channel Encrypted
   |-|0|0|0|-|-|-|Method A
   |-|1|0|0|-|-|-|Method B
   |-|0|0|1|-|-|-|Method C
   |-|-|-|-|X|X|X|Channel Number 

I can use the following ruby code to represent it:

  require "bytes"
   b = Bytes::Byte.new "1......." => :enc,
                       ".000...." => :a,
                       ".100...." => :b,
                       ".001...." => :c,
                       ".....vvv" => :channel
   b.value = 0xff
   b.enc?        # true 
   b.b?          # false
   b.b           # `b.value` is now 0xCF / "11001111"
   b.b?          # true 
   b.channel     # 7
   b.channel = 0 # `b.value` is now 0xC8 / "11001000"

Instead of using the Byte class and instantiating it with the byte’s pattern, it’s also possible to include the module Bytes which adds a attr like class function (called byte_accessor) which adds the same sort of functionality to classes. Take this –vaguely contrived– implementation of the first two bytes of an IP Packet:

require "bytes_ng"
class IPPacket
  include Bytes
   byte_accessor :ver_ihl , "vvvv ...." => :version
                           ".... vvvv" => :ihl

   byte_accessor :tos, "111. .... | Precedence" => :network_control,
                       "110. ...."              => :inet_control,
                       "101. ...."              => :critic_epc,
                       "100. ...."              => :flash_override,
                       "011. ...."              => :flash,
                       "010. ...."              => :immediate,
                       "001. ...."              => :priority,
                       "000. ...."              => :routine,
                       "...0 .... | Delay"      => :normal_delay,
                       "...1 ...."              => :low_delay,
                       ".... 0... | Throughput" => :normal_throughput,
                       ".... 1..."              => :high_throughput,
                       ".... .0.. | Reliability"=> :low_reliability,
                       ".... .1.."              => :high_reliability,
                       ".... ..1. | RFU"        => :rfu_err_1
                       ".... ...1 | RFU"        => :rfu_err_2
end

This adds two instance variables (and their respective accessors) named ver_ihl and tos to the class IPPacket. These contain the actual byte value. It also adds a bunch of methods (like in the example above) that can be used to query and set the individual bits.

I’ve not gotten around to properly releasing it yet, but it works quite well so far. In case you’re interested, you can currently get it here.

Future plans are to package it and (maybe) add multi-byte functionality.