[sword-devel] Japanese Ruby Characters
iwagn973 at students.bju.edu
iwagn973 at students.bju.edu
Sun Dec 27 17:48:28 MST 2009
Ok, sounds good. Regarding the name, I can't tell whether the term Ruby is XHTML-only or a linguistic term as well. I figured that at least for html rendering then it should be a ruby tag since that is the latest standard, but it could very well be referred to as a gloss in other places.
-----Original Message-----
From: "Troy A. Griffitts" <scribe at crosswire.org>
Date: Sun, 27 Dec 2009 17:26:12
To: SWORD Developers' Collaboration Forum<sword-devel at crosswire.org>
Subject: Re: [sword-devel] Japanese Ruby Characters
Since we're still looking into the clucene issues before release, we can
get this into 1.6.1, but I'd like feedback from the projects using
osishtmlhref.
Does this patch mess things up for anyone? I doubt many people were
using the previous "(<gloss>)" display for anything and were simply
never turning on gloss support with:
mgr->setGlobalOption("Ruby", "On");
Having a look at this, is "Ruby" the best term for us to use for gloss
support? i.e. Is "ruby" a linguistics term or an XHTML term?
Troy
IAN WAGNER wrote:
> I probably should have submitted this information at least 6 months ago, but I have been swamped with school, so I apologize for not posting this sooner. During my work on PocketSword, I patched osishtmlhref.cpp to output proper ruby tags, and wrote some CSS to display it properly in browsers that do not yet support ruby tags (which is pretty much all of them for the moment). Below I have pasted the unified diff and my CSS stylesheet. I hope this is useful to everyone :)
>
>
> --- /Users/ianthetechie/sword-svn/src/modules/filters/osishtmlhref.cpp 2009-12-27 12:39:38.000000000 -0800
> +++ osishtmlhref.cpp 2009-12-27 12:55:37.000000000 -0800
> @@ -194,11 +194,17 @@
> outText(val, buf, u);
> }
> if ((attrib = tag.getAttribute("gloss"))) {
> + // I'm sure this is not the cleanest way to do it, but it gets the job done
> + // for rendering ruby chars properly ^_^
> + buf -= lastText.length();
> +
> + outText("<ruby><rb>", buf, u);
> + outText(lastText, buf, u);
> val = strchr(attrib, ':');
> val = (val) ? (val + 1) : attrib;
> - outText("(", buf, u);
> + outText("</rb><rp>(</rp><rt>", buf, u);
> outText(val, buf, u);
> - outText(")", buf, u);
> + outText("</rt><rp>)</rp></ruby>", buf, u);
> }
> if (!morphFirst) {
> processLemma(u->suspendTextPassThru, tag, buf);
>
>
>
> ruby
> {
> display: inline-table;
> text-align: center;
> white-space: nowrap;
> text-indent: 0;
> margin: 0;
> vertical-align: -10%%;
> }
>
> ruby > rb, ruby > rbc
> {
> display: table-row-group;
> line-height: 110%%;
> }
>
> ruby > rt, ruby > rbc + rtc
> {
> display: table-header-group;
> valign: top;
> font-size: 60%%;
> line-height: 40%%;
> letter-spacing: 0;
> }
>
> ruby > rbc + rtc + rtc
> {
> display: table-footer-group;
> font-size: 60%%;
> line-height: 40%%;
> letter-spacing: 0;
> }
>
> rbc > rb, rtc > rt
> {
> display: table-cell;
> letter-spacing: 0;
> }
>
> rtc > rt[rbspan] { display: table-caption; }
>
> rp { display: none; }
>
> Ian
> ---------------
> May the source be with you
> http://flynnsarcade.net/
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
_______________________________________________
sword-devel mailing list: sword-devel at crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
More information about the sword-devel
mailing list