View Issue Details

IDProjectCategoryView StatusLast Update
0007610ScribusTypographypublic2019-08-04 00:10
ReporterHellstorm Assigned Topierremarchand  
PrioritynormalSeverityfeatureReproducibilityN/A
Status acknowledgedResolutionopen 
Product Version1.3.3.11 
Target Version1.5.0svn 
Summary0007610: Support for ruby characters (Furigana)
DescriptionJapanese often has annotations characters (called ruby) between the lines on top of the Chinese characters in order to give annotations how to read a character.

This is done by adding the characters between the lines of the ordinary text. The line spacing is not adjusted (at least as how far I could tell). In short: a “third” line is added _in_ the line spacing, with very small text. It appears in vertical as well as in horizontal writing.

For example we have the compound:

??? (Japanese language)
A beginner of Japanese or some Japanese primary school childrens can’t read this. For this, the reading ‘nihongo’ in the Japanese syllable script Hiragana (????) will be added on top, on the bottom or at the right of it:

????
???

the ruby characters have to be smaller than the original text. Also, because their length can vary, there are different alignment options.
They can either start at the left, so that the characters ? and ? start at the same time; the reading can be centered on top of the Chinese characters, they can be aligned right. Additionally, the individual Chinese characters can have their individual reading on top of it, so that the reading compound is a little bit divided. (Some other options are also available).
If the space is not enough, the ruby characters may also overlap on the other characters written around the base compound.

Openoffice actually does this wrong, because in (my opinion) Openoffice the line spacing is too narrow at first, and if a ruby character is added, it cannot fit between the lines, so the line spacing will be adjusted only for that line (which looks ugly).

Ruby characters are also used in Chinese with a phonetic system called ‘Zhuyin Fuhao’, but this needs extra care because of tone marks.


This feature is really necessary for Japanese, because it is used extremely often and also used for stylistic purposes in literature.

http://en.wikipedia.org/wiki/Furigana
TagsCJK, HOST-Oman
Patch

Relationships

child of 0003965 acknowledged Metabug: Support for non-latin languages 

Activities

Hellstorm

2009-05-10 10:50

reporter   ~0021706

Could somebody connect this to the Non-latin-Metabug 0003965?

pierremarchand

2009-05-15 18:01

reporter   ~0021746

The article on Wikimedia is a good starting point, however it would be nice if you could point to (or upload here) documents showing it in use. Maybe a couple for perfect typesetting and one to show the ugly.
TIA

Hellstorm

2009-05-16 07:01

reporter   ~0021751

Hm, one good _book_ (for entire CJK) would be this:
http://oreilly.com/catalog/9780596514471/

I have some japanese books available, but I don’t know if I should scan them?

pierremarchand

2009-05-16 09:49

reporter   ~0021753

Indeed, the book seems fascinating. Although there’s no chance that I can afford it for some time and the chapter dedicated to "ruby" glyphs is not available as part of the preview.
I think that you can safely scan few examples from your japanese books without problem regarding copyrights. If you don’t feel easy to put these scans on a public place such as this bug tracker, you’ve got the option to send me a private mail (pierre at scribus.info).

amthomas

2009-11-06 20:21

reporter   ~0022821

Here is a W3C article on ruby text:

http://www.w3.org/TR/1999/WD-ruby-19990322/

I think this has enough examples to show most people what Ruby text is, when it can be used, and why it is useful.

I own a copy of CJKV information processing, and I would love to help improve this feature of Open Office. I am a programmer, I am fairly competent in Japanese, and I enjoy all the complexities of digital typography and layout. However, I am not familiar with Open Office' code base.

If there are other people that would like to work on this, or to mentor me while I attempt to work on this, please let me know.

amthomas

2009-11-06 22:31

reporter   ~0022822

Of course, by "Open Office" I mean Scribus. Someone mentioned that Open Office did this wrongly, and I had OO on the brain from then on, apparently.

*shakes head in disbelief of own mindlessness*

I use Scribus whenever I can, and I would love to be able to completely switch to it for doing layout. Ruby support would make layout of Japanese text great, and the lack of that support is the reason why I still use InDesign for laying out Japanese text.

Hellstorm

2009-12-14 04:52

reporter   ~0022960

Last edited: 2009-12-14 04:53

This would be really great.
I am no programmer, but I am relatively competent in Japanese, so I could maybe help a little bit.
I think, it would be nice to include some kind of Japanese reading dictionary in Scribus, so that the readings are generated automatically. Maybe even sorted according to Jooyookanji - e.g. you can select “already in grade 7, thus no Furigana over basic characters” or “complete knowledge of Jooyookanji, thus only Furigana over seldom characters“ etc.

One thing though:

I think, it would be great to make Zhuyin Fuhao (used in Taiwan) supported from the start.

Problems arising there would be:

1) Zhuyin are _always_ displayed at the right side of the character, even in horizontal writing
2) They are stacked on each other in a syllable block
3) The tone mark gets to the right of the character

Btw: Why doesn't this bug tracker support UTF-8? :(

ThomasG

2011-10-19 20:18

reporter  

examples.tar.gz (48,670 bytes)

ThomasG

2011-10-19 20:20

reporter   ~0027057

I've just downloaded and compiled 1.5.0svn and grepped for ruby in the source, but aside from some lines related to the colour and the scripting language I haven't found anything to indicate that something is done in the direction of adding ruby support. Has anything happened in that direction in the last two years?

I did some experiments in the last couple of days and thought to share:

A lot of applications seem to use MeCab to do the "reading dictionary" and sentence analysis these days. It has Python and C bindings.

http://mecab.sourceforge.net/

For the rest of the comments, see the examples.tar.gz

I have hacked together a Python script that reads a file with Japanese text and adds LaTeX ruby code to those lines. The LaTeX layout seems to be a very good example on how it *should* look. The LibreOffice example is a good example how it shouldn't. ;-P (At least layout-wise)

The *semantic* difference that can be seen is that for example the word "okashi", characters 6+7+8 in the first line is treated as one word by MeCab, and so the whole "O-KA-SHI' ruby is inserted over all three characters, while LibreOffice just inserts the 'KA-SHI' for characters 7 and 8. I don't know which is considered more "correct" there.

At least for the one document I had to do with a few lines of ruby/furigana I now could use a LaTeX rendering frame for those lines.

I fiddled a little with making the script callable from Scribus, but while it seems to work that it reads original text from one test frame and writed the text with furigana in brackets to another frame, having no real way to do the formatting makes it somewhat moot.

cezaryece

2011-10-19 21:21

updater   ~0027058

@ThomasG: you should try ScribusOIF tree - there was done some work for support of non-latin languages.
As I know team has problem with finish that code and any help (in develop but also in testing - best in both) will be very welcome.

ThomasG

2011-10-20 19:10

reporter   ~0027073

Ah, yes. looks "interesting" ( also crash wise. ;-) )

I haven't found anything that describes how it *should* work, though. If there is a better place to get in contact to help out the ScribusOIF team, someone please let me know.

I can definetely do some testing, and I can READ c++ pretty OK, but I have not WRITTEN much in it so far. ;-P


I have encountered one reproducible bug, though I don't know if it's in a "this should work" part or in a "this doesn't work yet" part the devs already know about.:

- Create text frame
- "Edit Text" in Story Editor
- Enter one line ("foobar")
- "File" -> "Update Text Frame and Exit"
- "Edit Text" again
- Split the one line into two lines (and thus two paragraphs) ("foo" and "bar")
- "File" -> "Update Text Frame and Exit"

Crash in "GlyphStore::itemCharCount"

Backtrace, I hope that's right.

gdb /data/Software/ScribusOIF/bin/scribus
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /data/Software/ScribusOIF/bin/scribus...(no debugging symbols found)...done.
(gdb) bt
No stack.
(gdb) run
Starting program: /data/Software/ScribusOIF/bin/scribus
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffdf8c3700 (LWP 27238)]
Object::connect: No such signal PropertyWidget_Text::DocChanged()
Object::connect: (sender name: 'textPropsWidget')
Object::connect: (receiver name: 'MainWindow')
QFSFileEngine::open: No file name specified
[New Thread 0x7fffdf0c2700 (LWP 27244)]
[New Thread 0x7fffde8c1700 (LWP 27245)]
QFSFileEngine::open: No file name specified
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearCStyle()
Object::disconnect: (sender name: 'charStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearPStyle()
Object::disconnect: (sender name: 'paraStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
[Thread 0x7fffdf0c2700 (LWP 27244) exited]
[Thread 0x7fffde8c1700 (LWP 27245) exited]
Create a TextLayout. text: StoryText(0x23ecd08) ; frame: PageItem_TextFrame(0x23ec970)
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearCStyle()
Object::disconnect: (sender name: 'charStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearPStyle()
Object::disconnect: (sender name: 'paraStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearCStyle()
Object::disconnect: (sender name: 'charStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearPStyle()
Object::disconnect: (sender name: 'paraStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
Object::connect: No such slot PropertyWidget_TextStyles::doClearCStyle()
Object::connect: (sender name: 'charStyleClear')
Object::connect: (receiver name: 'styleWidgets')
Object::connect: No such slot PropertyWidget_TextStyles::doClearPStyle()
Object::connect: (sender name: 'paraStyleClear')
Object::connect: (receiver name: 'styleWidgets')
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearCStyle()
Object::disconnect: (sender name: 'charStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearPStyle()
Object::disconnect: (sender name: 'paraStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
Object::connect: No such slot PropertyWidget_TextStyles::doClearCStyle()
Object::connect: (sender name: 'charStyleClear')
Object::connect: (receiver name: 'styleWidgets')
Object::connect: No such slot PropertyWidget_TextStyles::doClearPStyle()
Object::connect: (sender name: 'paraStyleClear')
Object::connect: (receiver name: 'styleWidgets')
No default script for "GPOS" Arial Regular
Table: "GPOS" ScriptCount: 0
No default script for "GSUB" Arial Regular
Table: "GSUB" ScriptCount: 1
    Script: "arab" LanguageCount: 1
        Language: "dflt" FeatureCount: 4
            Feature: "init"
            Feature: "medi"
            Feature: "fina"
            Feature: "liga"
other.runs 0 of 2 len 7 @ 0
setStyle 0 1 of 2 @ 0 .. 7
FirstInPar: 0 lastInPar: 6
"+f++o++o++b++a++r+"
"+0++0++0++0++0++0+"
"foobar"
ADD ITEM 0 6 "foobar"
Shaping: "foobar"
BlockLayouter::layoutLeft 0 5
RESULT 0 5
Add Par Box: "Block[0; 14; 34.0254; 10.8633 + 2.54297] 1 boxes"
render 1 1
render 1 1
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearCStyle()
Object::disconnect: (sender name: 'charStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
Object::disconnect: No such slot PropertyWidget_TextStyles::doClearPStyle()
Object::disconnect: (sender name: 'paraStyleClear')
Object::disconnect: (receiver name: 'styleWidgets')
Object::connect: No such slot PropertyWidget_TextStyles::doClearCStyle()
Object::connect: (sender name: 'charStyleClear')
Object::connect: (receiver name: 'styleWidgets')
Object::connect: No such slot PropertyWidget_TextStyles::doClearPStyle()
Object::connect: (sender name: 'paraStyleClear')
Object::connect: (receiver name: 'styleWidgets')
other.runs 0 of 2 len 7 @ 0
setStyle 0 1 of 2 @ 0 .. 7
render 1 1
render 1 1
other.runs 0 of 3 len 4 @ 0
setStyle 0 1 of 3 @ 0 .. 4
other.runs 1 of 3 len 4 @ 4
setStyle 1 2 of 3 @ 4 .. 4
FirstInPar: 0 lastInPar: 3
"+f++o++o+"
"+0++0++0+"
"foo"
ADD ITEM 0 3 "foo"
Shaping: "foo"
BlockLayouter::layoutLeft 0 2
RESULT 0 5
Cursor 0 Found Item 0 End 3

Program received signal SIGSEGV, Segmentation fault.
0x0000000000f238c5 in GlyphStore::itemCharCount(unsigned int) const ()
(gdb) continue
Continuing.
Scribus Crash
-------------
Scribus crashes due to Signal 0000011
Calling Emergency Save

Program received signal SIGSEGV, Segmentation fault.
0x00000000009bce12 in ScribusMainWindow::emergencySave() ()
(gdb) continue
Continuing.
[Thread 0x7fffdf8c3700 (LWP 27238) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) quit

Issue History

Date Modified Username Field Change
2008-11-14 22:39 Hellstorm New Issue
2009-05-10 10:50 Hellstorm Note Added: 0021706
2009-05-11 03:25 jghali Relationship added child of 0003965
2009-05-15 17:40 christoph_s Status new => assigned
2009-05-15 17:40 christoph_s Assigned To => pierremarchand
2009-05-15 17:40 christoph_s Target Version => 1.5.0svn
2009-05-15 18:01 pierremarchand Note Added: 0021746
2009-05-16 07:01 Hellstorm Note Added: 0021751
2009-05-16 09:49 pierremarchand Note Added: 0021753
2009-11-06 20:21 amthomas Note Added: 0022821
2009-11-06 22:31 amthomas Note Added: 0022822
2009-12-14 04:52 Hellstorm Note Added: 0022960
2009-12-14 04:53 Hellstorm Note Edited: 0022960
2011-10-19 20:18 ThomasG File Added: examples.tar.gz
2011-10-19 20:20 ThomasG Note Added: 0027057
2011-10-19 21:21 cezaryece Note Added: 0027058
2011-10-20 19:10 ThomasG Note Added: 0027073
2014-07-09 15:47 Kunda Status assigned => acknowledged
2016-03-22 23:53 Kunda Tag Attached: CJK
2016-04-18 14:36 Kunda Tag Attached: HOST-Oman