dslibris, uming.ttf, and Chinese xhtml

  • Ping Chung Ng

    Ping Chung Ng - 2010-06-16

    I downloaded dslibris and uming.ttf from sourceforge and installed them on R4. There is a problem (Guru Meditation Error) selecting the font in preference but it's ok if I just edit dslibris.xml. It is very nice using it to read English text; but it just doesn't show (traditional) Chinese in utf-8 (show garbage characters) while firefox shows the file correctly.

    Please kindly help. Thanks.

  • Ray Haleblian

    Ray Haleblian - 2010-06-16

    Can you post the file? Maybe I can see what's wrong…

  • Ping Chung Ng

    Ping Chung Ng - 2010-06-17

    Two things happened. 1) Even English text does is garbo when I choose uming.ttf or (just a try) mingliu.ttf, I must have just imagining that it worked 2) Using mingliu.ttf, I actually managed to get both Chinese and English text displayed correctly once when I fiddle with dslibris.xml. However, it is garbage again when I decided to change the font size.

    The Chinese text file is as follow:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html
      PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-This file was converted to xhtml by OpenOffice.org - see http://xml.openoffice.org/odf2xhtml for more info.-><head profile="http://dublincore.org/documents/dcmi-terms/"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title xml:lang="zh-Hans">- no title specified</title><meta name="DCTERMS.title" content="" xml:lang="zh-Hans"/><meta name="DCTERMS.language" content="zh-Hans" scheme="DCTERMS.RFC4646"/><meta name="DCTERMS.source" content="http://xml.openoffice.org/odf2xhtml"/><meta name="DCTERMS.provenance" content="" xml:lang="zh-Hans"/><meta name="DCTERMS.subject" content="," xml:lang="zh-Hans"/><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" hreflang="en"/><link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" hreflang="en"/><link rel="schema.DCTYPE" href="http://purl.org/dc/dcmitype/" hreflang="en"/><link rel="schema.DCAM" href="http://purl.org/dc/dcam/" hreflang="en"/><base href="."/><style type="text/css">
    @page { size: 20.999cm 29.699cm; margin-top: 2cm; margin-bottom: 2cm; margin-left: 2cm; margin-right: 2cm }
    table { border-collapse:collapse; border-spacing:0; empty-cells:show }
    td, th { vertical-align:top; font-size:12pt;}
    h1, h2, h3, h4, h5, h6 { clear:both }
    ol, ul { margin:0; padding:0;}
    li { list-style: none; margin:0; padding:0;}
    li span.odfLiEnd { clear: both; line-height:0; width:0; height:0; margin:0; padding:0; }
    span.footnodeNumber { padding-right:1em; }
    * { margin:0; }
    .Preformatted_20_Text { font-size:10pt; font-family:Courier New; margin-top:0cm; margin-bottom:0cm; }
    <!- ODF styles with no properties representable as CSS ->
    { }
    </style></head><body dir="ltr" style="max-width:20.999cm;margin-top:2cm; margin-bottom:2cm; margin-left:2cm; margin-right:2cm; "><p class="Preformatted_20_Text">聊齋誌異 </p><p class="Preformatted_20_Text">蒲松齡</p><p class="Preformatted_20_Text"> </p><p class="Preformatted_20_Text">聊齋自志 </p><p class="Preformatted_20_Text"> </p><p class="Preformatted_20_Text">   披蘿帶荔,三閭氏感而為騷;牛鬼蛇神,長爪郎吟而成癖。自鳴天籟,不擇好音,有由然矣。松落落秋螢之火,魑魅爭光;逐逐野馬之塵,罔兩見笑。才非干寶,雅愛搜神;情類黃州,喜人談鬼。聞則命筆,遂以成編。久之,四方同人,又以郵筒相寄,因而物以好聚,所積益夥。甚者:人非化外,事或奇於斷髮之鄉;睫在眼前,怪有過于飛頭之國。遄飛逸興,狂固難辭;永托曠懷,癡且不諱。展如之人,得毋向我胡盧耶?然五父衢頭,或涉濫聽;而三生石上,頗悟前因。放縱之言,有未可概以人廢者。 </p><p class="Preformatted_20_Text">   松懸弧時,先大人夢一病瘠瞿曇,偏袒入室,藥膏如錢,圓粘乳際。寤而松生,果符墨志。且也:少羸多病,長命不猶。門庭之淒寂,則冷淡如僧;筆墨之耕耘,則蕭條似缽。每搔頭自念:勿亦面壁人果是吾前身耶?蓋有漏根因,未結人天之果;而隨風蕩墮,竟成藩溷之花。茫茫六道,何可謂無其理哉!獨是子夜熒熒,燈昏欲蕊;蕭齋瑟瑟,案冷疑冰。集腋為裘,妄續幽冥之錄;浮白載筆,僅成孤憤之書;寄托如此,亦足悲矣!嗟乎!驚霜寒雀,抱樹無溫;吊月秋蟲,偎闌自熱。知我者,其在青林黑塞間乎!</p><p class="Preformatted_20_Text">康熙己未春日。</p></body></html>

  • Ping Chung Ng

    Ping Chung Ng - 2010-06-22

    I have sorted out the issue. It is about font size. It seems that any font size from 11 to 17 is causing Chinese not showing correctly. Tried 10 points (works but too small) , then gradually by trial and error settled on 18 points.

    uming.ttf is nice but maybe the font file is too big, so I occasional will get error 204 and have to reboot. mingliu.ttf is smaller but looks horrible. Finally settling on using driodfallback.ttf, which is small and quite readable.

    Also after I used OpenOfficer Writer to save dslibris.xml in unicode I can also use the preference function in the program to change fonts. So other than the fact that it will take a long time to open a very long book, everything is fine. I just need to cut the book in segments. Thanks for a very good piece of software.

  • Ray Haleblian

    Ray Haleblian - 2010-06-22

    Yes, I have the same issue with this font.
    There are other available fonts that behave better than uming, we should put them in the Asian font package.

  • Ray Haleblian

    Ray Haleblian - 2010-06-22

    Also, font caching should be improved to speed up layout of Asian text.

  • Ker

    Ker - 2010-09-28

    Can you teach me the steps that you used to make the font work?
    I have tried putting the ttf file into the font folder, and played around with font size, but I keep getting "Guru Meditation Error." I am curious too on what you edited on the dslibris.xml file to make it work.

    Also, where did you find the "driodfallback.ttf" file? I could not find it anywhere on the internet.

    Thank you kindly for your help!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks