New user registration is currently disabled due to spam abuse / Регистрация новых пользователей в настоящее время приостановлена из-за злоупотреблений спаммерами

Unicode CJK Ext-B not displayed

General discussion

Unicode CJK Ext-B not displayed

Postby Keratoconus » Sat May 18, 2013 12:24 am

eg.:
Glyph like this
http://www.unicode.org/cgi-bin/GetUniha ... 0%A0%84%9E
U+2011E
in Goldendict 1.0.1 can not be displayed:
2013-05-18_081656.jpg
Select all can see right' become white
2013-05-18_081656.jpg (48.68 KiB) Viewed 9982 times

2013-05-18_081329.jpg
Display as □
2013-05-18_081329.jpg (47.25 KiB) Viewed 9982 times
Keratoconus
 
Posts: 24
Joined: Fri Dec 28, 2012 1:07 am

Re: Unicode CJK Ext-B not displayed

Postby hanyl05 » Sat May 18, 2013 5:06 am

Can you tell me how to get the Chinese character dictionary, the second version in dsl format?

I want to test and check the problem.
hanyl05
 
Posts: 125
Joined: Mon Dec 05, 2011 1:00 pm

Re: Unicode CJK Ext-B not displayed

Postby timonwong » Sat May 18, 2013 5:45 am

First, you have to got font which support ExtB, for example, SimSun-ExtB (which is bundled with Windows7).

Then, save the following to "qt-style.css", and put that file into "%APPDATA%\GoldenDict"
NOTE: This is just a working example, you may want to custom for your own.

Code: Select all
* {
  font-family: "Segoe UI","Tahoma",Verdana,"Lucida Sans Unicode","SimSun-ExtB";
}
timonwong
 
Posts: 13
Joined: Wed May 01, 2013 4:56 am

Re: Unicode CJK Ext-B not displayed

Postby timonwong » Tue May 28, 2013 2:50 pm

Sorry, my previous approach only got control font fixed, it won't work for the article, actually, it's a bug in QtWebKit (font fallback doesn't work at wall), and didn't got fixed for years.

One workaround is using a only font that contains those EXTB glyphs, my suggestion is to use HanaMinB(花園明朝B), which contains sans-serif english glyphs, you can download it from http://fonts.jp/hanazono/, then add following code in your article-style.css:

Code: Select all
body {
  /* NOTE, since font fallback won't work, you can specifiy only one font here */
  font-family: HanaMinB;
}
timonwong
 
Posts: 13
Joined: Wed May 01, 2013 4:56 am

Re: Unicode CJK Ext-B not displayed

Postby Tvangeste » Tue May 28, 2013 4:14 pm

timonwong wrote:Sorry, my previous approach only got control font fixed, it won't work for the article, actually, it's a bug in QtWebKit (font fallback doesn't work at wall), and didn't got fixed for years.

Man, this is soooo annoying, isn't it?

I wonder if the font fallback works on Qt5's QtWebKit, which should be significantly updated...
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: Unicode CJK Ext-B not displayed

Postby Tvangeste » Tue May 28, 2013 4:17 pm

MWAHAHAHAHAH, searched for solution for this font fallback problem and found MY OWN post about it! :)

I'm afraid this is a Qt 4.8.x bug. If you save your article into an HTML file (F2) and open it in any normal browser, the content is correctly displayed. Qt 4's browser seems to be picking the first font in the list and not bothering to perform a proper W3C recommended Font matching algorithm.

I tried Qt 5's webview, and it actually renders the results properly. So, as soon as we port/migrate GoldenDict to Qt 5, this bug will be fixed automatically.

Meanwhile, I don't have good workaround for this problem. You might put the "Arial Unicode MS" at the beginning of the list.


So, we need to upgrade to Qt5 sooner or later. See Issue #212 for Qt5-related updates.
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: Unicode CJK Ext-B not displayed

Postby timonwong » Thu May 30, 2013 6:31 am

Tvangeste wrote:So, we need to upgrade to Qt5 sooner or later. See Issue #212 for Qt5-related updates.


Yes, looks good in QT5:
Qt5.png
Qt5.png (61.63 KiB) Viewed 9849 times



I'll try to upgrade upgrade to Qt5 and keep the compatibility with Qt4 as well (4.7 at least, I think).
timonwong
 
Posts: 13
Joined: Wed May 01, 2013 4:56 am

Re: Unicode CJK Ext-B not displayed

Postby Tvangeste » Thu May 30, 2013 7:49 am

timonwong wrote:I'll try to upgrade upgrade to Qt5 and keep the compatibility with Qt4 as well (4.7 at least, I think).

Ah, good! :)

The list of issues I've encountered when brute-forcing the sources to use Qt5, is listed here: https://github.com/goldendict/goldendict/issues/212

The major issue for me was the actual performance. Qt5's performance on Windows was very bad on the border of usable. Since then, there were two dot-dot releases 5.0.1 and 5.0.2, so maybe something's improved.

There is also a problem with newer GCC/Mingw compilers (and Qt5 requires the newe ones), but all our DLLs on Windows require the old ones, 4.6 or earlier. So it seems that starting the conversion to Qt5 on Linux would be easier.
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: Unicode CJK Ext-B not displayed

Postby Tvangeste » Thu May 30, 2013 8:19 am

Timon, just in case, here's my old and very dirty branch that I used to compile GD with Qt5, just in case:

https://github.com/Tvangeste/goldendict/tree/wip/qt5
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am


Return to General

Who is online

Users browsing this forum: No registered users and 113 guests