Hacker News new | past | comments | ask | show | jobs | submit login

I am looking at the script I used to run foobar2000 in wine, it basically overwrote fontconfig envvars like

    export FONTCONFIG_FILE="$HOME/wine-fontconfig/fonts.conf"
    export FONTCONFIG_PATH="$HOME/wine-fontconfig"
where fonts.conf is something like

  <?xml version="1.0"?>
  <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
  <fontconfig>
    <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
      <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
    </its:rules>
    <dir>~/wine-fontconfig/TTF</dir>
    <include ignore_missing="yes">~/wine-fontconfig/conf.d</include>
    <cachedir>~/wine-fontconfig/font-cache</cachedir>
  </fontconfig>
and there's just one TTF font I want to use in the TTF folder. Then there are a bunch of references to systemwide fonts in the user.reg and system.reg registry files that I deleted manually, but I forget the exact keys - you can search for 'font' to find them. I also entered registry keys to redirect system fonts to the TTF I had provided, I think using [Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes] or maybe [1]. If you're running CLI tools this might not be needed.

If you ever launch wine in that prefix without these environment variables, it will rescan the system fonts and populate the registry again and that seems to slow down future launches.

Another thing that made a difference that I just remembered is opening winecfg 'Libraries' tab and adding an entry to set 'winemenubuilder.exe' and 'winebus.sys' to disabled. I am not sure what the consequences of the latter are but it didn't seem to break anything for my use case. There might be other inessential libraries you can disable here if they seem slow in WINE_DEBUG output, I also have winehid.sys disabled here but I can't remember if it made much difference.

[1] https://wiki.winehq.org/Font_Replacements




Another lead was from godbolt's use of wine to run cl.exe (msvc) - https://github.com/compiler-explorer/compiler-explorer/blob/... - I just learned about `firejail` so maybe interpreting this wrong - but it has this "private-etc passwd,fonts" which means these folders would be empty - according to this doc - https://man7.org/linux/man-pages/man1/firejail.1.html - so possibly they had similar issues


This is so awesome!!! Thank you!!!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: