Mac Tips and Tricks
Font
Q: How to check what font a website uses?
A: Use the Develop > Show Web Inspector (⌥⌘I), and search in the page’s source code, “font-family”.
Tips: you can use cursor to inspect an element.
The source code of the selected element will be highlighted.
- The
font-family
is under theComputed
tab. - You can inspect the url or an image using this way.
Download and install a font
- System fonts you can download show a download button in the Font Book app
.
- To install, do any of the following
- In the Font Book app, choose File > Add Fonts to Current User. In the window that appears, double-click the font file.
- Drag the font file to the Font Book app icon in the Dock, then click Install in the dialog that appears.
- Double-click the font file in the Finder, then click Install in the dialog that appears.
-
Download the font file.
Note: macOS supports
- TrueType (
.ttf
), Variable TrueType (.ttf
), TrueType Collection (.ttc
), - OpenType and OpenType-SVG (
.otf
), and - OpenType Collection (
.ttc
) fonts. - Legacy suitcase TrueType fonts and PostScript Type 1 LWFN fonts might work but aren’t recommended.
See the differences in these font files HERE.
Choose where to install fonts:
- Current User: Fonts are available only to you and are located in the Fonts folder in your home Library (
$HOME/Library/Fonts/
). - All Users: Fonts are available to any user on this Mac and are located in the Fonts folder in the system Library (
/Library/Fonts/
).
- TrueType (
-
In the Font Book app , choose File > Add Fonts to Current User. In the window that appears, double-click the font file.
When you’re installing fonts, Font Book lists any problems it finds for you to review. Font Book also checks for duplicate fonts.
When you install a font, there are typeface variations, such as, regular, bold, and italics.
A single font file contains only one font with one style (one of normal/oblique/italic) and one weight (one of normal/bold).
You do NOT need to install them all, only the ones you plan to use.
The full DejaVu fonts family contains following styles:
- Sans: Book, Bold, Oblique, Bold Oblique, Condensed, Condensed Bold, Condensed Oblique and Condensed Bold Oblique, Extralight
- Serif: Book, Bold, Italic, Bold Italic, Condensed, Condensed Bold, Condensed Italic and Condensed Bold Italic
- Mono: Book, Bold, Oblique, Bold Oblique
Source DejaVu
Where you can find Font resources:
- Online Font: https://online-fonts.com/fonts
- File > Resolve Duplicates.
-
Click an option:
- Resolve Automatically: Font Book deactivates duplicates or moves them to the Trash, depending on the option selected in Font Book settings.
- Resolve Manually: Continue to the next step to review and handle duplicates yourself.
- Examine the duplicates and their copies, then select a copy to keep. The copy that Font Book recommends keeping is labeled “Active” and is selected. To review other copies, select one.
- Click Resolve This Duplicate or, if there’s more than one duplicate, Resolve All Duplicates. If you want the inactive copies to go in the Trash, select “Resolve duplicates by moving files to the Trash when possible” in Font Book settings.
Change font name with FontForge
https://themissy.com/2018/font-tutorial-renaming-font-files-for-duplicates-and-organization
https://superuser.com/questions/472102/how-to-change-font-family-and-rename-font
Install the non-free MS Office fonts
It is possible to install the non-free MS Office fonts, which came with Office 2007 and Windows 7. Notably, this collection includes Calibri and Cambria, default fonts used in many MS Office documents.
Here we install the fonts available in the Microsoft PowerPoint Viewer (ppviewerFonts).
-
Download the Microsoft PowerPoint Viewer executable:
# download with `wget` wget https://archive.org/download/PowerPointViewer_201801/PowerPointViewer.exe # or with `curl` curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
Verify that it is the correct file:
sha256sum PowerPointViewer.exe
If the checksum doesn’t match
249473568eba7a1e4f95498acba594e0f42e6581add4dead70c1dfb908a09423
, then it’s not the right file. You can also save PowerPointViewer.exe.sha256 in the same directory and verify the checksum automatically with:sha256sum -c PowerPointViewer.exe.sha256
which should return
PowerPointViewer.exe: OK
. -
Extract the font installer.
You need a tool to extract the files from the executable. It may be possible to use
unrar
, butcabextract
is a better match for this use-case.Install
cabextract
if you don’t have it.brew install cabextract
Extract the part of the installer (
ppviewer.cab
) that has the fonts:cabextract PowerPointViewer.exe -F ppviewer.cab
-
Extract the font files (i.e.,
.ttf
,.ttc
) into your user’s font directory and install fonts.-
If you just want to install a specific font:
# create a folder to extract font files mkdir -p /Users/menghan/Documents/mac_setup/MS\ fonts/ppviewer # `-d` specifies the directory, otherwise will extract to the current folder, which is messy. cabextract ppviewer.cab -d /Users/menghan/Documents/mac_setup/MS\ fonts/ppviewer
Consolas is aimed for use in programming environments and other circumstances where a monospaced font is specified. It has four font styles:
File name Styles & Weights CONSOLA.TTF
Consolas Regular CONSOLAB.TTF
Consolas Bold CONSOLAZ.TTF
Consolas Bold Italic CONSOLAI.TTF
Consolas Italic Two options you can install the fonts:
-
use
open
CLT or# install `consola` font family open CONSOLA*.TTF
A dialog shows, press
Intall
font. You will install four font styles (regular, italic, bold, bold italic) at once. -
double-click and install with the Font Book app
The app allows a preview of the font you are installing, and it validate fonts to make sure no errors or no duplicate fonts are installed.
Select multiple files and double-click will open all styles at once. Otherwise, you need to install per style separately.
When you finish installing, the Font Book will show your fonts.
Click the
Details
tab, you can see where the font is installed. For me, it’s/Users/menghan/Library/Fonts/CONSOLA*.TTF
. Meaning the font is installed for the current user. -
-
If you want to install all fonts contained in the installer:
Deprecated
~/.fonts
:mkdir -p ~/.fonts/ppviewer/ cabextract ppviewer.cab -F '*.TTC' -d ~/.fonts/ppviewer/ cabextract ppviewer.cab -F '*.TTF' -d ~/.fonts/ppviewer/
In favor of the XDG Base Directory Specification,
~/.local/share/fonts
.Unless you’re using a legacy application that doesn’t recognize the newer XDG spec, it’s recommended to use that instead of
~/.fonts
:mkdir -p ~/.local/share/fonts/ppviewer/ cabextract ppviewer.cab -F '*.TTC' -d ~/.local/share/fonts/ppviewer/ cabextract ppviewer.cab -F '*.TTF' -d ~/.local/share/fonts/ppviewer/
After this step, you may delete
PowerPointViewer.exe
andppviewer.cab
.If your font-using application is already open, it’ll probably need to be restarted before it can use the newly-installed fonts.
-
Ref:
- https://wiki.debian.org/ppviewerFonts
- https://ikato.com/blog/how-to-install-consolas-font-on-mac-os-x.html
Q: Why Consolas (code font) looks smaller than Verdana (body text font) even under the same font size? See below. The first line is in Verdana and the second is Consolas. Both 12pt. Consolas is slightly shorter.
A: Consolas has a smaller x-height than Verdana. This is a font design issue.
Tip: The solution is to use matching fonts.
- If you really want to use Verdana for copy text, Lucida Console is probably the best choice for a monospace font.
- If you want to use Consolas as monospace font (fine!), then use another “C font” for copy text, such as Cambria (serif font) or Calibri or Candara (sans-serif fonts).
Q: Fonts are too small on some websites in Safari.
A: Preferences > Advanced > Accessibility, check the box Never use font sizes smaller than
, I set it to 14 pt.
MS Word
Q: How to add a font to MS Word?
A: You can install the font using the Font Book app , restart Word, it will be available then.
Embed fonts in Word documents
If you choose to embed fonts in your Word, when you share your document with someone else who doesn’t have the same fonts installed that you do, the fonts, layout, and styling of the document won’t change, and special characters won’t turn into meaningless rectangles.
If you do not embed fonts, the resulting document will be readable and editable with substitute fonts that are available to the recipient user.
Some fonts can be downloaded automatically if needed. If you both have active Office 365 subscriptions and you use one of the fonts provided with it, you shouldn’t have to embed it.
However, if you downloaded fonts from sites such as Google Fonts, including free-to-use ones, you’ll probably want to embed.
Preferences > Save > Font Embedding, check the box Embed fonts in the file
.
- When embedding a font, avoid using Embed only the characters used in the presentation. It is better to embed all the characters in a font so that another user can successfully edit the file, if necessary.
Q: Numbers are of different height.
A: Use a font that supports Lining Number Forms. Then
Font → Advanced → Number Forms → Lining.
Q: Preview looks correct, but the text does not change.
A: Restart Word and try again.
FaceTime
Don’t use FaceTime to make FaceTime Audio calls. This ends up using mobile service, which costs you largely. ❌
Instead, use the FaceTime Video to connect and turn off camera to make FaceTime Audio calls. ✅
Finder
You can customize the view for a folder—for example, how you want to sort your files. Then you can choose to always use the customized view settings for just that specific folder.
- Choose the folder, ⌘+J to open View Options.
- Customize the view for the selected folder.
Adjust column width
Right-click the column separator icon and select from one of the options:
- Right Size This Column (or double-click)
- Right Size All Columns Individually
- Right Size All Columns Equally
Finder Info Window
Comments
add your file description here. It will work for spotlight searches.
Scroll bars
-
System Settings > Appearance > Show scroll bars, has 3 options
-
Choose
When scrolling
. This will hide scroll bars until you start scrolling. This looks minimalistic. 简洁风。Always
andAutomatically based ...
looks cluttered. Thick heavy scroll bars show in Finder. More importantly, you can’t adjust column width by clicking anywhere on the column separator, you can only click the bottom.
TimeMachine
Q: Can I recover/view settings and specific files from a TimeMachine (TM) backup?
A: If your TM backup is on APFS partitions, you can connect to your TM, browse to the files you need, right click the files you need and select “Copy”, then exit TM and paste the copied files wherever you need.
Q: What type of disk partition should I use for Time Machine?
A:
-
APFS or APFS Encrypted disks are the preferred format for a Time Machine backup disk. If you select a new backup disk that’s not already formatted as an APFS disk, you get the option to erase and reformat it.
-
If the disk is a Mac OS Extended format disk that contains an existing Time Machine backup, you aren’t asked to erase and reformat the disk.
Note this is the case of my Wester Digital (WD) My Passport Drive. → Format to APFS
Mac OS Extended format
The Mac OS Extended (Journaled) format file system is the default file system for macOS 10.12 or earlier. It uses a journaling technique to help protect the integrity of a hierarchical file system and provides an encryption option you can use to protect data on a disk.
In macOS 10.13, it was replaced with Apple File System (APFS), the default file system for Mac computers with solid state drives (SSD).
Ref:
- Types of disks you can use with Time Machine on Mac
- Partition a physical disk in Disk Utility on Mac
Safari
Q: How to get icons in Safari favorites (aka favicons) to display correctly?
A: See post here: https://apple.stackexchange.com/a/294633.
Tips:
-
You can save the link with selected text. This is useful when you want to highlight some text in a webpage.
Select your text then right-click, choose
Copy Link with Highlight
.
Chrome Extensions
-
Enable Copy
偶尔会遇到一些网站把复制粘贴功能禁掉了,大多数应该是使用JavaScript代码实现的。如果确实需要复制网页上的文字,不必手打,可以使用Chrome浏览器的“Enable Copy”扩展来解除限制。或者,直接在网页权限里把脚本禁用就可以了。
插件使用方法:需要解除限制时,点击Enable Copy图标。当前网页和该网站下的所有网页都被解除限制。此时可以复制网页内容并粘贴到别处。
据说有安全隐患…
Q: 如何在 Chrome 禁用脚本?
A: Open Chrome DevTools (opt
+cmd
+I
or F12
) > Open Command Palette (shift
+cmd
+P
) > Type javascript
, a dropdown menu show “Disable JavaScript”, press Enter. JavaScript is now disabled.
To remind you that JavaScript is disabled, Chrome shows the corresponding icon in the address bar and DevTools shows a warning icon next to Sources.
JavaScript will remain disabled in this tab so long as you have DevTools open.
Preview
Q: How to rotate a text box?
A: Select the text box, then hold down Command. With two fingers on the trackpad (forefinger and middle finger), keep one finger stationary (forefinger) and let the second finger rotate the textbox in whichever direction you want.
BBEdit
Q: How to change the order of files in the sidebar?
A: The “Currently Open Documents” sidebar section header gets a popup menu, you can choose to rearrange the items in the list based on name, date, or history order (“Most Recently Opened”/”Least Recently Opened”).
微信输入法
在 Shift 切换中英文功能下,无法空格选择候词。
纯垃圾不能用
系统设置
睡眠设置
On your Mac, choose Apple menu > System Settings, then click Battery in the sidebar. > Click Options. (You may need to scroll down.)
- Stop automatic sleeping when the display is off: Turn on “Prevent automatic sleeping on power adapter when the display is off.”
- Your Mac or PC stays fully awake (CPU, apps, network, etc.) even if the screen goes dark.
- Useful if you want background tasks—like downloads, backups, or running servers—to continue without interruption.
- Put hard disks to sleep: Turn on “Put hard disks to sleep when possible.”
- Spins down (pauses) the hard drives after inactivity, while the rest of the system may remain awake.
- Reduces wear and power consumption of mechanical drives. Accessing data on the disk will “wake” the drive again, which can introduce a short delay.
外接显示器设置
Extend or mirror your Mac desktop across multiple displays
When you connect one or more external displays to your Mac, you can choose what appears on each display.
-
You can use video mirroring to show your entire desktop on each display.
-
You can extend your desktop across two or more displays, and choose which display shows the Finder and application menu.