How to change FileMerge's font/settings/preferences?
Asked Answered
M

9

14

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.

Melodic answered 2/8, 2017 at 9:51 Comment(0)
S
12

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.

Sumner answered 18/12, 2017 at 12:14 Comment(5)
Big bummer that trying to change the font size from FileMerge.app's preferences panel doesn't work. Your workaround works wonderfully.Gan
That file does not exist for me :(Daric
It was created after I changed the highlighting color. For some reason it doesn't respect the changes to background color :(Daric
I'm surprised this feature is not present on macOS Mojave, I suppose I have to use an old "Invert Colors" workaround for dark mode: https://mcmap.net/q/202876/-how-to-theme-the-entire-xcode-ide-to-light-on-darkSkelton
Used the Feedback Assistant app to file a feedback regarding this bug (FB11985543).Sempach
I
4

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.
Inveigle answered 12/12, 2018 at 14:11 Comment(2)
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...Teal
Tried this on macOS 12.5 and it did not work.Staats
M
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).

Melodic answered 10/10, 2017 at 15:7 Comment(0)
T
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.

Tryout answered 6/9, 2017 at 19:5 Comment(1)
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.Tegular
T
1

None of this helped in my case on Big Sur, but this did the job. Requires sudo throughout so be careful.

  1. Make a copy of a theme within the xcode bundle:

sudo cp "/Applications/Xcode.app/Contents/SharedFrameworks/DVTUserInterfaceKit.framework/Versions/A/Resources/FontAndColorThemes/Default (Light).xccolortheme" "/Applications/Xcode.app/Contents/SharedFrameworks/DVTUserInterfaceKit.framework/Versions/A/Resources/FontAndColorThemes/fileComp.xccolortheme"

  1. Edit (in xcode for example) ~/Library/Preferences/com.apple.FileMerge.plist. Select the new theme by setting the XCFontAndColorCurrentTheme value to fileComp.xccolortheme

Specify the new theme file

  1. Edit the font values in new theme file fileComp.xccolortheme. Quit and restart FileMerge each time to apply.
Tremor answered 23/6, 2021 at 9:19 Comment(1)
Also didn’t work for me, in 2.11 (21012). Not proud of my former colleagues.Acarid
P
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.

Podium answered 21/7, 2020 at 6:53 Comment(0)
G
0

This worked for me:

  • macOS 12.6.3 (Dark Mode)

  • Xcode 14.2

  • FileMerge 2.11

My macOS is set for Dark Mode, and I noticed that in:

com.apple.FileMerge.plist

(in ~/Library/Preferences)

the key “XCFontAndColorCurrentDarkTheme” has the string value “Default (Dark).xccolortheme”. However, there was no such file in the folder that it was supposed to be in:

~/Library/Developer/FileMerge/UserData/FontAndColorThemes

There was a file there named “Default (Light).xccolortheme”, though, so I duplicated it and renamed the resulting duplicate file “Default (Dark).xccolortheme”, the filename that the com.apple.FileMerge.plist file points to. Then, in the Default (Dark).xccolortheme file, I edited the string values for the keys under these keys:

DVTSourceTextSyntaxColors

DVTSourceTextSyntaxFonts
Gleich answered 4/5, 2023 at 17:20 Comment(0)
R
0

There's a simpler solution than the ones listed here that involve manually editing .plist and .xccolortheme files. FileMerge is getting its font settings from the default theme in Xcode. So…

  1. Launch Xcode.
  2. Open Xcode Preferences.
  3. Go to the "Themes" tab of the preferences pane.
  4. In the left sidebar, find the "Default (Light)" and/or "Default (Dark)" theme, and change the specified font in that theme.

You may need to relaunch FileMerge for that change to take effect.

Rotogravure answered 7/3 at 15:20 Comment(0)
D
0

In my case, my system (Sonoma 14.4.1) didn't have the FileMerge folder anywhere inside ~/Library/Developer, but it did have the XCode one.

So I thought that maybe copying it after updating the XCode font settings would work, and to my surprise, it did work!

These are the steps:

  1. Change the XCode font as per sherlock42 answer
  2. Copy the XCode folder to FileMerge
cp ~/Library/Developer/Xcode ~/Library/Developer/FileMerge
  1. Enjoy your new font!
Disenchant answered 5/4 at 22:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.