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

Improve loading system fonts #16229

Closed
stephanlachnit opened this issue Aug 13, 2024 · 3 comments
Closed

Improve loading system fonts #16229

stephanlachnit opened this issue Aug 13, 2024 · 3 comments
Assignees

Comments

@stephanlachnit
Copy link
Contributor

Feature description

Currently, ROOT loads fonts via the Root.TTFontPath. This makes a lot of sense from a ROOT maintainer perspective (simply ship all used fonts), but is a roadblock for a distribution maintainer (embedded files are usually not wished if not otherwise possible).

Thus, it would be nice if ROOT would additionally support fontconfig, which is the default way to find fonts on Linux. In particular, the font interface should first look into Root.TTFontPath and then fallback to fontconfig. This means that the font-finding interface needs two parameters: the font file name and a fontconfig name as fallback.

The current font interface is a bit all over the place. There is at least graf2d/graf/src/TTF.cxx, graf3d/gl/src/TGLFontManager.cxx and graf3d/gl/src/TGLText.cxx that handle font names, probably more.

Fedora uses this patch from @ellert to get rid of the non-free MS fonts (see also #8357), which is a good start but the patch is not really feasible upstream due to Windows/OSX support.

/cc @Axel-Naumann @dpiparo

Alternatives considered

No response

Additional context

No response

@couet
Copy link
Member

couet commented Aug 15, 2024

Thank you for your input. As you mentioned, fontconfig is a Linux utility, but we also need to support Windows and macOS. Additionally, we aim to achieve the best possible mapping to PostScript and PDF fonts (without loading fonts in PostScript). The font set was carefully chosen to ensure optimal mapping across all these backends. You can also include TPDF and TPostScript in the list of files related to fonts. Recently, due to licensing issues with Helvetica, we made some changes to the font files used to render ROOT fonts. Now, ROOT is shifting towards a new graphics system called "Web Graphics," where the latest graphics developments are happening. I believe this request should be considered for implementation in this new context, if feasible.

Copy link

Hi @couet, @linev,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely,
🤖

@linev
Copy link
Member

linev commented Oct 2, 2024

Not sure we want to provide possibility replace basic fonts in ROOT.
There are many other misc files like icons, images, macros which are distributed together with ROOT and cannot be avoided.

I just merge PR which shows usage of custom fonts with TWebCanvas. Any kind of TTF font can be used there.

https://github.com/root-project/root/blob/master/tutorials/webcanv/fonts_ttf.cxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants