You are not logged in.

#1 2010-05-27 23:38:21

AndreasBWagner
Member
From: Boston, MA, USA
Registered: 2010-03-05
Posts: 17
Website

Boustrophedon text editing in vim?

Hello,
I would like to edit and view text in boustrophedon because it will help me keep my place and will increase my reading efficiency.

Boustrophedon text alternates between left-to-right and mirrored right-to-left such that text flows "like an ox turns in the field" giving the text direction its name.

t-boustrophedon.jpg.jpg

Boustrophedon.svg

I have heard that writing direction was determined by the traditional writing instruments of the culture, which typically only were for one direction.
Modern day writing instruments: ballpoint pens, pencils and keyboards do not have the limitations of brushes, quills and chisels.

Here are some thoughts on formating for boustrophedon:
http://www.ntg.nl/pipermail/aleph/2004- … 00094.html

I would most like to do this in vim. However, I don't know where to start with implementing this.

Any help would be great.:)

Last edited by AndreasBWagner (2010-05-28 00:55:47)

Offline

#2 2010-05-28 00:29:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Boustrophedon text editing in vim?

'Boustrophedon typesetting'
Ummm, vim isn't a tool for typesetting - Tex (mentioned in that e-mail) is.

Do you want/need to write things or you just want to read 'em in boustrophedon?
IMHO you can still write the usual way, because you write a lot slower than you read so your reading efficiency is limited by your typing skills not the text layout.

Edit: Please post a thumbnail and link to the full picture, OK?

Edit 2: I've googled it for you
http://www.google.pl/search?hl=pl&safe=off&client=firefox-a&hs=ez8&rls=org.mozilla%3Aen-US%3Aofficial&q="reverse+every+other+line"+in+a+file&aq=f&aqi=&aql=f&oq=&gs_rfai=

#!/usr/bin/perl
#
#  ./boustrophedon.pl file
#  
#  From a discuussion on the dc-stuff mailing list a few years back
# about being able to reverse every other line.
#
#  Here is the result.  Easy, yes.
#
while (<>) {
  $i++;
  chomp;
  if ($i % 2 == 0) {
    $data = reverse $_;
    print "$data\n";
  } else {
    print "$_\n";
  }
}

I named that script 'bus' and run it on a testfile:

[karol@black test]$ cat testfile 
this is a test
this is a test
this is a test
this is a test
this is a test
this is a test
[karol@black test]$ ./bus testfile 
this is a test
tset a si siht
this is a test
tset a si siht
this is a test
tset a si siht

I've heard that Perl 6 is / will be great wrt to keeping the graphemes together but that's not a problem in English :-)

#!/usr/bin/env perl

use strict;
use warnings;
binmode STDOUT, ":utf8";


my $original = "re\x{0301}sume\x{0301}";
my $wrong    = reverse $original;
my $right    = join '', reverse split /(?=\X)/, $original;

print <<HERE;
original: [$original]
   wrong: [$wrong]
   right: [$right]
HERE


__DATA__
Smart reverse

#"re\x{0301}sume\x{0301}" -> résumé
#"e\x{0301}muse\x{0301}r" -> émusér
[karol@black test]$ /home/karol/docs/code/smart_reverse.pl 
original: [résumé]
   wrong: [́emuśer]
   right: [émusér]

Last edited by karol (2010-05-28 01:08:32)

Offline

#3 2010-06-01 16:00:46

AndreasBWagner
Member
From: Boston, MA, USA
Registered: 2010-03-05
Posts: 17
Website

Re: Boustrophedon text editing in vim?

Printing strings backwards is a small part and not the most challenging part.

Other problems include:

Mirroring each alternate line including individual characters, not just the order of
characters. This should preferably not require two different fonts to allow for any font to be used.

When moving the cursor in insert mode or jumping forwards or backwards in cmd mode the cursor should only go up or down and reverse direction but not jump to the opposite end of the next line.

Offline

#4 2010-06-11 01:10:14

upsidaisium
Member
From: Vietnam
Registered: 2006-09-16
Posts: 263
Website

Re: Boustrophedon text editing in vim?

I can't think of any font off the top of my head that can handle this. You should probably Google for boustrowhatever capable fonts. And if you can't find any, then.. it's your job to make one wink I don't imagine that vim can use more than one font while editting -- for example, a normal font for normal lines and a special font for the reversed lines -- so you would really need a font that has all of the normal and reversed glyphs.

Of course, that's assuming that vim (or any other common text editor) could handle editting this sort of text (without big changes/patches). Creating your own viewer -- or searching for one that somebody else has already made -- seems to be a considerably more reasonable starting point.

Last edited by upsidaisium (2010-06-11 01:11:58)


I've seen young people waste their time reading books about sensitive vampires. It's kinda sad. But you say it's not the end of the world... Well, maybe it is!

Offline

Board footer

Powered by FluxBB