Skip to content

An Open Source Alternative to Corefonts #571

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

Closed
CuriousTommy opened this issue Aug 25, 2018 · 31 comments
Closed

An Open Source Alternative to Corefonts #571

CuriousTommy opened this issue Aug 25, 2018 · 31 comments

Comments

@CuriousTommy
Copy link

I have been noticing that a good amount of reports here require people to install corefonts. While it is fine for consumers to use winetricks to install the corefonts, the licenses forbids Valve (or any other company) from using the proprietary fonts.

As an alternative solution, there should be a library that intercepts any request for these propritary fonts and have the program use the open source equalivent instead (credit goes to FlukyS for the idea). I made a list of open source fonts that can be used instead on reddit.

@pchome
Copy link
Contributor

pchome commented Aug 25, 2018

More info: https://wiki.archlinux.org/index.php/Metric-compatible_fonts

@ryao
Copy link

ryao commented Aug 25, 2018

Are any of these fonts drop in replacements as far as Wine is concerned or is someone going to need to adapt them?

As for fonts, most games that require fonts need corefonts. It turns out that most of corefonts (6/11) were licensed to Microsoft by the Monotype Corporation:

https://en.m.wikipedia.org/wiki/Core_fonts_for_the_Web#List_of_fonts_and_files

That includes Arial and Times New Roman, which are the two most popular in corefonts. If it turns out that most games that need fonts need just the ones that Monotype Corporation owns, Valve might be able purchase/license the rights to them for the community. Then proton could provide the original fonts to games rather than substitutes.

By the way, if Monotype wants more money for the rights than it would cost to hire a full time developer for a year, I would rather see Valve hire a full time developer whose first task would be to fix the font situation using OSS substitutes.

@CuriousTommy
Copy link
Author

CuriousTommy commented Aug 25, 2018

Are any of these fonts drop in replacements as far as Wine is concerned or is someone going to need to adapt them?

The google fonts (not sure about the others) should be "metrically compatible" with the proprietary equivalent. In theory, I think it shouldn't cause issues. However, I don't think anyone has actually tested it. If I have some free time, I may try using the opensource font with Business tour (Issue #290) and see if it works.

Valve might be able purchase/license the rights to them for the community. Then proton could provide the original fonts to games rather than substitutes.

I wonder if Valve would be willing to do that. That would definitely make everyone's life easier.

With that being said, I still would also like to have an open source solution so that it is easier to distribute the font to any wine-based install without restrictions.

By the way, if Monotype wants more money for the rights than it would cost to hire a full time developer for a year, I would rather see Valve hire a full time developer whose first task would be to fix the font situation using OSS substitutes.

That was also another concern of mines. I just hope we can come up with a solution to this issue.

@shanefagan
Copy link

GTA5 also needs corefonts for the social club key activation, the game itself doesn't but you need to social club thing to load the game so having at least an answer like a fake corefonts included in proton or just catch the call for that font and give it something equivalent would be a big deal.

@CuriousTommy
Copy link
Author

CuriousTommy commented Aug 26, 2018

So I have recently made a repo that converts the opensource name/metadata to the corefont equivalent. I am currently away from my desktop so it will be a while before I am able to test this. I thought I will post this now so that people can test it and report their findings.

Edit: Use austin987's foss_corefonts instead. You can find a link to it below.

@austin987
Copy link

Has anyone tried liberation instead of corefonts? They're FOSS and supposed to be compatible with corefonts (unless the fontname is specifically checked iirc).

@CuriousTommy
Copy link
Author

CuriousTommy commented Aug 26, 2018

@austin987 Seeing that they are metrically compatible, I think they should work fine. I would just have to make minor changes to my script to so that they can mimic the corefonts.

But I would have to test to know for sure.

@shanefagan
Copy link

@austin987 yep liberation is fine but the issue is compatibility and something that is available to ship. Liberation checks the box sure for some fonts they need but they need to work on a way to intercept the font query from Windows and give it their own alternatives for each font needed.

@ryao
Copy link

ryao commented Aug 27, 2018

After some thought, if they are metrically compatible and fontconfig is setup such that fc-match reports them as being used for each of the names given to corefonts, I suspect that we could resolve this problem without any changes to proton. Of course, this needs to be tested, but if it works, we can arrange fixes at the distribution level.

If someone else does the R&D work to make that a reality, I am willing to handle getting this fixed in Gentoo (which means fixing it in child distributions such as Sabayon, Funtoo, maybe ChromeOS, etcetera). I have commit privileges to Gentoo, although I will need to coordinate with other maintainers rather than blindly committing. That is something that I can handle. Others would need to volunteer to do the same for Debian and Fedora for this to filter down users of distributions in the other two major Linux distribution families.

@shanefagan
Copy link

@ryao well wouldn't it be easier to configure WINE itself to do that? Most distros ship enough metrically compatible fonts so blanket just having a loopup and select from the list of available open fonts would work. Also note that there is the problem with not supporting certain languages on specific fonts either. So you have to be careful not just for size of fonts but also comparable language support.

@ryao
Copy link

ryao commented Aug 27, 2018

@shanefagan I installed corefonts using Gentoo's package manager on my machine. It made Age of Empires III happy just as if I had installed corefonts using winetricks. If the distributions are shipping metrically compatible fonts, then it would not be unreasonable to ask them to add a file in /etc/fonts/conf.avail/ and a symlink in /etc/fonts/conf.d/ to properly map corefonts to them.

The entire purpose of hooking into fontconfig should be to avoid a situation where the Wine project devotes resources to something that someone else can handle instead of something that only they can handle. They certainly can workaround distribution level issues, but it would come at a cost of slower development. I don't think that is an efficient use of resources, especially since this issue is approachable by the average person. They just need to read the documentation on fontconfig's XML format, make an appropriate XML file and get it reviewed by people familiar with fontconfig.

@CuriousTommy
Copy link
Author

CuriousTommy commented Aug 27, 2018

@ryao The question is can we get the wine team to add support for fontconfig. Is there any reason why they don't have it supported it so far (I can actually think of a few reasons why they might be against fontconfig)?

@CuriousTommy
Copy link
Author

I finally got access to my desktop and was able to do a quick test with the font. Here is the font in action. So at least we know that the font does work (at least for english).

@CuriousTommy
Copy link
Author

While I am at it... @aeikum, are you able to shed some light into why wine doesn't follow the fontconfig rules for binding font?

@ryao
Copy link

ryao commented Sep 2, 2018

@CuriousTommy I hadn't realized that wine itself wasn't using fontconfig. That is a really odd design choice. I guess it is possible to patch wine directly to handle this better if metric compatible fonts are available.

@nsivov
Copy link
Contributor

nsivov commented Sep 5, 2018

@ryao, @CuriousTommy, Wine is using fontconfig to build a list of available system fonts. Matching is more complicated because it involves Windows-specific configurable replacement mechanisms. It also works differently from fontconfig, and exists separately in gdi32 and directwrite, that are also different between the two.

It seems that correct approach will be to identify what exactly fails, and why is it fixable with additional fonts, on per-game basis.

@CuriousTommy
Copy link
Author

CuriousTommy commented Sep 5, 2018

@nsivov Thank you for responding. I am currently adding patches to protontricks so that people can easily test austin987 foss_corefonts package on games that require additional fonts.

I hope you don't mind responding to these statements (if you want to):

It seems that correct approach will be to identify what exactly fails...

In other words, we need to figure out what fonts are missing that would cause the program to crash, not display anything, or have any other wierd issues. Or do you mean something else?

...why is it fixable with additional fonts, on per-game basis.

I am not sure how to propose a testing solution for this question... Do you mean why one open source font would work fine while the other fails, or do you mean something else?

@nsivov
Copy link
Contributor

nsivov commented Sep 5, 2018

Exact or fully compatible font is not always absolutely necessary. What I mean is that it's important to figure out why some available font is not picked instead of missing one the game asked for.

@CuriousTommy
Copy link
Author

CuriousTommy commented Sep 5, 2018

I am not sure if this relates to our current issue, but I found this Microsoft document on fallback fonts. Is seems that both the applications and the operating system can set their own fallback font.

Windows 8 and above has an API that allows the operating system to suggest a fallback font, but do the games that need corefonts (or an alternative font) use these APIs?

@nsivov
Copy link
Contributor

nsivov commented Sep 5, 2018

They don't have to explicitly use any API, fallback, replacement and linking are different things. The point is that font selection should be likely improved - on Windows (in case of GDI), you can select non-existent font name, and still get some rendered text out of it, because something "suitable enough" will be picked as a last resort.

Anyway, this really depends on what application is doing in a first place, generalizing it like that is wrong I think.

@mimattr
Copy link

mimattr commented Sep 7, 2018

+1 Agree, the current Corefonts situation is an important issue for many.

From a development and licensing perspective it may be worth @kisak-valve and the team investigating Google's Croscore font alternatives (e.g. Arimo, Cousine & Tinos)

https://github.com/google/fonts

Hope that helps.

@AsciiWolf
Copy link
Contributor

+1, many games require corefonts to work properly.

@CuriousTommy
Copy link
Author

CuriousTommy commented Sep 21, 2018

Hi @kisak-valve, I was wondering if you would be able to check with the lawyer on the legality of modifying some of the font's metadata to mimic Microsoft's (or any other proprietary copyrighted) font. Everyone wants to avoid modifying the font itself for trademark concerns. But I would love to hear what a legal authority has to say on the matter (and whether this is a trademark issue or a copyright issue).

@nsivov I was thinking about what you said a while ago. Let say that I was interested enough to submit a report on a game that doesn't work (or render any text) without corefonts. Would I need to know any reverse engineering skills to help out?

@ryao
Copy link

ryao commented Oct 12, 2018

@CuriousTommy Microsoft does not actually own 6 out of the 11 core fonts. In theory, it would be possible to get a license to use them from the copyright holder.

@ghost
Copy link

ghost commented Oct 12, 2018

https://azure.microsoft.com/en-us/blog/microsoft-joins-open-invention-network-to-help-protect-linux-and-open-source/

Any patents that they're "sharing" be of benefit also can projects like Proton use patents from this pool.

@Holzhaus
Copy link

@daasuharo Microsoft's fonts are copyrighted. Patents have nothing to do with it.

@ghost
Copy link

ghost commented Oct 12, 2018

That's good information to know, thanks @Holzhaus

I came across this on wikipedia about design patents

"Typefaces may be protected by a design patent in many countries (either automatically, by registration, or by some combination thereof). A design patent is the strongest system of protection, but the most uncommon. It is the only US legal precedent that protects the actual design (the design of the individual shapes of the letters) of the font.[12] A prominent example is the European Union,[13] where the automatic protection (without registration) expires after three years and can be extended (by registration) up to 25 years.[14]

In 1981, Germany passed a special extension (Schriftzeichengesetz) to the design patent law (Geschmacksmustergesetz) for protecting typeface designs. This also permits typefaces to be registered as designs"

@HonkingGoose
Copy link

HonkingGoose commented Oct 29, 2018

For reference, here is a (partial) list of games/software that would seem to benefit from some kind of corefonts solution.

Games:

#17
#37
#44
#79
#290
#307 You need to manually select the right "corefont" from the Winetricks GUI: #307 (comment)
#462
#639
#727
#1317
#1539
#1666
#1733
#1755

Software:

#7

Launchers not working/looking right without corefonts:

  • Uplay launcher (Ubisoft).
  • Rockstar Social Club launcher for Grand Theft Auto 5.

@barni2000
Copy link

@ghost ghost mentioned this issue Oct 30, 2018
@HonkingGoose
Copy link

Well with Proton 3.16-4 Beta it seems we got what we wanted? They apparently use Liberationfonts:

The Liberation(tm) Fonts is a font family which aims at metric compatibility with Arial, Times New Roman, and Courier New.

17e50d6
https://github.com/ValveSoftware/Proton/wiki/Changelog

From changelog:

Proton now ships with corefonts support. This should fix many games with missing text, or that crash due to missing font support.

@aeikum
Copy link
Collaborator

aeikum commented Nov 1, 2018

Yes, as of 3.16-4, we are now shipping corefonts support in Proton itself, so workarounds and native packages should no longer be needed. Please mention remaining font issues in the existing issues for the affected games, or open new issues if the game does not have an open issue.

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

No branches or pull requests