[sword-devel] Japanese Ruby Characters
Troy A. Griffitts
scribe at crosswire.org
Sun Dec 27 17:26:12 MST 2009
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
More information about the sword-devel
mailing list