Bug 58324 - VIEWING: In Libreoffice 4.0 Beta1, Writer fail to find other fonts for displaying unicode characters.
Summary: VIEWING: In Libreoffice 4.0 Beta1, Writer fail to find other fonts for displa...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.0.beta1
Hardware: x86 (IA32) Linux (All)
: highest critical
Assignee: Caolán McNamara
URL:
Whiteboard: BSA target:4.1.0 target:4.0.0.2
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-12-15 07:41 UTC by minhsien0330
Modified: 2013-01-24 05:41 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
The ODT file to show this problem. (8.99 KB, application/vnd.oasis.opendocument.text)
2012-12-15 07:41 UTC, minhsien0330
Details
Screenshot: Libreoffice 4.0 beta failed to find other font to display the unicode word. (24.30 KB, image/png)
2012-12-15 07:43 UTC, minhsien0330
Details
Screenshot: Libreoffice 3.5.4 find other font to display the unicode word automatically. (19.28 KB, image/png)
2012-12-15 07:45 UTC, minhsien0330
Details
font list (555.28 KB, text/plain)
2013-01-14 04:38 UTC, minhsien0330
Details
font list (new) (645.77 KB, text/plain)
2013-01-14 06:02 UTC, minhsien0330
Details

Note You need to log in before you can comment on or make changes to this bug.
Description minhsien0330 2012-12-15 07:41:31 UTC
Created attachment 71535 [details]
The ODT file to show this problem.

Problem description: 
I upload a mi4.odt to show this problem.
In version 3.5.4, the chinese character 𥅽 can be shown correctly even though the current font did not contain this unicode character (see attachment lo-3.5.4.png).
But in version 4.0 beta, Writer would not show any character (see lo-4.0-beta1.png ), unless I manually selected a font that contains the unicode chinese character𥅽.
In shorts, Libreoffice 4.0 do not find other fonts to display unicode chinese characters while this characters  not found in current font, but Libreoffice 3.5.4 can do it automatically.
Is it a problem of PANGO ?

Note:
If you were using Debian, you will need to install fonts-arphic-uming or fonts-arphic-ukai to show this unicode chinese character.
You can download and extract them from the deb file if you were not Debian user:
http://packages.debian.org/sid/fonts-arphic-uming
http://packages.debian.org/zh-tw/sid/fonts-arphic-ukai

Steps to reproduce:
1. Install fonts-arphic-uming or fonts-arphic-ukai (Debian or Ubuntu), but do not set these 2 fonts as default font in Writer.
2. Open mi4.odt with Libreoffice 4.0 beta1 or 3.5.4
3. You will see nothing there if you open it with Libreoffice 4.0 beta1, but you will see a chinese word  if you open it with Libreoffice 3.5.4.

Current behavior:
 Libreoffice 4.0 do not find other fonts to display unicode chinese characters while this characters  not found in current font.

Expected behavior:
If the unicode character not found in the current font, Libreoffice 4.0 beta should try to search other fonts that contains this unicode character and to display it.


Operating System: Debian
Last worked in: 3.5.4 release
Comment 1 minhsien0330 2012-12-15 07:43:34 UTC
Created attachment 71536 [details]
Screenshot: Libreoffice 4.0 beta failed to find other font to display the unicode word.
Comment 2 minhsien0330 2012-12-15 07:45:07 UTC
Created attachment 71537 [details]
Screenshot: Libreoffice 3.5.4 find other font to display the unicode word automatically.
Comment 3 Urmas 2012-12-15 08:24:30 UTC
Could some developer close it as NOTABUG?
Comment 4 minhsien0330 2012-12-17 06:29:31 UTC
(In reply to comment #3)
> Could some developer close it as NOTABUG?

It's not a bug? For what?
Comment 5 Michael Stahl (allotropia) 2012-12-17 18:39:04 UTC
hmm... seems to work here, all LO 3.5/3.6/4.0/master versions i've tried
(incl. 4.0.0.0.beta1) show a chinese glyph for the bugdoc, though
obviously from a different font than in the screenshot.

i wonder, is this because i'm using a "newer" version of the
font in the document?  (testing on Fedora 17)

i don't know how to check if there is indeed some fallback going
on here; probably only Caolan can debug this...
Comment 6 Ferdous Azam Khan 2012-12-30 11:03:10 UTC
All respected contributor,

I find that if we close a document using the windows upper right corners cross button (even after saving it), during re opening the LibreOffice it starts the recovery process! But if we close the document from menu, then this problem does not happen.

I believe rectifying this would help millions of user around the world. Even in OO 2.0 I also found this problem.

Since I am new to this bug reporting area I might have posted it to wrong place. Apologies for inconveniences.

Thank you,
Ferdous
Comment 7 Caolán McNamara 2013-01-10 21:06:29 UTC
caolanm->minhsien0330: This "works for me" with those fonts installed. So presumably its because I have additional fonts installed which fontconfig suggests as better replacements.

So in order for me to attempt to reproduce this bug I need to 

a) get the full list of fonts you have installed so that I can synchronize my installed fonts with your installed fonts.

fc-list -v > /tmp/fontlist.txt

and attach /tmp/fontlist.txt here

b) get the output of "locale -a" because that can affect the suggested fallback font too.


caolanm@fk: Open a new bug for your different problem which is unrelated to this issue.
Comment 8 minhsien0330 2013-01-14 04:38:23 UTC
Created attachment 72980 [details]
font list

Dear Caolán McNamara:

The fontlist.txt is attached here.

And the result of "locale -a" is:
C
C.UTF-8
en_US.utf8
POSIX
zh_TW.utf8

Thanks a lot!
Comment 9 minhsien0330 2013-01-14 06:02:19 UTC
Created attachment 72983 [details]
font list (new)

Sorry, 
I added and removed some fonts, so I generate a new font list here.
Thanks a lot~
Comment 10 Urmas 2013-01-14 10:43:40 UTC
The word processor should not substitute arbitrary fonts for documents and display random glyphs with them.
Comment 11 Caolán McNamara 2013-01-14 13:10:42 UTC
caolanm->urmas; There's nothing arbitrary about it, if a font is missing or cannot render a requested glyph we request a suitable replacement from fontconfig. Obviously the result depends on the input font, requested glyph and available installed fonts.
Comment 12 Caolán McNamara 2013-01-14 15:29:21 UTC
surrogate pair seems to be getting chopped up
Comment 13 Not Assigned 2013-01-14 16:08:05 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0dd3b8b24364d31a00ef30b70dcc6fb63c5d96c9

Resolves: fdo#58324 keep both halves of surrogate pairs if glyph isn't found



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Caolán McNamara 2013-01-14 16:27:22 UTC
fixed for 4-1, patch submitted for 4-0 review
Comment 15 Not Assigned 2013-01-14 16:29:46 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=700da51c5629f3b6a9b7c8e651cabbeb66960731&h=libreoffice-4-0

Resolves: fdo#58324 keep both halves of surrogate pairs if glyph isn't found


It will be available in LibreOffice 4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 minhsien0330 2013-01-24 05:41:07 UTC
Dear Caolán McNamara:
I tried the daily builds(Time: 2013-01-21_10:33:51), and I found this problem is really soloved.
Thank you so much!

Best Regards,

Minhsien0330