Monday, July 1, 2013

Wide Margin 1.2.9 Beta

I am pleased to announce the release of Wide Margin 1.2.9 Beta 

Wide Margin 1.2.9 Beta includes search and passage rendering improvements as well as bug fixes for the windows version. 
New Features include:
  •  Show search results for book names which also match passage content.
  •  Highlight search terms in search results.
  •  Better reference rendering
  •  Improved poetry layout



Right now we need lots of testing done to ensure that it is ready for release. I will be organizing a testing evening in the next few weeks. I want to say a big thank you to all the people who contributed to this release to make it possible.

Wide Margin is free and opensource and is produced entirely by volunteers. If you would like to try it or help contribute please visit our website at http://widemargin.org

Friday, June 14, 2013

Wide Margin 1.2.7 Alpha 2

I am pleased to announce the release of Wide Margin 1.2.7 Alpha 2 

Wide Margin 1.2.7 Alpha 2 includes a much improved passage text layout with headings, module references and note support. On windows the GTK UI has been replaced with a native windows user interface using WPF. 



New Features include:
  •  Section headings
  •  Improved text layout.
  •  References/notes in bible passages
  •  Native UI on Windows

I want to say a big thank you to all the people who contributed to this release to make it possible.

Wide Margin is free and opensource and is produced entirely by volunteers. New contributions are welcome. Even if you can't code you can contribute by testing, raising bug reports, contributing artwork and mock-ups.

You can download it from our website widemargin.org

Thursday, March 28, 2013

Wide Margin 1.2.2 Alpha 1

I am please to announce the release of Wide Margin 1.2.2 Alpha 1

Wide Margin 1.2.2 Alpha 1 is the first release to support a Sword module. Currently only one sword module is supported, the ESV (English Standard Version).
The ESV was chosen because it it is modern and accurate. Support for the KJV will be coming soon.

New Features include:
  •  ESV sword module support.
  •  Paragraph layout instead of verse per line.
  •  First searching using lucene.net



This was made possible through our new SharpSword backend. Which I will blog about later.

I want to say a big thank you to all the people who contributed to this release to make it possible.

Wide Margin is free and opensource and is produced entirely by volunteers. If you would like to help or contribute please visit our contribute page:

Wide margin 1.2 Alpha 1 can be downloaded from our website at http://widemargin.org/Download

Saturday, March 16, 2013

Subscript and Superscript in GTK#

In Wide Margin I had a need to use superscript for verse numbers. This is quite common in printed bibles because it reduces the impact of the verse number on the readability of the text. In Wide Margin I use a Gtk TextView to display my text, formatting in a Gtk TextView is achieved using TextTags which specify formatting for a range in the text.

A TextTag does not have a property for subscript or superscript rather it has a property call Rise. Setting this to a positive value moves the text up and setting it to negative moves the text below the line.

In GTK3 the value of Rise is in pixels, in GTK2 the value of Rise is in Pango Units, There are 1024 pango units in a Pixel. This confused me for quite a while because I was reading the GTK3 docs and assuming a unit of Pixels, but I was using GTK2. I was trying to Rise my text by 5 units which in GTK2 is smaller then what can be rendered.

 Setting Rise will move the character up or down but will leave the size unaffected. To get superscript or subscript you will also need to reduce the font size.

Superscript (GTK2) Subscript (GTK2)
The exact amount you want to move change the size and move the the text up or down will depend on how you want it to look. So have a play until you get it right.

Wednesday, October 31, 2012

Wide Margin 1.1 Released


I am please to announce the release of Wide Margin 1.1

Wide Margin 1.1 comes with a load of usability improvements and bug fixes.

New Features include:
  •  Mouse driven passage lookup
  •  Filtered Searches
  •  Continuous Scrolling for search results
  •  Target verse highlighting



I want to say a big thank you to all the people who contributed to this release to make it possible.

The application can be downloaded here and supports both ubuntu and windows.

Wide Margin is free and opensource and is produced entirely by volunteers. If you would like to help or contribute please visit our website:

http://widemargin.org

Monday, October 8, 2012

Invoking on the UI thread in GTK#

Not Threadsafe
GTK like most GUI toolkits is not thread safe. This means that you must only ever update it form the UI thread. If we want our applications to be responsive however we must run any long running processing on a different thread so that the UI thread is free to respond to user input. This posses a problem because we need to be able to update the UI to reflect the progress and outcome of the processing, but we can't do that directly because the UI is not threadsafe.

How to update from another thread without updating from another thread
Fortunitely GTK# has a built in mechanizm for running code on the UI thread from another thread. This mechanism is call Application.Invoke and you can call it like this.


Application.Invoke((_,__) =>
{
    // update UI here
});


This method however is suboptimal, firstly because Application.Invoke takes two parameters (object sender, EventArg args). In most cases we don't need these and so in my example I have used _ for the sender and __ for the args. The second problem is that we only really need to call this if we are not already on the UI thread. We don't want to take on the penalty of the overhead if we are already on the UI thread.

There must be a better way
In winforms useful methods are provided which solve the problems presented by Application.Invoke.

The first is Control.InvokeRequired this will return true if we are not on the UI thread or false if we are.

The second is Control.Invoke this is like Application.Invoke but without the overhead of having to specify a sender and args and can be called like this:

Control.Invoke(()  =>
{
    //update UI here
});

By combining these you can write code that only invokes when it needs to. The details of this can be found here:
http://msdn.microsoft.com/en-us/library/ms171728(v=vs.80).aspx

Can we do that in GTK?
Yes we can. We can achive exactly that using Extension Methods. Actually we can improve on it by making the Invoke method only call Application.Invoke if we are not already on the UI thread. The following code is provided under the Unicorn licence.

Doing this means that what was:

Application.Invoke((_,__) =>
{
    // update UI here
});

Becomes:

Invoke(()  =>
{
    //update UI here
});

Which is cleaner and takes care of figuring out what thread your are on for you.

Saturday, September 15, 2012

Wide Margin 1.1 hits Beta

I am please to announce that the 1.1 release of Wide Margin has hit Beta.

Changes since 1.0 include:

  • Mouse friendly passage navigation and filtering.
  • Search Filtering.
  • Continuous scrolling on search results.
  • Windows support.


How ca you get it?
The windows version can be downloaded from here:
The ubuntu version can be installed from our PPA:

How can you help?
At this stage we need testers. We need people to install and use Wide Margin. If you find any problem please raise them on our bug tracker here: