Questions tagged [typography]

Challenges related to the arrangement, layout, or formatting of monospace plain text.

Filter by
Sorted by
Tagged with
9 votes
3 answers
405 views

Interpret control characters like a terminal

Given a ASCII string containing control characters, compute what it should look like when printed to a terminal. Imagining the behaviour of a cursor, this is how to treat each character in the input: ...
pxeger's user avatar
  • 23.5k
4 votes
2 answers
240 views

Alignment of a string

This is similar to the alignment used in word. Task 3 inputs: A 1 line string, a positive integer k, and direction (left or middle or right) Your job is to insert ...
Vedant Kandoi's user avatar
25 votes
9 answers
3k views

Take CR and LF literally

As a celebration of good old Notepad, we are going to treat carriage returns and line feeds as what they originally meant, rather than what they are (ab-)used for today. Given a string consisting of ...
Adám's user avatar
  • 30k
39 votes
54 answers
4k views

Boustrophedonise

Related but very different. A boustrophedon is a text where every other line of writing is flipped or reversed, with reversed letters. In this challenge, we will just reverse every other line, but ...
Adám's user avatar
  • 30k
29 votes
6 answers
1k views

Fully-justify & hyphenate a block of text

Given a width and a block of text containing possible hyphen- ation points, format it fully- justified (in monospace). Fully justified means it is aligned ...
Dave's user avatar
  • 8,439
15 votes
11 answers
790 views

Easier communication means… ○ circular edition!

Based on this, but I was asked[​1​],[​2​] to do a graphical edition. Task Generate a circular display of the text ...
Adám's user avatar
  • 30k
33 votes
9 answers
2k views

Between the Lines

While doodling around on square-ruled paper the other day, I came up with the above negative-space font for digits. In case you haven't spotted it yet, the spaces between the above shapes yield the ...
Martin Ender's user avatar
7 votes
3 answers
420 views

LaTeX Table Generator

Write a function or program which, given a number of lines and columns, generates a corresponding tabular environment for LaTeX with no data in it. Table format ...
Fatalize's user avatar
  • 38.5k
41 votes
26 answers
4k views

Center The Text!

Center The Text! In this challenge you will be centering various lines. Examples Foo barbaz Foo barbaz ...
Downgoat's user avatar
  • 28.9k
16 votes
8 answers
727 views

Normal and inverted exclamation and question mark pairs

Challenge ¡We're going to give exclamation and question marks inverted buddies! Given a body of text containing sentences ending in ., ...
rgajrawala's user avatar
11 votes
5 answers
270 views

Implement LaTeX accent macros

Introduction The LaTeX typesetting system uses macros for defining accents. For example, the letter ê is produced by \hat{e}. In this challenge, your task is to ...
Zgarb's user avatar
  • 42.6k
18 votes
6 answers
947 views

Reverse Boustrophedon Text

Boustrophedon is a type of bi-directional text where successive lines alternate between reading left-to-right and right-to-left. Character direction was also mirrored with respect to reading direction....
Dendrobium's user avatar
  • 2,502
13 votes
3 answers
450 views

Layout Text in Columns

Write a program or function that given some text, a number of columns, and the column width, formats the text into columns. This is plain text typography. Rules Input The text will be a string of ...
intrepidcoder's user avatar
15 votes
3 answers
357 views

Remove the hyphenation

Time for a new typography challenge! It’s a common problem when copy-pasting between various document formats: hyphenation. While it reduces the raggedness of a left-aligned layout or evens spacing in ...
Sanchises's user avatar
  • 9,466
14 votes
1 answer
250 views

A most excellent proof, too small to fi—!

You sit at home, rubbing your hands in a most evil fashion. This time, I'll be able to set the community A-SPIN! I'll merely claim that I have proven this problem (which is of no doubt improvable) ...
Conor O'Brien's user avatar
21 votes
2 answers
277 views

Format a Drop Capital

Introduction Write a program or function that adds a drop capital to a paragraph. The program will input the text to format, the column width, and the number of lines to drop the capital. The drop ...
intrepidcoder's user avatar
9 votes
4 answers
396 views

Align the text to a block

Task Your task is to write whole program, which will align given input to a block of given size. Input: ...
Zereges's user avatar
  • 1,183
50 votes
8 answers
4k views

Avoiding Rivers

Background In typography, rivers are visual gaps in a block of text, which occur due to coincidental alignment of spaces. These are particularly annoying since your brain seems to pick them up more ...
Martin Ender's user avatar
11 votes
2 answers
532 views

Justify a text by adding spaces

Given this text Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ...
Toto's user avatar
  • 967