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

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

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.