10

For some time now, I can't change FileMerge's font. Then it suddenly started using a Helvetica-like font (sans serif, variable width) for files it doesn't recognize (like typescript source files). That could be changed temporarily to monaco by changing the font to ... Helvetica. Yes, it's very weird.

But now, it shows all text white on white, and only the changed section is visible because of the different background and I cannot change it. I've tried to locate all the pref files, and reinstalled Xcode, but the text remains white on white.

Does anyone know how to change that, or where which (pref) file to change?

It could be a write permission issue, since I'm running it from a non-admin account.

Thanks.

Tamás Sengel
  • 47,657
  • 24
  • 144
  • 178
TGV
  • 706
  • 4
  • 8

6 Answers6

9

This feature is completely broken, so you have to edit the theme file manually. It's located here:

~/Library/Developer/FileMerge/UserData/FontAndColorThemes/Default.xccolortheme

The file itself is plaintext XML. Even though it's pretty straightforward, I recommend backing it up first.

For example, if you want to increase the font size from "11.0" to "14.0", just do a find and replace.

You might be tempted to copy in a theme from Xcode. Don't bother. The font sizes don't appear to take effect, and FileMerge expects a white background, so darker themes won't work correctly.

Matthew Ratzloff
  • 4,114
  • 1
  • 25
  • 31
5

The other answers didn't work for me (as I didn't have any theme files), but the following did:

  1. Open FileMerge
  2. Go to Preferences
  3. Click the 'Set...' button under 'Font'
  4. Click the top of the Fonts window so that it gets focus (this is the key step - if the Fonts window doesn't get focus the changes won't stick). If the Fonts window has focus, you should see your changes reflected in the FileMerge Preferences window live as you make them.
Lucas
  • 867
  • 7
  • 15
  • It is most unintuitive that the Font Window does not automatically have focus when selecting different sizes. This worked for me. As for the other answers, I could not find ~/Library/Developer... – anjchang Jun 06 '19 at 17:49
2

The solution was to delete the folder ~/Library/Developer/FileMerge. It did not solve the font problem (typescript files rendered with proportional font of different size, which causes problems for long files).

TGV
  • 706
  • 4
  • 8
1

For me also the font panel settings have no effect at all. Same problem in XCode "Font & Colors" preferences.

For your colors problem, I would try quitting FileMerge, archiving the preference file, and relaunching:

mv ~/Library/Preferences/com.apple.FileMerge.plist ~/Library/Preferences/com.apple.FileMerge.plist.backup

FileMerge has a XCFontAndColorCurrentTheme setting:

defaults read com.apple.FileMerge XCFontAndColorCurrentTheme

I've tried setting that:

defaults write com.apple.FileMerge XCFontAndColorCurrentTheme "Presentation.xccolortheme"

But I don't see a difference. So maybe Apple is in the middle of revising this feature.

sam
  • 35,828
  • 2
  • 38
  • 36
  • The value for `XCFontAndColorCurrentTheme ` should match a file with the same name in path `~/Library/Developer/FileMerge/UserData/FontAndColorThemes/`. Try to change font setting in that file and remember that FileMerge app should be closed while doing so. – slashsbin Aug 09 '18 at 11:43
0

In addition to the answers already given, if those do not work, check that the files you are comparing are plain text and not rich text. If they're rich text, file merge will get the font attributes from the files themselves, hence you will not be able to affect the size of the font. You could instead open the files in a text editor and either convert them to plain text, or increase the size of the font manually.

Ash
  • 8,329
  • 2
  • 42
  • 48
0

You should create theme folder

mkdir -p ~/Library/Developer/FileMerge/UserData/FontAndColorThemes/

copy Theme file from Xcode.app package

cp "/Applications/Xcode.app/Contents/SharedFrameworks/DVTUserInterfaceKit.framework/Versions/A/Resources/FontAndColorThemes/Default (Light).xccolortheme"
~/Library/Developer/FileMerge/UserData/FontAndColorThemes/

And change font size inside of this file. ~/Library/Developer/FileMerge/UserData/FontAndColorThemes/Default.xccolortheme

it works on Big Sur version.

fragpit
  • 31
  • 1
  • 5