Author
|
Topic: Aligning text to lines (Read 2 times)
|
Lindblum
Guest
|
|
« on: August 11, 2008, 08:57:15 am » |
|
I'm into my first translation project, so instead of using conventional methods of script insertion I developed my own process with my own functions. In case I do another translation in the future, or want to change horses mid-race, I'll have to learn about Atlas, and my syntax might be convertible to common script format. The thing is, when I insert a script the game reads it as a stream, so words get broken up between lines all the time. I have to actually make my own function to format my dialog strings to either align the word to the next line, or hyphenate it to improve readability. I don't want to do this for every line, so I'll have to flag each line that needs to be aligned. Is there an accepted way of doing this, or should I just keep doing it my way? Example: "..Might be interest" "ing.I was gettin' a" " little bored just " "makin' regular clot" "hes." -becomes- "..Might be interes-" "ting.I was gettin' " "a little bored just" "makin' regular clo-" "thes." *The quote marks are just to show you where the lines begin and end. Ooh, and I'd also like to know if I can define scripts and tables that manage single-byte/double-byte to ASCII/Unicode conversion simultaneously, so I can insert partially translated scripts (ASCII for English, Unicode for foreign) (Obviously, the script file would have to be entirely Unicode, so whether single-byte or double, my table would have to map to a Unicode character, even if it's English).
|
|
« Last Edit: August 11, 2008, 09:05:43 am by Lindblum »
|
|
|
|
I.S.T.
Guest
|
|
« Reply #1 on: August 11, 2008, 09:12:08 am » |
|
This should go into General Romhacking, not Script Help and Language Discussion. http://www.romhacking.net/forum/index.php/topic,6733.0.html Script Help and Language Discussion rules. Edit: Screwed up the link to the SHLD rules. D'oh!
|
|
« Last Edit: August 11, 2008, 09:24:58 am by I.S.T. »
|
|
|
|
Aerdan
Guest
|
|
« Reply #2 on: August 12, 2008, 05:24:48 pm » |
|
That won't work, as single-syllable words [like 'clothes' should not be hyphenated. I don't recall offhand what the hyphenation rules are aside from that, however, but you might want to keep that in mind if you decide to write a hyphenation script.
|
|
|
|
Lindblum
Guest
|
|
« Reply #3 on: August 12, 2008, 05:48:03 pm » |
|
I think when you're forcing text into 19-character lines the reader is not going to care as much about MLA specifics as much as the fact that you tried. Hyphens anyw- here is more readable than hyphens now here.
|
|
|
|
Aerdan
Guest
|
|
« Reply #4 on: August 12, 2008, 06:47:26 pm » |
|
It's not an MLA thing, it's an overall readability thing. Furthermore, if you have a 19-character-per-line limit, you need either a thinner font or a wider window. Or both.
|
|
|
|
BRPXQZME
Guest
|
|
« Reply #5 on: August 12, 2008, 06:51:40 pm » |
|
Hyphenation was described as the Anarchy of Pedantry in one article I find particularly useful on the subject (kind of funny how the situation hasn’t really changed since 1991 – word processors still suck at it, and to date the Liang algorithm is still the best IMHO, though it obviously won’t do for NES). There aren’t any real rules to hyphenation, besides one golden rule: don’t confuse the reader.
|
|
|
|
Spikeman
Guest
|
|
« Reply #6 on: August 13, 2008, 01:38:04 am » |
|
Hyphens anyw- here is more readable than hyphens now here.
Both took me about a minute to figure out.
|
|
|
|
Lindblum
Guest
|
|
« Reply #7 on: August 13, 2008, 02:32:06 am » |
|
Both took me about a minute to figure out. Grumble... Maybe I'm just a better reader
|
|
|
|
Kajitani-Eizan
Guest
|
|
« Reply #8 on: August 13, 2008, 03:32:40 am » |
|
honestly, i suggest writing a function to implement word wrap. better than hyphenation, even if you can fit less per page.
|
|
|
|
Nightcrawler
Guest
|
|
« Reply #9 on: August 13, 2008, 07:56:03 am » |
|
honestly, i suggest writing a function to implement word wrap. better than hyphenation, even if you can fit less per page.
Agreed. In my opinion word wrap is always preferred to hyphens. It's greatly more readable to me.
|
|
|
|
Lindblum
Guest
|
|
« Reply #10 on: August 13, 2008, 09:05:33 am » |
|
(No that's not MLA...High School was a long time ago...)
The compromise I'm using is... When a word is on a line split if the left side is 2 or less letters I wrap it by inserting that many spaces. The higher the threshold, the greater the overall readability. Otherwise I insert a hyphen before the last letter on the left side. Maybe if I push the threshold to 3 or 4 you'll be satisfied. I can only oblige when the memory is generous enough. M|ario -> Mario Ma|rio -> Mario Mar|io -> Ma- rio Mari|o -> Mar- io
I'm also concerned about punctuation getting thrown onto the next line. It just looks embarrassing. I think I should count punctuation on the right side of a word as part of the word. I don't want to end up with something stupid like: Mario|. -> Mari- o. Mario|!? -> Mario- !?
Maybe a right-side threshold would be a good idea?
|
|
|
|
KaioShin
Guest
|
|
« Reply #11 on: August 13, 2008, 09:22:44 am » |
|
Get a 8x8 or 8x16 Font going and forget about using hyphenation at all. It'll propably be not as hard as you think.
|
|
|
|
Nightcrawler
Guest
|
|
« Reply #12 on: August 13, 2008, 10:02:15 am » |
|
I'm also concerned about punctuation getting thrown onto the next line. It just looks embarrassing. I think I should count punctuation on the right side of a word as part of the word. I don't want to end up with something stupid like: Mario|. -> Mari- o. Mario|!? -> Mario- !?
Maybe a right-side threshold would be a good idea?
In my script formatting code, punctuation is treated as part of the word. I think it would look extra terrible for punctuation to be by itself or hyphenated off.
|
|
|
|
Deathlike2
Guest
|
|
« Reply #13 on: August 13, 2008, 11:24:56 am » |
|
I'm not sure how one doesn't understand that hyphenating most of the words is being viewed as one of the biggest cardinal sin of readability...
You don't need a poll to confirm this, but it will be hard on the eyes for most.
|
|
|
|
Lindblum
Guest
|
|
« Reply #14 on: August 13, 2008, 01:09:50 pm » |
|
Look, I've got a fixed 8x8 font and an engine that has no new-line character (that I know of). The text fits in memory nicely. Now I throw in some formatting to make it easier on the eyes. Even if I am removing start-of-line spaces, statistically I'm going to be multiplying the space I'm using, sometimes to the point where the local text pointers can no longer reach the end. Let's think of large words. Statistically, they're not only more likely to land on line breaks, but they require proportionately more padding spaces to wrap them to the next line. Hyphens, however, limit the memory waste to a limit of one character per word (unless it's stupidly long), plus they warn the reader that the word will continue. I got 300kB of text. If you wanna tell me to go line-by-line and make an informed judgment on every line break, fine.
|
|
|
|
|