Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default font does not support Unicode #1016

Open
Tracked by #1243
Meakk opened this issue Sep 30, 2023 · 16 comments
Open
Tracked by #1243

Default font does not support Unicode #1016

Meakk opened this issue Sep 30, 2023 · 16 comments
Labels
type:bug Something isn't working
Milestone

Comments

@Meakk
Copy link
Contributor

Meakk commented Sep 30, 2023

Describe the bug
The default font should support Unicode characters.

To Reproduce
Steps to reproduce the behavior:

  1. Open the file using f3d -n f3d\testing\data\(ノಠ益ಠ )ノ.vtp

image

Expected behavior

Supports Unicode characters in the file name actor and the title bar.

System Information:

  • OS: Windows

F3D Information
2.2 RC2

@mwestphal
Copy link
Contributor

not windows specific

@mwestphal mwestphal added this to the 2.4.0 milestone Oct 1, 2023
@mwestphal
Copy link
Contributor

duplicate of #42

@mwestphal
Copy link
Contributor

more info here.

@Ni-g-3l
Copy link
Contributor

Ni-g-3l commented Nov 28, 2023

Hello !

I found on many website that VTK support only ASCII character, and the only way to fix this is to modify default font used, by a font which embed Unicode character.

@mwestphal
Copy link
Contributor

good point, that is probably a possible fix.

@Ni-g-3l
Copy link
Contributor

Ni-g-3l commented Nov 28, 2023

I you want I can make some tests this week :)

@mwestphal
Copy link
Contributor

Ok!

Watch out, this may not be as simple as it looks like, here is what is neede imo:

  • Add a default font (with a free license) that support unicode in the resources
  • Change the default font by using the dedicated font option (check the libf3d doc)
  • Point to a location that works when building, installing and packaging F3D
  • Update all baselines that displays text
  • Ideally the font should be the same one we use with added unicode char, but this may not exist

Feel free to reach out on discord for help!

@snoyer
Copy link
Contributor

snoyer commented Nov 29, 2023

The window title being garbled on the original screenshot is a likely a separate encoding related issue as the OS (window manager?) should be able to display utf8 regardless of VTK's font choices.

@mwestphal
Copy link
Contributor

You are very probably right @snoyer

@snoyer
Copy link
Contributor

snoyer commented Nov 29, 2023

I tried some random greek to start easier (better font support/coverage than the japanese+indian+chinese from the original case) by doing cp ../testing/data/\(ノಠ益ಠ\ \)ノ.vtp "/tmp/Γειά σας.vtp" and used the DejaVu font from Fedora:

f3d-utf8

  • gnome-terminal's and Firefox's titles are ok
  • F3D's title is not ok
  • F3D's text actor is ok as DejaVu has the greek glyphs

@Ni-g-3l
Copy link
Contributor

Ni-g-3l commented Dec 3, 2023

Hello,

I tried a bunch of fonts which says that it supports Unicode. However only one is working for this type of CJK char.

Fonts :

  • Droid Sans
  • Droid Sans Fallback
  • Noto
  • Free Sans
  • Roboto
  • Deja Vu Sans
  • Liberation Sans
  • Arial Unicode MS (Screen bellow)
    image

I added some greek char to test both alphabet. However I cann't find if we can embed Arial Unicode MS to F3D I can't find the license ..

@mwestphal
Copy link
Contributor

Turns out its not that simple:
https://stackoverflow.com/questions/3370512/font-equivalent-to-arial-unicode-ms

We have a thread currently about it on discord, wanna chat ?
https://discord.com/channels/1046005690809978911/1179418393846231050

@Meakk
Copy link
Contributor Author

Meakk commented Dec 4, 2023

Title bar on Windows fixed here: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10737

@Meakk
Copy link
Contributor Author

Meakk commented Dec 4, 2023

Yes, Arial font requires a license, unfortunately.
It seems like it's possible to merge several Noto fonts: https://github.com/notofonts/nototools/blob/main/nototools/merge_fonts.py
To start, maybe we should try to merge NotoSans-Regular.ttf, NotoSansPhoenician-Regular.ttf (greek probably?) and all NotoSansCJKXX-Regular.otf and see if it works?

@mwestphal
Copy link
Contributor

The title bar has been fixed by #1090 and will be available in the next release. The text actor will not be fixed because we cannot ship a 50 mb font and VTK cannot fallback on system font. Should we close this @Meakk ?

@mwestphal
Copy link
Contributor

Title bar is still broken on some linux desktop env, so we can consider investigating that too.

@mwestphal mwestphal added the help wanted Please help with this issue! label Jan 7, 2024
@mwestphal mwestphal added type:bug Something isn't working and removed help wanted Please help with this issue! labels Jan 26, 2024
@mwestphal mwestphal removed this from the 2.4.0 milestone Feb 3, 2024
@mwestphal mwestphal added this to the 3.0.0 milestone Jul 5, 2024
@mwestphal mwestphal mentioned this issue Jul 13, 2024
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Status: Discuss
Development

No branches or pull requests

4 participants