Skip to content

Commit

Permalink
fix: crash on launch if the user didn't have sf symbols font
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Sep 4, 2020
1 parent 877c93c commit 58e9026
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions alt-tab-macos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
BF0C833D471343CEA3DEFE56 /* icon_512x512@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_512x512@2x.png"; sourceTree = "<group>"; };
BF0C83BD867F6A874F9953C9 /* fullscreen@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fullscreen@2x.png"; sourceTree = "<group>"; };
BF0C843C2EDF4EF3A7A2C64A /* app.svg */ = {isa = PBXFileReference; lastKnownFileType = file.svg; path = app.svg; sourceTree = "<group>"; };
BF0C8465A0A9EA2814A22C35 /* SF-Pro-Text-Regular-Full.otf */ = {isa = PBXFileReference; lastKnownFileType = file.otf; path = "SF-Pro-Text-Regular-Full.otf"; sourceTree = "<group>"; };
BF0C84E11784B3B0900D0963 /* app.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = app.icns; sourceTree = "<group>"; };
BF0C86370093A080DD5974D8 /* convert_svg_to_png.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = convert_svg_to_png.sh; sourceTree = "<group>"; };
BF0C87B913292EE53EDE4220 /* menubar-1.svg */ = {isa = PBXFileReference; lastKnownFileType = file.svg; path = "menubar-1.svg"; sourceTree = "<group>"; };
Expand All @@ -162,7 +163,6 @@
D04BA088B8A550D9367A4AAB /* it */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = it; path = InfoPlist.strings; sourceTree = "<group>"; };
D04BA099FA155FB4D517D66B /* PreferencesWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferencesWindow.swift; sourceTree = "<group>"; };
D04BA0AAAE82C72855DBBA26 /* update_appcast.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update_appcast.sh; sourceTree = "<group>"; };
D04BA0CDCFF1F0B1A77E3E86 /* SF-Pro-Text-Regular-Full.otf */ = {isa = PBXFileReference; lastKnownFileType = file.otf; path = "SF-Pro-Text-Regular-Full.otf"; sourceTree = "<group>"; };
D04BA0CE87BE264C52987ED1 /* 7 windows - 2 lines - wide window.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "7 windows - 2 lines - wide window.jpg"; sourceTree = "<group>"; };
D04BA0DA624C11069614C323 /* windows-theme.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "windows-theme.jpg"; sourceTree = "<group>"; };
D04BA0E071D2EDFDB9A20523 /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
Expand Down Expand Up @@ -834,11 +834,11 @@
D04BA9CA03317B315B267E21 /* resources */ = {
isa = PBXGroup;
children = (
D04BA0CDCFF1F0B1A77E3E86 /* SF-Pro-Text-Regular-Full.otf */,
D04BAC2FF99F629CD4ED20FC /* MainMenu.xib */,
D04BAC2B70BC798C57B0B492 /* l10n */,
D04BA7568B7165A7726306A7 /* icons */,
D04BA60A6D08C041F5BF8CC9 /* SF-Pro-Text-Regular.otf */,
BF0C8465A0A9EA2814A22C35 /* SF-Pro-Text-Regular-Full.otf */,
);
path = resources;
sourceTree = "<group>";
Expand Down
Binary file modified resources/SF-Pro-Text-Regular-Full.otf
Binary file not shown.
Binary file modified resources/SF-Pro-Text-Regular.otf
Binary file not shown.
2 changes: 1 addition & 1 deletion src/ui/main-window/ThumbnailFontIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ThumbnailFontIconView: ThumbnailTitleView {
self.init(size, shadow)
string = symbol.rawValue
// This helps SF symbols display vertically centered and not clipped at the top
font = NSFont(name: "SF Pro Text", size: (size * 0.85).rounded())
font = NSFont(name: "SF Pro Text", size: (size * 0.85).rounded())!
textColor = color
// This helps SF symbols not be clipped on the right
widthAnchor.constraint(equalToConstant: size * 1.15).isActive = true
Expand Down

0 comments on commit 58e9026

Please sign in to comment.