Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-enumerate-system-fonts.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.3 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Enumerate System Fonts 03/30/2017
csharp
vb
typography [WPF], enumerating system fonts
fonts [WPF], enumerating
system fonts [WPF], enumerating
enumerating [WPF], system fonts
36e37791-55b9-4f01-a496-5cc10335e6a6

How to: Enumerate System Fonts

Example

The following example shows how to enumerate the fonts in the system font collection. The font family name of each xref:System.Windows.Media.FontFamily within xref:System.Windows.Media.Fonts.SystemFontFamilies%2A is added as an item to a combo box.

[!code-csharpTextOverview#100] [!code-vbTextOverview#100]

If multiple versions of the same font family reside in the same directory, the [!INCLUDETLA#tla_winclient] font enumeration returns the most recent version of the font. If the version information does not provide resolution, the font with latest timestamp is returned. If the timestamp information is equivalent, the font file that is first in alphabetical order is returned.