1. Help: A First Program
- Posted by Jonathan Craft <jcchina at BIGFOOT.COM> Nov 08, 1999
- 539 views
Hi EUPHORIA, I'm new to Euphoria and to programming. I want to write a program and need hints and ideas for how to do it. Following is a fairly long explanation of what I'm trying to do. Here's the situation: ***I own a Rocket ebook, and I play guitar. I want to put a book of chorded songs in my ebook. ***Songs that you can download from the internet are in monospace format. I want to use the ebook's built-in proportional font because you can fit more on the screen (300 x 450 dpi). ***Due to limitations of the ebook, I can only use text, line breaks, and spaces (non-breaking spaces). I want to write a program that converts the files from monospace to html format. That's the basic problem I'm working on. To make it clearer, here's an example line in a text guitar chord file. D AsusA Em7 G D -- a line of chords This is a line in a song, -- the text of the song I need to: *skip over the title (and any lines that don't have chords in them, like the second verses in the song). *find out how long a string is in a certain truetype font. *find out how much space (in length) to put in each line to line up the two lines. *check and break lines that are too long, while keeping the chords over the words. *replace spaces with " ". *save the file as an html file. I know some of this is pretty basic. I also would like an editable preview before the html conversion, so you can fix any spacing mistakes. Thanks for any hints or help that you can offer. I think this should be a doable, but challenging first program in Euphoria. Jonathan mailto:jcchina at bigfoot.com
2. Re: Help: A First Program
- Posted by David Cuny <dcuny at LANSET.COM> Nov 07, 1999
- 484 views
- Last edited Nov 08, 1999
Jonathan Craft wrote: > Songs that you can download from the internet are > in monospace format. I want to use the ebook's > built-in proportional font because you can fit more > on the screen (300 x 450 dpi). In Win32Lib, you can use the getTextExtent to determine the length of a string. Everything else is just gruntwork. -- David Cuny