[jsword-devel] Modifying the display of Bible texts
Gabriel Valencia
gee4vee at mac.com
Wed Apr 18 19:49:48 MST 2007
Hey DM,
Thanks for the leads. Please see my replies below.
--
Gabriel Valencia
<gee4vee at mac.com>
Are you a GOOD person? Take this test to find out! http://
www.wayofthemaster.com/goodperson.shtml
On Apr 18, 2007, at 12:00 PM, jsword-devel-request at crosswire.org wrote:
> Send jsword-devel mailing list submissions to
> jsword-devel at crosswire.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.crosswire.org/mailman/listinfo/jsword-devel
> or, via email, send a message with subject or body 'help' to
> jsword-devel-request at crosswire.org
>
> You can reach the person managing the list at
> jsword-devel-owner at crosswire.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of jsword-devel digest..."
>
>
> Today's Topics:
>
> 1. Re: Modifying the display of texts (DM Smith)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 17 Apr 2007 21:34:46 -0400
> From: DM Smith <dmsmith555 at yahoo.com>
> Subject: Re: [jsword-devel] Modifying the display of texts
> To: J-Sword Developers Mailing List <jsword-devel at crosswire.org>
> Message-ID: <F1FDC2E8-DA3F-4BC2-83A1-BCCC5CAEFBFE at yahoo.com>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> Gabriel,
>
> I need a bit more info. See below:
>
> On Apr 13, 2007, at 2:41 PM, Gabriel Valencia wrote:
>
>> Hey all
>>
>> I have been incorporating the JSword API into a program I am working
>> on for displaying Biblical texts on a projector for use in Bible
>> studies, sermons, etc. Right now, I use the JSword APIs to retrieve
>> Bible texts and I use BibleDesktop components to display them. I am
>> still very new with XML, XSLT, etc., but one thing I would like to
>> change for the program is the display format that BibleDesktop uses
>> by default. For example, in BibleDesktop, the verses are usually
>> displayed line by line, but when you put it on a projector, it would
>> be nice to be able to increase the spacing to make it easier to read,
>
> What kind of spacing do you mean? Space between lines, words or
> letters? Or between verses?
Mainly between verses, but I am also considering between lines.
>
>> and perhaps increasing the side margins.
>
>
> This should be easy. I'll see what I can find out. It should be just
> a css change.
>
>> Also, I figured out how to
>> change the font size, but it requires (as far as I can tell) creating
>> a custom BookDataDisplay and modifying the HTML
>> TransformingSAXEventProvider's properties.
>
> I think there is a bit easier way. XSLTProperty.java has a bunch of
> static objects which represent each of the parameters that are
> currently recognized by BibleDesktop's xslt style sheet. Just modify
> these and then use the BookDataDisplay returned by
> BookDataDisplayFactory to do the displaying. (Currently this will use
> TextPaneBookDataDisplay, but later will be able to use a full fledged
> browser like IE or Mozilla)
>
Unfortunately, XSLTProperty's set of static objects doesn't include
the font size parameter. How about I expose it? :) I don't know the
implications of making changes to this class, so I'll hold off on that.
>
>>
>> If I understand correctly, BibleDesktop uses XSLT to determine how
>> text gets displayed.
>
>
> XSLT is used to take the OSIS and transform it into HTML. It also
> supplies a default CSS style sheet to do the actual "styling" of the
> html. I can't remember off the top of my head (and will look into it
> if you wish) but you should be able to supply your own CSS style
> sheet to override the default). Our xslt is found at bibledesktop/src/
> main/resources/style/simple.xslt and near the top is the default css.
>
>
>> Is there any way to modify this style sheet or
>> use a custom one?
>
>
> You can either modify the css or the xslt with one place in your
> ~/.jsword directory (the actual location depends upon whether you are
> on Mac, Linux or Windows; Mac from what I see from your email
> address.)
>
I don't seem to have a ~/.jsword directory, and I am on a Mac. I'm
assuming I can create the directory and drop my own xslt in there
with a different CSS and it'll work? As far as actually building my
project and putting everything in a jar, will that work?
>
>
>> Am I on the right track for what I want to do, or
>> is there an easier way to modify all these properties? Any guidance
>> would be appreciated.
>
>
> So to re-iterate, you can supply a replacement for the xslt file as a
> whole, or you can supply a css style sheet.
I see that simple.xsl has a css parameter. If I understand the code
correctly, I can set this parameter to the absolute URL of my own
stylesheet. XSLTProperty doesn't expose this parameter either though,
so it's similar to the font issue.
>
> I don't know your skill level so I don't know if this is enough info
> or not.
>
This definitely helps. At least I know where BD is getting these
properties from. I just don't want to reinvent the wheel if necessary
(like I did by creating a custom BookDataDisplay as I mentioned), but
I need to get into the API more to see how it all works.
> It will take me a bit of time to figure out the details, so let me
> know if you need more help and which you would like to do.
Ultimately, I would like the program to be able to modify these
settings at run-time so that users can change the look and feel of
the passage display including adding background colors/images, and so
on. For now, for our small group study, I just hope to make large
sections of text a little easier to read on a projector.
Thank you for taking the time to look into this. God bless!
>
>
>>
>> God bless your labor in the Lord!
>> --
>> Gabriel Valencia
>> <gee4vee at mac.com>
>> Are you a GOOD person? Take this test to find out! http://
>> www.wayofthemaster.com/goodperson.shtml
>
>
>
>
> ------------------------------
>
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
>
>
> End of jsword-devel Digest, Vol 35, Issue 6
> *******************************************
More information about the jsword-devel
mailing list