Bug 33898 - Fonts in user-defined region not displayed correctly (外字が正常に表示されません)
Summary: Fonts in user-defined region not displayed correctly (外字が正常に表示されません)
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Kohei Yoshida
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-04 04:07 UTC by aizuwakamatsu
Modified: 2022-03-31 08:29 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Correct PUA sample (364.60 KB, application/pdf)
2011-02-04 04:08 UTC, aizuwakamatsu
Details
NotCorrectPUA (318.26 KB, application/pdf)
2011-02-04 04:09 UTC, aizuwakamatsu
Details
PUA sample document. (22.81 KB, application/vnd.oasis.opendocument.text)
2011-02-04 04:09 UTC, aizuwakamatsu
Details
PUA Fontset 1. (878.91 KB, application/zip)
2011-02-04 04:16 UTC, aizuwakamatsu
Details
PUA Fontset 2 (209.49 KB, application/zip)
2011-02-04 04:16 UTC, aizuwakamatsu
Details
PUA Fontset merge. (545 bytes, text/x-msdos-batch)
2011-02-04 04:17 UTC, aizuwakamatsu
Details
for hacking purposes (728 bytes, patch)
2011-02-08 09:06 UTC, Caolán McNamara
Details
Sample of Bulletlilst and Linebreak (123.15 KB, application/pdf)
2011-02-21 19:53 UTC, aizuwakamatsu
Details
we could add this if it made a difference (867 bytes, patch)
2011-02-22 02:20 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aizuwakamatsu 2011-02-04 04:07:48 UTC
Sorry this text is Japanese.

説明が難しいことから、日本語で報告することをご容赦ください。

現在当市では、外字による人名表記を使用していますが、LibreOffice3.3で正常に表示されないという現象が確認されています。

本来ならば、添付のCorrectPUA.pdfの様に表示されなければなりませんが、
実際にはNotCorrectPUA.odtの通りになってしまいます。
OpenOffice3.3でも同様の状況です。

OpenOffce3.2.1では、EUDC.TTEを
 C:\Program Files\OpenOffice.org 3\Basis\share\fonts\truetype\eudc.ttf
にコピーしておくことで表示されていましたが、3.3では同様の方法は効果が無いようです。

外字が正常に表示されるよう修正をお願いいたします。

関連情報
http://search.luky.org/oo/openoffice.2003/msg06669.html

添付ファイル
CorrectPUA.pdf:正常な表示サンプル
NotCorrectPUA.odt:不正な表示サンプル
PUA_Sample.odt:外字文書サンプル
EUDC.zip:外字ファイル
Comment 1 aizuwakamatsu 2011-02-04 04:08:46 UTC
Created attachment 42921 [details]
Correct PUA sample
Comment 2 aizuwakamatsu 2011-02-04 04:09:19 UTC
Created attachment 42922 [details]
NotCorrectPUA
Comment 3 aizuwakamatsu 2011-02-04 04:09:49 UTC
Created attachment 42923 [details]
PUA sample document.
Comment 4 aizuwakamatsu 2011-02-04 04:16:10 UTC
Created attachment 42924 [details]
PUA Fontset 1.
Comment 5 aizuwakamatsu 2011-02-04 04:16:35 UTC
Created attachment 42925 [details]
PUA Fontset 2
Comment 6 aizuwakamatsu 2011-02-04 04:17:05 UTC
Created attachment 42926 [details]
PUA Fontset merge.
Comment 7 Cédric Bosdonnat 2011-02-04 05:51:02 UTC
Kohei, or anybody understanding japanese can help translating this?
Comment 8 Kohei Yoshida 2011-02-08 07:40:53 UTC
I'll work on that at a later time.  This is a pretty important issue for the Japanese deployments, and also a bit hard to explain in English.  But after I dig a bit deeper I'll translate it (if someone else doesn't beat me to it that is).
Comment 9 Kohei Yoshida 2011-02-08 07:43:53 UTC
This is also something I discussed with Caolan at FOSDEM (re. private area of fonts stored in this special file named EUDC.tte).
Comment 10 Kohei Yoshida 2011-02-08 09:01:55 UTC
Some relevant conversation with Caolan on IRC re this.

---
<caolan> kohei: ImplDevFontList::GetGlyphFallbackFont is the entry point into the shared platform glyph substitution stuff
<caolan> kohei: for the primitive windows glyph subcase I bet you'd go a long way by even just inserting "EUDC" at the start of the aGlyphFallbackList list in vcl
<caolan> oh hold it, they already try something like that there
* caolan is following in someones footsteps
---

Probably I should be the assignee for the time being, with Caolan in CC.
Comment 11 Caolán McNamara 2011-02-08 09:06:45 UTC
Created attachment 43120 [details]
for hacking purposes

cmc->kohei: As a quick hack, if you shove this patch in does it then "just work", or still fail horribly ?
Comment 12 Kohei Yoshida 2011-02-08 09:40:43 UTC
kohei->caolan: let me try that patch and see what happens there.  BTW, does FindFontFamily also look into the share/fonts/truetype location within the installation?  Part of the claim is that putting this EUDC font file into that location used to work, but no more in 3.3.  I have yet to verify that claim though.
Comment 13 Caolán McNamara 2011-02-08 12:28:33 UTC
re: "Part of the claim is that putting this EUDC font file into that
location used to work, but no more in 3.3.  I have yet to verify that claim
though."

It probably did, what I suspect makes the difference now is that in the past ImplDevFontList::GetGlyphFallbackFont for windows passed the "find missing glyph" stuff straight to the old hard-coded "hope for the best" ImplDevFontList::InitGenericGlyphFallback list which has eudc explicitly in it at the top.

But that now the win backend has a real glyph fallback implementation which doesn't have an explicit eudc hack in it, and so just gets random fonts which happen to have something filled in for the private area glyph requested, i.e. that the windows glyph fallback backend is now fairly equivalent to the Linux backend.
Comment 14 Kohei Yoshida 2011-02-15 20:14:20 UTC
Hi Caolan,

Sorry for the delay.  

The patch *does* make a difference.  With that change, the glyph fallback to the EUDC font is consistent no matter what font is specified in the US, provided that the EUDC.TTF is placed in the <install dir>/basis/share/fonts/truetype folder.  So, this is good news.

One thing to note, though, is that the original EUDC.TTE file is located in C:\Windows\Fonts (it's hardcoded, and even hidden so the user won't see it in the explorer window).  But LibO doesn't find it unless it's renamed to .TTF extension.  Copying EUDC.TTE into EUDC.TTF within the C:\Windows\Fonts folder alone is enough for this font to be recognized in LibO, but because Windows does some weird versioning of font files within that folder (not sure what it does exactly), sometimes it fails to get recognized.  So, putting it in the /basis/share/fonts/truetype inside the LibO installation is so far the most reliable way to get this font displayed properly.
Comment 15 Kohei Yoshida 2011-02-15 20:26:39 UTC
(In reply to comment #14)

> The patch *does* make a difference.  With that change, the glyph fallback to
> the EUDC font is consistent no matter what font is specified in the US,
                                                                      ^^
I meant in the *UI*
Comment 16 Caolán McNamara 2011-02-16 01:18:27 UTC
Yeah, windows does some caching thing or sommat for its fonts, so you typically need to logout and login, or restart or something like that when fiddling manually with fonts.

We should really try and find that font, so I'm guessing that WinSalGraphics::GetDevFontList and its EnumFontFamiliesExW is the first place to look. Either windows tells us about the font and we ignore it, or it doesn't tell us about it.

Maybe the win API call "EnableEUDC" has some bearing here.

I guess that if EnumFontFamiliesExW doesn't tell us about the font, and if EnableEUDC does nothing that there seems to be some registry keys documented that point to the .tte file, I guess we could try and scrape those out and explicitly add the .tte if we can find it.
Comment 17 Caolán McNamara 2011-02-18 05:46:21 UTC
So, 887aad738a3abf47ca224dcf6c8a2513cd4948ef libs-gui will try and use "EUDC", if available, as the first level glyph fallback font. That works for me under Linux and is as good as we can do under that platform.

It should also work under windows if the font is named .ttf and manually put into LibreOffice's local font dir.

Otherwise, if under windows EnableEUDC doesn't make it magically "just work", then from kohei's comments it looks like that the EUDC tte fonts are hidden from EnumFontFamiliesExW

So, we have WinSalGraphics::AddTempDevFont callable from WinSalGraphics::GetDevFontList which might work if a windows dev pulls out the value of the registry key SystemDefaultEUDCFont and calls addtempdevfont with that location.
Comment 18 Kohei Yoshida 2011-02-18 08:19:47 UTC
Thanks Caolan.  Much appreciated.
Comment 19 aizuwakamatsu 2011-02-21 19:53:03 UTC
Created attachment 43634 [details]
Sample of Bulletlilst and Linebreak

EUDC fonts are displayed correctly.
But, Symbol of Bullet List and Line Break are replaced with EUDC Fonts.
Comment 20 Caolán McNamara 2011-02-22 02:16:47 UTC
If the EUDC is used for the bullets dialog, it suggests that (the new) OpenSymbol wasn't found and so we've ended using glyph fallback there because we can't find OpenSymbol.

So, can you select the bullet in writer and see what font name is listed, i.e. find out what is the requested font. I assume its "OpenSymbol".

If so then this problem is due to not finding OpenSymbol. I suspect its either not installed, or perhaps an old OpenSymbol is installed somewhere else and confusing matters.
Comment 21 Caolán McNamara 2011-02-22 02:20:31 UTC
Created attachment 43643 [details]
we could add this if it made a difference

We could add this, but I think there's no real point. If OpenSymbol isn't found, then excluding EUDC from the priority list of fonts to use as fallback for it doesn't really achieve anything. I suspect this OpenSymbol thing is another manifestation of a different bug e.g. bug 30729
Comment 22 aizuwakamatsu 2011-02-22 21:29:36 UTC
I confirmed  Symbol of Bullet List and Line Break (and EUDC Fonts) are  display correctly.(With patch https://bugs.freedesktop.org/attachment.cgi?id=43120)

In order to display them properly, I had to reboot the PC.

Thank you very much!
Comment 23 hmoi 2011-04-01 02:19:53 UTC
Hi

I use LibreOffice 3.3.2 OOO330m19 (Build:201) tag libreoffice-3.3.2.1
On Windows XP SP3, Japanse.

Is the above mentioned patch already applied?
If not yet, could you please apply it?

Many CJK users are in need of using EUDC.

I areally ppreciate your help.
Comment 24 Caolán McNamara 2011-04-01 02:58:32 UTC
caolanm->hmoi: It will be in 3.4
Comment 25 hmoi 2011-04-03 17:22:43 UTC
hmoi->caolanm:
Thanks for letting me know. I appreciate that.
Comment 26 aizuwakamatsu 2011-05-23 21:26:27 UTC
We confirmed the EUDC-fonts ware displayed correctly in 3.4.0 beta when "EUDC-ttf" file was copied to "C:\Program Files\LibreOffice 3\Basis\share\fonts\trutype\".
Thanks.
Comment 27 Caolán McNamara 2011-05-24 06:59:56 UTC
score

I still think some extra windows magic could make it automatic if the EUDC is installed in the semi-standard system-wide/user-wide typical fashion, but that's a task for a windows dev
Comment 28 How can I remove my account? 2020-11-25 17:48:18 UTC
Even if the reference to EUDC in the code is just a few lines, I wonder how relevant it is any longer. And has it ever been relevant on anything else than Windows? Should we put it in #ifdef _WIN32? (Just happened to come across the code in the debugger.)