Bug 1382428 - International font function broken in packaged blender 2.7
Summary: International font function broken in packaged blender 2.7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: blender
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Luya Tshimbalanga
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-06 16:38 UTC by Cheng-Chia Tseng
Modified: 2017-03-05 14:56 UTC (History)
8 users (show)

Fixed In Version: blender-2.78-3.fc25 blender-2.78a-1.fc24
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-07 23:25:26 UTC


Attachments (Terms of Use)
Packaged blender cannot support international feature well (65.68 KB, image/png)
2016-10-06 16:38 UTC, Cheng-Chia Tseng
no flags Details
tofu in blender 2.78-3 (4.01 KB, image/png)
2016-10-20 16:03 UTC, Cheng-Chia Tseng
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1429196 None None None Never

Internal Links: 1429196

Description Cheng-Chia Tseng 2016-10-06 16:38:54 UTC
Created attachment 1207982 [details]
Packaged blender cannot support international feature well

Description of problem:
Blender supports internationalization since 2.6. 
I have downloaded official blender package myself, and the internationalization works well. I can change to "Traditional Chinese" language via checking "International Fonts" option in "File > User Preferences > System" dialogue, and then check "Interface" and "Tooltips" for my native language.

However, the version distributed by Fedora cannot take this advantage of blender.

If you open a terminal to launch blender, it will print out the message below:BLF_get_unifont: 'fonts' data path not found for international font, continuing
BLF_get_unifont_mono: 'fonts' data path not found for international monospace font, continuing


Version-Release number of selected component (if applicable):
2.77a

How reproducible:
Always

Steps to Reproduce:
1. launch blender
2. check "International Font" option in System tab of File > User Preferences dialogue
3. select Traditional Chinese as the language
4. check "Interface" and "Tooltips" to translate them into localized ones

Actual results:
You see many characters in supported language list are displayed as squares. And nothing happened after you applied the localization changes.

Expected results:
The internationalization work of blender should work fine out of box as the official one.

Additional info:
This is a regression because it occurred before and fixed once. See https://bugzilla.redhat.com/show_bug.cgi?id=867285

Comment 1 Cheng-Chia Tseng 2016-10-06 16:43:47 UTC
related old closed bug:
See https://bugzilla.redhat.com/show_bug.cgi?id=1002197

Comment 2 Luya Tshimbalanga 2016-10-06 17:41:33 UTC
Hello Cheng-Chia,
Thank you for reporting the issue. I was able to fully reproduce it and noticed the same problem when manually selecting these blender fonts. The fix is on the way and please test them once the new blender version comes.

Comment 3 Cheng-Chia Tseng 2016-10-07 13:09:24 UTC
No problem. Thank you! ;)

Comment 4 Luya Tshimbalanga 2016-10-19 05:16:55 UTC
Could you test this build please?
http://koji.fedoraproject.org/koji/taskinfo?taskID=16120340

Looking at the old 2.68 version, the file needed to fix the issue blf_lang.c is gone on 2.7.

Comment 5 Luya Tshimbalanga 2016-10-19 05:17:46 UTC
Please test 
http://koji.fedoraproject.org/koji/taskinfo?taskID=16120340

Comment 6 Cheng-Chia Tseng 2016-10-19 16:20:35 UTC
It's built with Rawhide. Sorry that I don't know how to test it. 
I'm using f25 Beta now.

Comment 7 Luya Tshimbalanga 2016-10-19 18:01:23 UTC
(In reply to Cheng-Chia Tseng from comment #6)
> It's built with Rawhide. Sorry that I don't know how to test it. 
> I'm using f25 Beta now.

Simply install as usual either via Software or terminal. Here is scratch build version made for Fedora 25: http://koji.fedoraproject.org/koji/taskinfo?taskID=16125883

Comment 8 Cheng-Chia Tseng 2016-10-20 16:03:19 UTC
Those packages cannot be installed via Software. The dependency cannot be met in f25 (libOpenImage) using the rpm command. The f25 packages were successfully upgraded with rpm command.

The test failed. Blender still showing squares (tofu) as characters.

Comment 9 Cheng-Chia Tseng 2016-10-20 16:03:54 UTC
Created attachment 1212565 [details]
tofu in blender 2.78-3

Comment 10 Cheng-Chia Tseng 2016-10-20 17:04:31 UTC
Maybe again the font packaging issue (blender uses a forked "Droid Sans" font but not changing the font name)?

Please see the discussion here https://bugzilla.redhat.com/show_bug.cgi?id=1002197#c22

Comment 11 Cheng-Chia Tseng 2016-10-20 17:13:24 UTC
I found blender cannot load /usr/share/fonts/blender/bmonofont-i18n.ttf.gz or
/usr/share/fonts/blender/droidsans.ttf.gz .

But it can load ttf files. I successfully apply some ttf fonts manually, but failed with those archived fonts.

Comment 12 Luya Tshimbalanga 2016-10-21 00:42:13 UTC
(In reply to Cheng-Chia Tseng from comment #11)
> I found blender cannot load /usr/share/fonts/blender/bmonofont-i18n.ttf.gz or
> /usr/share/fonts/blender/droidsans.ttf.gz .
> 
> But it can load ttf files. I successfully apply some ttf fonts manually, but
> failed with those archived fonts.

Could you try this build: http://koji.fedoraproject.org/koji/taskinfo?taskID=16142915 ?

Note that fonts-blender is renamed blender-fonts in adherence to the packaging guideline and it will be visible on Gnome Software. In addition, the ttf inside are no longer compressed.

Comment 13 Cheng-Chia Tseng 2016-10-21 15:44:12 UTC
It failed again.

blender keeps complaining:
BLF_get_unifont: 'fonts' data path not found for international font, continuing
BLF_get_unifont_mono: 'fonts' data path not found for international monospace font, continuing

I think blender has a default fixed font data path, and it just cannot find it where it should be.

Comment 14 Cheng-Chia Tseng 2016-10-21 15:55:06 UTC
I mean that the official release of blender did work well on this.

Maybe the sub-packaging process makes blender not finding the right path as it expects. 

So uncompressing those fonts might not be needed if we put the fonts data back to the place as the original file structure.

Comment 15 Luya Tshimbalanga 2016-10-23 06:04:02 UTC
(In reply to Cheng-Chia Tseng from comment #13)
> It failed again.
> 
> blender keeps complaining:
> BLF_get_unifont: 'fonts' data path not found for international font,
> continuing
> BLF_get_unifont_mono: 'fonts' data path not found for international
> monospace font, continuing
> 
> I think blender has a default fixed font data path, and it just cannot find
> it where it should be.

The only difference is the official Blender is installed on the home directory while the packaged version for Fedora is on /usr/share directory. Despite applying the patch derived from the previous release, Blender still complains about the font path even though it is correctly set on "usr/share/fonts".


Lets just use the effective workaround by uncompressing the Blender fonts until a better solution is found on the future fix.

Reinstall Blender and its fonts
http://koji.fedoraproject.org/koji/taskinfo?taskID=16175398

Only the mono fonts path may fail for some reason but the translation for the interface should work.

Comment 16 Cheng-Chia Tseng 2016-10-23 11:12:37 UTC
I finally figured it out.

Blender only picks the compressed font archives in its own data structure, that means you must place those font archives into /usr/share/blender/2.78/datafiles/fonts directory, and everything works well.

Trying to separate those font archives and place them at /usr/share/fonts makes blender cannot use those fonts made for international usage.

Furthermore, those fonts are derived works of droid sans (which means it use the same name as droid sans, but contains more glyphs from other international fonts besides western fonts). So users will receive unpredictable font display because the repeating font name will make fontconfig confuse.

So the new packages you built does not improve the issue. Blender keeps complaining not finding those font archives in the place it expects, so those Chinese translations are STILL squares (tofus) even with your latest build. Even worse the blender-fonts package break the default font selection for Chinese environment.

Before installation of the latest blender-fonts package you built, the default CJK font of Chinese is SourceHanSansTW-Regular.otf: "思源黑體 TW" "Regular". But after the installation, the default font changed to droidsans.ttf: "DejaVu Sans" "Book" (which blender provides). That introduces an regression. (you can use 'fc-match -s sans-serif' to check this in zh_TW locale)

So what I suggest is not to uncompressed those font archives and see them as a part of blender because they are not designed to be used globally, but only as a fallback internatinoal font to display those translations internally in blender itself. If we must separate the font packaging, just intall them in /usr/share/blender/2.78/datafiles/fonts directory, then everything will works as fine as it should be.

Comment 17 Luya Tshimbalanga 2016-10-24 19:49:44 UTC
(In reply to Cheng-Chia Tseng from comment #16)
> I finally figured it out.
> 
> Blender only picks the compressed font archives in its own data structure,
> that means you must place those font archives into
> /usr/share/blender/2.78/datafiles/fonts directory, and everything works well.
> 
> Trying to separate those font archives and place them at /usr/share/fonts
> makes blender cannot use those fonts made for international usage.

Thank you for explaining how Blender looks to the archived fonts. Fedora Guideline rules that no fonts should be outside the path */user/share/fonts/*. However, symlink that path may do the trick. I modified blender-fonts for that purpose and left these fonts uncompressed.

Please reinstall blender-fonts from this build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=16189344

And let know if that fix the issue.

Comment 18 Cheng-Chia Tseng 2016-10-25 04:46:02 UTC
hi, the build failed. :S

Comment 19 Luya Tshimbalanga 2016-10-25 06:37:19 UTC
(In reply to Cheng-Chia Tseng from comment #18)
> hi, the build failed. :S

It turned out symlink failed. I applied your suggestion and you can try
koji.fedoraproject.org/koji/taskinfo?taskID=16192047

Comment 20 Cheng-Chia Tseng 2016-10-25 07:24:00 UTC
The international font function works well in this build! The problem is solved.

Thank you for your work! :)

Comment 21 Luya Tshimbalanga 2016-10-25 19:10:52 UTC
You are very welcome. I also thank you for testing the package and providing suggestion. Please add karma once the update is available.

Comment 22 Fedora Update System 2016-10-26 20:32:32 UTC
blender-2.78-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-22219b9310

Comment 23 Fedora Update System 2016-10-26 22:26:22 UTC
blender-2.78-3.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-458d0442e7

Comment 24 Fedora Update System 2016-10-28 00:43:14 UTC
blender-2.78-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2016-10-30 20:21:47 UTC
LuxRender-1.6-3.fc24, blender-2.78a-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-20f78cd21b

Comment 26 Fedora Update System 2016-11-07 23:25:26 UTC
LuxRender-1.6-3.fc24, blender-2.78a-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.