[jsword-devel] Modifying the display of texts

DM Smith dmsmith555 at yahoo.com
Tue Apr 17 18:34:46 MST 2007


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?

> 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)


>
> 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.)



> 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 don't know your skill level so I don't know if this is enough info  
or not.

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.


>
> 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




More information about the jsword-devel mailing list