Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: I'd like to submit a different font.  (Read 787 times)

usr_share

  • Bay Watcher
  • "For great justice!"
    • View Profile
I'd like to submit a different font.
« on: April 30, 2013, 01:23:42 pm »

When I tried to reimplement a "school shooting" headline (as part of the "prisons and guns" patch), I noticed that even such a simple headline was too large to fit in one line.

This is mostly due to the fact that the font used in these headlines is gigantic, and, while in some cases, it's good (a headline followed by a picture doesn't require any text at all -- HATE RALLY and BASTARDS being good examples), it's bad in most others.

Here is my attempt at creating a smaller, yet well-readable font:



I hope there is still some good information on the CPC file format, so that it would be possible to use this font in the actual game.
Logged

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: I'd like to submit a different font.
« Reply #1 on: April 30, 2013, 03:45:31 pm »

Nice! I can't help but note that eschewing the use of horizontal half-blocks really makes it look pixellated, but I recognize that's probably unavoidable. You're using vertical half-blocks aggressively to minimize the amount of vertical space needed, and CP437 doesn't have quarter blocks, so it'd be hard to improve much in that direction. I think this would be a good "alternate" news font, for when you really need to fit a huge heading in.

We do indeed have documentation on the .cpc file format; I reverse engineered it six years ago, and made sure to save the information for posterity.

Quote from: docs/cpcimageformat.txt
This is an explanation of the .cpc colored ascii image format used, so that you can alter, read, or create new images of the format currently used by LCS.

The first 4 bytes indicate how many images are in the file. Each file can contain multiple images, but they all have to have the same dimensions. newstops.cpc, for example, contains five different newspaper headers at the time of this writing, and only one is ever printed to the screen at any one time.

The second 4 bytes indicate the x dimension of each image.

The third 4 bytes indicate the y dimension of each image.

After that, the first image starts. It runs vertically down the y axis, giving data for each cell of the image sequentially. So the first cell is for x=0, y=0, the second cell is x=1, y=0, the third cell is for x=2, y=0, etc., until it wraps around and starts with x=0, y=1, and then eventually starts in on the next image. When reading in, you'll want three nested loops, one for reading in each image, one for the x axis, and one for the y. See the news.cpp function loadgraphics() for an example.

Each cell is four bytes long. The first byte gives the ascii code of the symbol to print to the screen. The second byte is the color code for the foreground. The second byte is the color code for the background. The third byte is the brightnees bool for the foreground, 1 for bright, 0 for dim.

That's all there is to it.

Jonathan Stickles
22 Jun 2007

I didn't look into cmv files specifically, but I would guess they're probably in the same format, just treating successive images as frames instead of as separate images.
Logged

usr_share

  • Bay Watcher
  • "For great justice!"
    • View Profile
Re: I'd like to submit a different font.
« Reply #2 on: May 01, 2013, 12:15:08 am »

Nice! I can't help but note that eschewing the use of horizontal half-blocks really makes it look pixellated, but I recognize that's probably unavoidable. You're using vertical half-blocks aggressively to minimize the amount of vertical space needed, and CP437 doesn't have quarter blocks, so it'd be hard to improve much in that direction. I think this would be a good "alternate" news font, for when you really need to fit a huge heading in.

We do indeed have documentation on the .cpc file format; I reverse engineered it six years ago, and made sure to save the information for posterity.

Thanks. Yes, it is unavoidable. The reason it's most noticeable is because the original font doesn't really have a lot of corners and serifs.

Well, now I can at least try and start working on a .cpc converter or something. Thank you again.
Logged