domenica 22 gennaio 2012

ConTeXt and Fonts, Part 1

In my opinion, font handling has been -- and still is -- one of the trickiest part of my TeX experience. With font handling I don't mean using the fonts provided by a particular TeX installation; on the contrary, I mean installing and using new typefaces into TeX -- and ConTeXt. Nowadays things are way easier: both XeTeX and LuaTeX provide simple font interfacing and intuitive OTF feature leveraging. ConTeXth can use these engines too, with LuaTeX becoming the default engine for ConTeXt.

So why stick with pdfTeX? The main reason is that changing typeset engine leads to slightly different outputs in most cases, and plain wrong output in some cases. The most blatant gotcha is, in my humble opinion, when we typeset a document in two columns and want to lay out a float spreading the whole page width. If we use pdfTeX or XeTeX as typesetting engines we can use \startcolumns..\stopcolumns and place a floating object on the top of a page; if we use LuaTeX, we must use columnsets or we just can't do it. Moreover, while XeTeX is far easier to use (I used it to typeset some long documents) allows for inferior typographic control. This leaves me with only one choice: ConTeXt + pdfTeX, with its complex font handling mechanism.

About Itemized Lists

Before tackling the subject of fonts (which will require more than one post, I think), let's talk about itemized lists.

From time to time, the need for an itemized lists (or a hierarchical list) will arise: for instance, when describing some subprocedure during character creation, or explaining the combat sequence, or if you want to remark some important points in your book.

When this time comes, you will need a way to format informations like this:

  1. First info
  2. Sec ond info
  3. Third info

or this way:

  • First info
  • Second info
  • Third info

martedì 20 dicembre 2011

The Shunned House -- Titles and subtitles, step 3

This post is going to be a little out of context, since it's about structuring your book. Problem is, these subdivisions are going to be somewhat artificial, since "The Shunned House" is a story whose structure is only one level deep. So, I'm going to insert some artificial subdivisions in it.

Like LaTeX, and HTML, context comes with some handy commands for structuring the text. These commands produce titles in a hierarchical way, the same way h1..h4 commands do in HTML. These commands can produce numbered or unnumbered title; since we are designing an RPG, and we want to avoid an overly technical feel, I think that only level-1 titles (chapters) must be numbered, while lower-level heads should not bear numbering. Your mileage may vary, however, and you might not agree with me. That's fine -- I'm no designer, and I've laid out some publicily available games only for fun.


mercoledì 14 dicembre 2011

The Shunned House -- Managing Long Documents, Page size and margins, step 2

Since "The Shunned House" is over 60k characters long, one usually wonders if there is a way to subdivide this document in more manageable pieces. It would be neat to follow document's structure and create a separate file for every chapter, and a central document file to assemble all chapters in a single book.
It turns out that TeX -- and ConTeXt has such a mechanism. The \input <texfile> command tells TeX to search and load a TeX subdocument into the main document. With this feature, we can thus subdivide "The Shunned House" in five chapter, each beginning with \chapter{} and each ending with \stopcolumns.

domenica 11 dicembre 2011

The Shunned House -- Two Columns, Step 1

The Shunned House -- Two Columns, Step 1

Last time we began ptbuilding a ConTeXt page by enveloping the whole text between \starttext and \stoptext. We managed to get a PDF with little effort -- we had to escape an ampersand, and insert proper emphasization commands ( \em ) in lieu of _ characters. Moreover, we also added some semantic commands by inserting the \chapter command at the beginning of every, uh, chapter.
The result, however, is quite bland.
Now let's lay out every chapter text into a two-column layout, so the output start resembling something more professional.

venerdì 9 dicembre 2011

The Shunned House -- From Text To Page, step 0

Let's (really) start.
After I've posted three articles about setting up a proper ConTeXt environment, it's time to get started.
This is the first a series of posts which will show you how I transform an ASCII document into a well-formatted PDF.
What do I mean with "Well-Formatted?" I mean that we will end up with a well formatted two-column book, laid out in an A4-sheet. Two-column layout is somewhat of a standard in RPG world: I think that seven games out of ten use such layout. Columns, however, are not enough: I will show you how to integrate new fonts in the system, how to insert cliparts and add flair to your pages (like, for instance, a background on every page). What I want to get is something not unlike this layout, and this series of posts will show you how to do it.

The Shunned House

For this task, I will use H.P. Lovecraft's "The Shunned House".
Why?
The text is available from Project Gutenberg's Site free of charge. Moreover, it is in the Public Domain, so we can use it without fear of infringing any copyright. Lastly, "Call of Cthulhu" was one of the first game I played, so I have quite a good reason to choose HPL as a starting point for my tutorial.

mercoledì 7 dicembre 2011

Specimen Sheet Generator

When I started dabbling with DTP, one of the big issue I always had there have always been few programs capable to print decent specimen sheets. While there's little about roleplaying in this post, I think that serious indie game designers could really benefit from a proper specimen sheet.
So, in all of its glory, here's the ConTeXt source to create specimen sheets out of Serif, Sans and Mono fonts. As it is, this code works with ConTeXt/pdfTex, using its default fonts.
However, if you properly setup typescripts -- a subject of a next post, rest assured -- you can generate a handy pdf of 21 specimens of your favorite font set.
It's public domain and it's yours to enjoy!