Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits: 5e8a98b8 by Pier Angelo Vendrame at 2024-10-29T14:58:33+01:00 Bug 43140 (TB): Move fonts.conf to tor-browser.git.
The lack of fonts.conf cannot be handled only with Firefox preferences, therefore we decided to move the configuration files to the browser repository. This will partially mitigate the fingerprint differences of users that do not start the browser in the correct way.
- - - - -
3 changed files:
- − projects/browser/Bundle-Data/linux/Data/fontconfig/fonts.conf - projects/browser/RelativeLink/start-browser - projects/browser/build
Changes:
===================================== projects/browser/Bundle-Data/linux/Data/fontconfig/fonts.conf deleted ===================================== @@ -1,183 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> -<!-- -**DO NOT EDIT THIS FILE!** -This file sets Tor Browser's bundled fonts as the only available system fonts -and standardizes rendering settings. -Any changes might deanonymize you, or expose you to fingerprinting vectors. ---> -<!-- -Derived from fonts.conf.in of Fontconfig. - -Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard -Copyright © 2005 Patrick Lam -Copyright © 2009 Roozbeh Pournader -Copyright © 2008,2009 Red Hat, Inc. -Copyright © 2008 Danilo Šegan -Copyright © 2012 Google, Inc. - - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation, and that the name of the author(s) not be used in -advertising or publicity pertaining to distribution of the software without -specific, written prior permission. The authors make no -representations about the suitability of this software for any purpose. It -is provided "as is" without express or implied warranty. - -THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. ---> -<fontconfig> - -<!-- Font directory list --> - - <dir prefix="cwd">fonts</dir> - -<!-- - 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" binding="same"> - <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" binding="same"> - <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" binding="same"> - <string>sans-serif</string> - </edit> - </match> - -<!-- - Set our default generic families. ---> - <match target="pattern"> - <test qual="any" name="family"> - <string>sans-serif</string> - </test> - <edit name="family" mode="assign" binding="same"> - <string>Arimo</string> - </edit> - </match> - <match target="pattern"> - <test qual="any" name="family"> - <string>serif</string> - </test> - <edit name="family" mode="assign" binding="same"> - <string>Tinos</string> - </edit> - </match> - <match target="pattern"> - <test qual="any" name="family"> - <string>monospace</string> - </test> - <edit name="family" mode="assign" binding="same"> - <string>Cousine</string> - </edit> - </match> - -<!-- - tor-browser#41799, tor-browser-build#41237: Add some aliases for - compatibility. ---> - <match target="pattern"> - <test qual="any" name="family"> - <string>Arial</string> - </test> - <edit name="family" mode="assign" binding="same"> - <string>Arimo</string> - </edit> - </match> - <match target="pattern"> - <test qual="any" name="family"> - <string>Times New Roman</string> - </test> - <edit name="family" mode="assign" binding="same"> - <string>Tinos</string> - </edit> - </match> - <match target="pattern"> - <test qual="any" name="family"> - <string>Courier New</string> - </test> - <edit name="family" mode="assign" binding="same"> - <string>Cousine</string> - </edit> - </match> - <match target="pattern"> - <test qual="any" name="family"> - <string>Helvetica</string> - </test> - <edit name="family" mode="assign" binding="same"> - <string>Arimo</string> - </edit> - </match> - <match target="pattern"> - <test qual="any" name="family"> - <string>Times</string> - </test> - <edit name="family" mode="assign" binding="same"> - <string>Tinos</string> - </edit> - </match> - <match target="pattern"> - <test qual="any" name="family"> - <string>Courier</string> - </test> - <edit name="family" mode="assign" binding="same"> - <string>Cousine</string> - </edit> - </match> - -<!-- Font cache directory list --> - - <cachedir prefix="xdg">fontconfig</cachedir> - - <config> -<!-- - Rescan configuration every 30 seconds when FcFontSetList is called - --> - <rescan> - <int>30</int> - </rescan> - </config> - - <!-- Standardize rendering settings. --> - <match target="pattern"> - <edit name="antialias" mode="assign"><bool>true</bool></edit> - <edit name="autohint" mode="assign"><bool>false</bool></edit> - <edit name="hinting" mode="assign"><bool>true</bool></edit> - <edit name="hintstyle" mode="assign"><const>hintfull</const></edit> - <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit> - <edit name="rgba" mode="assign"><const>none</const></edit> - </match> -</fontconfig>
===================================== projects/browser/RelativeLink/start-browser ===================================== @@ -376,19 +376,6 @@ TOR_CONTROL_PASSWD environment variable." setControlPortPasswd ${TOR_CONTROL_PASSWD:='"secret"'} [% END -%]
-# Set up custom bundled fonts. See fonts-conf(5). -export FONTCONFIG_PATH="$browser_dir/fontconfig" -export FONTCONFIG_FILE="fonts.conf" -[% # tor-browser#41776: We cannot make the updater remove this file. - # So, let's remove it on this script, since we know that at this point the - # browser will not need it anymore. - # Remove once we do a watershed release. - -%] -[% IF c("var/tor-browser") -%] -# Old fontconfig directory, not needed anymore -rm -Rf "${HOME}/TorBrowser/Data/fontconfig" -[% END -%] - # Avoid overwriting user's dconf values. Fixes #27903. export GSETTINGS_BACKEND=memory
===================================== projects/browser/build ===================================== @@ -221,19 +221,6 @@ tar -C "${TB_STAGE_DIR}" -xf [% c('input_files_by_name/firefox') %]/browser.tar.
for tbdir in "${TBDIRS[@]}" do - [% IF c("var/linux") -%] - mv Bundle-Data/linux/Data/fontconfig "$tbdir/" - [% IF c("var/tor-browser") -%] - # tor-browser#41776: We cannot remove the old fontconfig file with the - # updater. So, let's keep it for the mar generation, but remove it from - # new packages. - # Remove once we do a watershed release. - oldfontconfig="$tbdir/TorBrowser/Data/fontconfig" - mkdir -p $oldfontconfig - cp "$tbdir/fontconfig/fonts.conf" "$oldfontconfig/" - [% END -%] - [% END -%] - mkdir -p "$tbdir/$DOCSPATH" cp -a Bundle-Data/Docs/* "$tbdir/$DOCSPATH" [% IF c("var/tor-browser") -%]
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/5e...