├── art └── screenshot.png ├── src ├── Resources │ └── Icon.png ├── Properties │ └── AssemblyInfo.cs ├── Commands │ ├── DecreaseEnvironmentFontSize.cs │ ├── IncreaseEnvironmentFontSize.cs │ ├── IncreaseFontSize.cs │ ├── DecreaseFontSize.cs │ └── Helper.cs ├── source.extension.cs ├── VSPackage.cs ├── VSCommandTable.cs ├── source.extension.vsixmanifest ├── VSCommandTable.vsct └── FontSizer.csproj ├── .gitignore ├── .gitattributes ├── LICENSE ├── appveyor.yml ├── FontSizer.sln └── README.md /art/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/FontSizer/master/art/screenshot.png -------------------------------------------------------------------------------- /src/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/FontSizer/master/src/Resources/Icon.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | packages 2 | 3 | # User files 4 | *.suo 5 | *.user 6 | *.sln.docstates 7 | .vs/ 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Rr]elease/ 12 | x64/ 13 | [Bb]in/ 14 | [Oo]bj/ 15 | 16 | # MSTest test Results 17 | [Tt]est[Rr]esult*/ 18 | [Bb]uild[Ll]og.* 19 | 20 | # NCrunch 21 | *.ncrunchsolution 22 | *.ncrunchproject 23 | _NCrunch_WebCompiler -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2016 Karl Shifflett 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using FontSizer; 4 | 5 | [assembly: AssemblyTitle(Vsix.Name)] 6 | [assembly: AssemblyDescription(Vsix.Description)] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany(Vsix.Author)] 9 | [assembly: AssemblyProduct(Vsix.Name)] 10 | [assembly: AssemblyCopyright(Vsix.Author)] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: AssemblyVersion(Vsix.Version)] 17 | [assembly: AssemblyFileVersion(Vsix.Version)] 18 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2019 2 | 3 | install: 4 | - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex 5 | 6 | before_build: 7 | - ps: Vsix-IncrementVsixVersion | Vsix-UpdateBuildVersion 8 | - ps: Vsix-TokenReplacement src\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"' 9 | 10 | build_script: 11 | - nuget restore -Verbosity quiet 12 | - msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m 13 | 14 | after_test: 15 | - ps: Vsix-PushArtifacts | Vsix-PublishToGallery 16 | -------------------------------------------------------------------------------- /src/Commands/DecreaseEnvironmentFontSize.cs: -------------------------------------------------------------------------------- 1 | using Community.VisualStudio.Toolkit; 2 | using Microsoft.VisualStudio.Shell; 3 | using Microsoft.VisualStudio.Shell.Interop; 4 | using Task = System.Threading.Tasks.Task; 5 | 6 | namespace FontSizer.Commands 7 | { 8 | [Command(PackageIds.cmdidDecreaseEnviornmentFontSize)] 9 | internal sealed class DecreaseEnvironmentFontSize : BaseCommand 10 | { 11 | protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) 12 | { 13 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.DialogsAndToolWindows, -2); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Commands/IncreaseEnvironmentFontSize.cs: -------------------------------------------------------------------------------- 1 | using Community.VisualStudio.Toolkit; 2 | using Microsoft.VisualStudio.Shell; 3 | using Microsoft.VisualStudio.Shell.Interop; 4 | using Task = System.Threading.Tasks.Task; 5 | 6 | namespace FontSizer.Commands 7 | { 8 | [Command(PackageIds.cmdidIncreaseEnviornmentFontSize)] 9 | internal sealed class IncreaseEnvironmentFontSize : BaseCommand 10 | { 11 | protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) 12 | { 13 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.DialogsAndToolWindows, 2); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/source.extension.cs: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ 2 | // 3 | // This file was generated by VSIX Synchronizer 4 | // 5 | // ------------------------------------------------------------------------------ 6 | namespace FontSizer 7 | { 8 | internal sealed partial class Vsix 9 | { 10 | public const string Id = "f7198797-d75d-4a7b-93c6-7bb56907735b"; 11 | public const string Name = "Font Sizer 2.0"; 12 | public const string Description = @"An easy way to change the font sizes in the editor and Visual Studio environment."; 13 | public const string Language = "en-US"; 14 | public const string Version = "1.0"; 15 | public const string Author = "Mads Kristensen"; 16 | public const string Tags = "font, presentation, zoom"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Commands/IncreaseFontSize.cs: -------------------------------------------------------------------------------- 1 | using Community.VisualStudio.Toolkit; 2 | using Microsoft.VisualStudio.Shell; 3 | using Microsoft.VisualStudio.Shell.Interop; 4 | using Task = System.Threading.Tasks.Task; 5 | 6 | namespace FontSizer.Commands 7 | { 8 | [Command(PackageIds.cmdidIncreaseFontSize)] 9 | internal sealed class IncreaseFontSize : BaseCommand 10 | { 11 | protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) 12 | { 13 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.TextEditor, 2); 14 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.StatementCompletion, 1); 15 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.TextOutputToolWindows, 1); 16 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.Tooltip, 1); 17 | await Helper.AdjustFontSizeAsync(Helper.CodeLensCategory, 1); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Commands/DecreaseFontSize.cs: -------------------------------------------------------------------------------- 1 | using Community.VisualStudio.Toolkit; 2 | using Microsoft.VisualStudio.Shell; 3 | using Microsoft.VisualStudio.Shell.Interop; 4 | using Task = System.Threading.Tasks.Task; 5 | 6 | namespace FontSizer.Commands 7 | { 8 | [Command(PackageIds.cmdidDecreaseFontSize)] 9 | internal sealed class DecreaseFontSize : BaseCommand 10 | { 11 | protected override async Task ExecuteAsync(OleMenuCmdEventArgs e) 12 | { 13 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.TextEditor, -2); 14 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.StatementCompletion, -1); 15 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.TextOutputToolWindows, -1); 16 | await Helper.AdjustFontSizeAsync(FontsAndColorsCategory.Tooltip, -1); 17 | await Helper.AdjustFontSizeAsync(Helper.CodeLensCategory, -1); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/VSPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Threading; 4 | using FontSizer.Commands; 5 | using Microsoft.VisualStudio.Shell; 6 | using Task = System.Threading.Tasks.Task; 7 | 8 | namespace FontSizer 9 | { 10 | [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] 11 | [InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)] 12 | [ProvideMenuResource("Menus.ctmenu", 1)] 13 | [Guid(PackageGuids.guidIncreaseFontSizePackageString)] 14 | public sealed class VSPackage : AsyncPackage 15 | { 16 | protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) 17 | { 18 | await JoinableTaskFactory.SwitchToMainThreadAsync(); 19 | 20 | await IncreaseFontSize.InitializeAsync(this); 21 | await DecreaseFontSize.InitializeAsync(this); 22 | await IncreaseEnvironmentFontSize.InitializeAsync(this); 23 | await DecreaseEnvironmentFontSize.InitializeAsync(this); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /FontSizer.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontSizer", "src\FontSizer.csproj", "{2F592D44-51C3-44E6-9D45-E1DBD3A1834C}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AE52A914-F76A-4D23-92AA-6F1728717999}" 9 | ProjectSection(SolutionItems) = preProject 10 | appveyor.yml = appveyor.yml 11 | README.md = README.md 12 | EndProjectSection 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {2F592D44-51C3-44E6-9D45-E1DBD3A1834C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {2F592D44-51C3-44E6-9D45-E1DBD3A1834C}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {2F592D44-51C3-44E6-9D45-E1DBD3A1834C}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {2F592D44-51C3-44E6-9D45-E1DBD3A1834C}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /src/VSCommandTable.cs: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ 2 | // 3 | // This file was generated by VSIX Synchronizer 4 | // 5 | // ------------------------------------------------------------------------------ 6 | namespace FontSizer 7 | { 8 | using System; 9 | 10 | /// 11 | /// Helper class that exposes all GUIDs used across VS Package. 12 | /// 13 | internal sealed partial class PackageGuids 14 | { 15 | public const string guidIncreaseFontSizePackageString = "1099b5c0-7023-4762-9cd9-008d1219c716"; 16 | public static Guid guidIncreaseFontSizePackage = new Guid(guidIncreaseFontSizePackageString); 17 | } 18 | /// 19 | /// Helper class that encapsulates all CommandIDs uses across VS Package. 20 | /// 21 | internal sealed partial class PackageIds 22 | { 23 | public const int EditorGroup = 0x1020; 24 | public const int EnvironmentGroup = 0x1021; 25 | public const int MyMenu = 0x1030; 26 | public const int cmdidIncreaseFontSize = 0x0100; 27 | public const int cmdidDecreaseFontSize = 0x0200; 28 | public const int cmdidIncreaseEnviornmentFontSize = 0x0300; 29 | public const int cmdidDecreaseEnviornmentFontSize = 0x0400; 30 | } 31 | } -------------------------------------------------------------------------------- /src/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Font Sizer 2.0 6 | An easy way to change the font sizes in the editor and Visual Studio environment. 7 | https://github.com/madskristensen/FontSizer 8 | Resources\LICENSE 9 | Resources\Icon.png 10 | Resources\Icon.png 11 | font, presentation, zoom 12 | 13 | 14 | 15 | 16 | amd64 17 | 18 | 19 | arm64 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Font Sizer 2 | 3 | [![Build status](https://ci.appveyor.com/api/projects/status/y16092oovynedyma?svg=true)](https://ci.appveyor.com/project/madskristensen/fontsizer) 4 | 5 | Download this extension from the [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=KarlShifflettkdawg.FontSizer) 6 | or get the [CI build](http://vsixgallery.com/extension/f7198797-d75d-4a7b-93c6-7bb56907735b/). 7 | 8 | --------------------------------------- 9 | 10 | An easy way to change the font sizes in the editor and Visual Studio environment. 11 | 12 | ### Credits 13 | A fork of the [FontSizer extension](https://github.com/craigeddy/FontSizer) that I updated to support Visual Studio 2019. 14 | 15 | ## Features 16 | Quickly change the editor's font sizes or the environment's font size. 17 | 18 | ![Tools menu](art/screenshot.png) 19 | 20 | Recommend assigning shortcut keys to each of the 4 commands. These are the commands I use: 21 | 22 | - CTRL + Num Pad Arrow Up = Increase editor font sizes 23 | - CTRL + Num Pad Arrow Down = Decrease editor font sizes 24 | - CTRL + Num Pad Arrow Right = Increase environment font size 25 | - CTRL + Num Pad Arrow Left = Decrease environment font size 26 | 27 | 28 | ### Change Editor Font Size 29 | Each time the respective Editor increase font size or decrease font size command is invoked the following changes are made: 30 | 31 | - TextEditor changes by 2 32 | - StatementCompletion changes by 1 33 | - TextOutputToolWindows changes by 1 34 | - Tooltip changes by 1 35 | - CodeLensCategory changes by 1 36 | 37 | ### Change Environment Font Size 38 | Each time the respective Editor increase font size or decrease font size command is invoked the environment font size is changed by 2. 39 | 40 | ## License 41 | [Apache 2.0](LICENSE) 42 | -------------------------------------------------------------------------------- /src/Commands/Helper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Community.VisualStudio.Toolkit; 3 | using Microsoft; 4 | using Microsoft.VisualStudio; 5 | using Microsoft.VisualStudio.Shell; 6 | using Microsoft.VisualStudio.Shell.Interop; 7 | using Task = System.Threading.Tasks.Task; 8 | 9 | namespace FontSizer.Commands 10 | { 11 | internal static class Helper 12 | { 13 | public const string CodeLensCategory = "{FC88969A-CBED-4940-8F48-142A503E2381}"; 14 | 15 | public static async Task AdjustFontSizeAsync(string categoryGuid, short change) 16 | { 17 | await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); 18 | 19 | IVsFontAndColorStorage storage = await VS.Shell.GetFontAndColorStorageAsync(); 20 | Assumes.Present(storage); 21 | // ReSharper disable once SuspiciousTypeConversion.Global 22 | var utilities = storage as IVsFontAndColorUtilities; 23 | if (utilities == null) 24 | { 25 | return; 26 | } 27 | 28 | var pLOGFONT = new LOGFONTW[1]; 29 | var pInfo = new FontInfo[1]; 30 | var category = new Guid(categoryGuid); 31 | 32 | ErrorHandler.ThrowOnFailure(storage.OpenCategory(category, (uint)(__FCSTORAGEFLAGS.FCSF_LOADDEFAULTS | __FCSTORAGEFLAGS.FCSF_PROPAGATECHANGES))); 33 | try 34 | { 35 | if (!ErrorHandler.Succeeded(storage.GetFont(pLOGFONT, pInfo))) 36 | { 37 | return; 38 | } 39 | 40 | pInfo[0].wPointSize = checked((ushort)(pInfo[0].wPointSize + change)); 41 | ErrorHandler.ThrowOnFailure(storage.SetFont(pInfo)); 42 | ErrorHandler.ThrowOnFailure(utilities.FreeFontInfo(pInfo)); 43 | } 44 | finally 45 | { 46 | storage.CloseCategory(); 47 | } 48 | } 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/VSCommandTable.vsct: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Font Sizer 23 | 24 | 25 | 26 | 27 | 28 | 36 | 44 | 52 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/FontSizer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | true 9 | Program 10 | $(DevEnvDir)\devenv.exe 11 | /rootsuffix Exp 12 | 13 | 14 | 15 | Debug 16 | AnyCPU 17 | 2.0 18 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 19 | {2F592D44-51C3-44E6-9D45-E1DBD3A1834C} 20 | Library 21 | Properties 22 | FontSizer 23 | FontSizer 24 | v4.7.2 25 | true 26 | true 27 | true 28 | true 29 | true 30 | false 31 | 32 | 33 | true 34 | full 35 | false 36 | bin\Debug\ 37 | DEBUG;TRACE 38 | prompt 39 | 4 40 | IDE0019 41 | 42 | 43 | pdbonly 44 | true 45 | bin\Release\ 46 | TRACE 47 | prompt 48 | 4 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | True 58 | True 59 | source.extension.vsixmanifest 60 | 61 | 62 | True 63 | True 64 | VSCommandTable.vsct 65 | 66 | 67 | 68 | 69 | 70 | 71 | Resources\LICENSE 72 | true 73 | 74 | 75 | true 76 | 77 | 78 | Designer 79 | VsixManifestGenerator 80 | source.extension.cs 81 | 82 | 83 | 84 | 85 | Menus.ctmenu 86 | VsctGenerator 87 | VSCommandTable.cs 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 17.14.2094 98 | runtime; build; native; contentfiles; analyzers; buildtransitive 99 | all 100 | 101 | 102 | 103 | 104 | --------------------------------------------------------------------------------