Where a translation goes
A text in a balloon goes in its room: the share of the balloon’s outline its source gets beside the balloon’s other texts. The share reaches half the page’s size past the lines splitting the balloon, which aren’t drawn, so its letters keep only a quarter of their size from those lines, and stay centred in a share that narrows. A free text or a sound effect goes in its source’s frame, and so does a remark written across the edge of a balloon that holds other texts, whose share would be its narrow source box. A room’s outline is traced from the balloon’s pixels with an anchor every few pixels, so the frame keeps only the few anchors that hold its shape: four for a rectangle or an ellipse, or those of a smooth curve. On 183 balloons whose traced outlines had a median of 76 anchors, the frames have a median of 5, small enough to reshape with Direct Selection. Translation stores its decisions, not their result: the frame, its margin, where the text is anchored, its direction, and Auto size. The size itself is worked out at every render, so resizing a frame reflows its text, as resizing a Clip Studio Paint balloon moves its text, and nothing stored goes stale when a font loads.One size for a page
A letterer keeps one size for a page’s dialogue. Koharu measures the page’s size with the renderer: the median of the largest size each balloon’s text’s room holds in whole words. A page with no text in a balloon is measured from all its text. A title’s or a running head’s frame widens to hold far more than a balloon, so it doesn’t set the dialogue’s size.- A translation that would draw smaller than the page’s size is brought up to it, as far as its room allows. Small text can’t be read.
- A translation that fits larger stays larger. A big line in a big balloon is a shout.
- A translation whose lines would span less than half its balloon at the page’s size grows toward its source’s size, as the original filled the balloon: as large as the balloon holds up to the source’s size, within an eighth of an em of its border. If its lines still span less than half the balloon there, it grows past the border until they span half, or to the source’s size, with an outline where it runs out.
- A sound effect is brought up to its source’s size when that’s smaller than the page’s.
Making room
When a text would draw smaller than the page’s size, Koharu makes room in this order before it hyphenates a word.1
Narrow the margin
A balloon’s text has a letter’s width of air around it. A text under the page’s size takes less,
down to three quarters, which keeps a gap from the balloon’s border. A text its balloon holds at
only about the page’s size narrows its margin the same way, until it draws 15% larger.
2
Widen a free text
A vertical source’s column holds only a word or two of a horizontal translation, so a free
text’s frame widens until it holds the page’s size: along its lines to two and a half times its
width but not past its longer side, then across them to three lines. It stays inside its panel
and off the page’s other texts and balloons. Without that limit, a text covered a face beside
it.
3
Hyphenate
Where whole words would draw under nine tenths of their size, one word may take a hyphen near its
middle if that makes the text at least a tenth larger. A text takes one such hyphen at most: one
in a narrow balloon took four to grow a tenth. Only words longer than five letters break,
keeping two letters on each side, with at most two hyphenated lines in a row, as Photoshop’s
defaults do. A drawn-out sound such as “Gwaaaaah!” breaks in the middle of its run of one
letter, “Gwaa-aaah!”, in any language and wherever a line can’t hold it whole, since
dictionaries have no hyphenation points in it.
4
Run past the balloon
A balloon’s text that still draws under nine tenths of the page’s size keeps the page’s size and
runs past its balloon, above and below it rather than past its sides, centred, with as many hyphens as keep it nearer the balloon and an
outline as text on art gets. It stays on the page and off its other balloons and texts,
shrinking just enough to clear them. Such a text has a set size rather than Auto.
Lines, colours, and direction
- Lines are centred on one axis of the balloon, as Western balloons are lettered. Japanese and Chinese lines start together at the top or the left, as the W3C’s Japanese layout requirements align a line to its head.
- Colours are the source’s: its ink is the fill, its outline the stroke, with the stroke’s width in proportion to the size.
- Outline. A text whose source has no outline gets a stroke so it stays legible on art, tone, or a balloon’s border: black around a light fill, white around any other, a sixteenth of its size for a sound effect and an eighth for a text, in a balloon too. On paper of the stroke’s colour it can’t be seen. No text’s outline is wider than an eighth of its size.
- Direction. A translation is vertical only when its source is vertical and the target is Japanese or Chinese. Any other language runs horizontally, turned by its source’s tilt.
Auto and a typed size
Auto grows a text to the largest size its frame holds; a word too wide for its line stops the growth. Past every step at half size, it shrinks on until the text fits. A typed size draws the text at exactly that size, as Photoshop does, so texts set to one size look the same. Text too long for its frame runs past it, centred and hyphenated where that keeps it nearer, past a balloon’s top and foot rather than its sides, and a + at the frame’s top-left corner marks it until you resize the frame.Typeset a translation
Change the font, size, colour, and border of the texts you select.
koharu-pipeline README and the koharu-renderer README.