Is there any way to set the default font to 16pts in iTerm2?

16

3

I am going through several fonts such as “Consolas” and “Source Code Pro” and noticed in iTerm2 there is no way to set default size to 16pts. Only 9pt, 10pt, 11pt, 12pt, 13pt, 14pt, 18pt, 24pt,... are available. What happened to 15pt, 16pt, 17pt?

CodeCrack

Posted 2015-09-03T23:18:36.087

Reputation: 213

Answers

23

You can also add custom values for font sizes. From the Font window, click the gear in the upper left, and choose "Edit Sizes".

box with gear

Then, enter your value.

size edit field

Justin W.

Posted 2015-09-03T23:18:36.087

Reputation: 346

Doesn't this just duplicate Maletor's answer? – fixer1234 – 2016-10-14T03:09:56.570

Didn't see that one - I've found images to be a little more useful when scanning a page with multiple answers. – Justin W. – 2016-10-14T16:42:03.557

@JustinW. It definitely did. Thank you for posting this. – CodeCrack – 2016-10-14T18:18:30.430

how do I open the font window – Aero Windwalker – 2017-08-30T05:51:10.550

2@AeroWindwalker Open preferences (top menu), click "Profiles", select the "Text" tab, then click "Change Font" – Justin W. – 2017-10-31T18:03:54.460

It works. Thank you – Hoang Trinh – 2019-06-30T05:05:19.540

5

You can click on the number below the 'Size' column and write any value.

enter image description here

cesalazar

Posted 2015-09-03T23:18:36.087

Reputation: 151

1Mine is just a drop down with set font sizes, I can't type my own. – CodeCrack – 2015-09-13T19:35:45.123

3CodeCrack, by default the box to type your own size does not show up. You have to resize that window for it to appear. – scetoaux – 2017-02-26T21:36:51.347

2

I haven't tested this, but a brief review of iTerm's source code suggests your font preferences are stored in a property list named DefaultBookmark.plist, under the keys Normal Font and Non Ascii Font. The default values both being Monaco 12, if you were to change it to Consolas 16 or Source Code Pro 16 it should do what you want. You should be able to find these files with the command find / -name DefaultBookmark.plist, and since the name "Default" suggests there may be other property lists, you can find them with grep -R "Normal Font" / or grep -R "Non Ascii Font" /

Please keep in mind that it seems to occasionally ignore the font size and come up with it's own as it has a class called FontSizeEstimator which has the following in its comments

Lines 11 - 12:

**  Description: Attempts to measure font metrics because the OS's metrics
**    are sometimes unreliable.

Lines 65 - 68:

size.width = advances[0];
size.width *= [aFont pointSize];
size.width /= CGFontGetUnitsPerEm(cgfont);
size.width = round(size.width);

Although it seems as if this is only used for estimating the size of the window, rather than the size of the font being rendered.

Matt

Posted 2015-09-03T23:18:36.087

Reputation: 275

0

You can edit the preference file with the following commands: cd ~/Library/Preferences/ open com.googlecode.iterm2.plist

Then use cmd+f to search Normal Font and Non Ascii Font, change the font size value from 14 to 16. Close the window and restart iTerm. Done:)

Just notice that the plist file is opened by Xcode, you may need to install Xcode to edit the plist file.

Han He

Posted 2015-09-03T23:18:36.087

Reputation: 101

0

Open 'Preferences', click on the 'Profiles' tab, further click on the 'Text' sub-tab,

Preferences

and select the font and size:
Profiles

Ameya

Posted 2015-09-03T23:18:36.087

Reputation: 1

0

Change the font sizes available in the Fonts window.

  1. In an app such as Mail or TextEdit, choose Format > Show Fonts, or Format > Font > Show Fonts.

  2. In the Fonts window, click the Action pop-up menu (cog), choose Edit Sizes, then do any of the following.

    • Add a font size: Type a new size, then click the Add button +.

    • Change the values on the slider: Type new values in the Max. and Min. fields.

    • Remove a font size: Select it in the list, then click the Remove button -.

    • Restore the original values: Click Reset Sizes.

  3. Click Done.

Source https://support.apple.com/kb/PH21568?locale=en_US&viewlocale=en_US

Maletor

Posted 2015-09-03T23:18:36.087

Reputation: 101

1

Please read How to reference material written by others in particular the section about quoting (which I've fixed for you).

– DavidPostill – 2015-10-29T23:14:35.657