-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fontconfig error: Cannot load default config file #46
Comments
As I remember. the gtk2 doc (for windows) says fontconfig is not really used but it has to be there. Perhaps a static fonts.conf or is it some tailored monster like the pango.modules that has to be run on each users system? |
The solution is actually working on Windows. Concretely, FONTCONFIG_FILE will have to be defined in Shoes installer but to test on command line:
Created a _fonts.conf_ based on https://code.google.com/p/servetome/source/browse/trunk/stm/bin/fonts-windows.conf?r=3 <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
<!-- Font directory list -->
<dir>C:\Windows\Fonts</dir>
<dir>C:\WINNT\Fonts</dir>
<!-- Font cache directory list -->
<cachedir>~/.fontconfig</cachedir>
<!-- Accept deprecated 'mono' alias, replacing it with 'monospace' -->
<match target="pattern">
<test qual="any" name="family">
<string>mono</string>
</test>
<edit name="family" mode="assign">
<string>monospace</string>
</edit>
</match>
<!-- Accept alternate 'sans serif' spelling, replacing it with 'sans-serif' -->
<match target="pattern">
<test qual="any" name="family">
<string>sans serif</string>
</test>
<edit name="family" mode="assign">
<string>sans-serif</string>
</edit>
</match>
<!-- Accept deprecated 'sans' alias, replacing it with 'sans-serif' -->
<match target="pattern">
<test qual="any" name="family">
<string>sans</string>
</test>
<edit name="family" mode="assign">
<string>sans-serif</string>
</edit>
</match>
</fontconfig> |
You may try set PANGO_WIN32_DEBUG=true on Windows command line for _Pango-WARNINGS_ while using cshoes.exe but at your own risk. It spew logs at a speed no man can read. Redirecting output to a file got to 9 MB in mere seconds. |
So all we need is a static fonts.conf ? Or does it have to be created at install time , or every time shoes runs like pango.rc and pango.modules have to run for every invocation of Shoes in Linux and OSX which is why they use launch scripts? We removed the shoes.bat in 3.2 |
A static file is all you need to fix the for the fontconfig error. No idea what the launch scripts are for but they may be helpful to solve the Pango-WARNINGS. The warnings may otherwise be due to improper internal reference considering that Lacuna is indeed added to Shoes::FONTS. Pango-WARNINGS might need its own issue on this tracker. The fontconfig error is completely gone with the fonts.conf file above. |
Those pango warning are the same ones on linux and osx if there is no pangorc and pango.modules of pango-querymodules executable fails. Perhaps that could done at installation time by the installer but you'd have have all the files and dll's that pango-querymodules wants. Which we don't have because Windows doesn't use them. |
Alright. I will file an issue for Pango-WARNINGS with a recap as it seems to be unrelated to fontconfig error. Correct? To close this issue, it will be necessary to do the following:
|
The two commits from @ccoupe are effectively closing this issue. |
I find the cure (slow startup) to be worse than the cshoes warning message. |
From my email: Remove https://github.com/Shoes3/shoes3/blob/master/platform/msw/fonts.conf#L26 And add |
We have also created .fontconfig in the users home dir instead of the localized AppData\Local\Shoes. Sigh. To summarize - Shoes.FONTS is not filled in without the fonts.conf and env var. That's not good. With those fixes, Shoes can be slow to startup (once or twice) and we get an unwanted file in user space. That's annoying. I can live with annoying for 3.2.21 but is issue is not closed. |
You are right. Maybe the tightmingw rakefile could use ERB on font.conf to replace the path. This is what I normally use in commercial software. In fonts.conf change the cachedir for require 'erb'
@shoes_home = File.join(LIB_DIR, Shoes::RELEASE_NAME)
File.open("fonts.conf", "w") { |f|
template = File.read("fonts_template.conf")
f.write(ERB.new(template).result(binding))
}
My recommendation is to close this issue because it is resolved. There are so many new issues that we should close what is fixed, it has deep psychological effects. However, in the process, we discovered additional issues. I will file a new issue with a summary of what we talked about. Would you agree to this? |
But for a simple Shoes install there is no erb. We don't even run a .bat to start shoes. No chance to do anything. Nor can the rakefile know what the localized name for AppData is. It's a matter of definition on 'resolved'. #48 is open and any solution to this one will involve that one. |
Shoes.exe and cshoes.exe display this error on the console:
Potential solution is to provide a fonts.conf file and including it in the Shoes directory and/or (perhaps) define environment variable FONTCONFIG_FILE to the fonts.conf path and name. On *NIX platforms, it is likely properly set to /etc/fonts/fonts.config or something alone this line.
The text was updated successfully, but these errors were encountered: