Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-enumerate-system-fonts.md
T
Andy (Steve) De George be103da07e Replace various WPF include files with content (#1335)
* net-current-v30plus-md.md

* net-current-v40plus-md.md

* tla2sharptla-ui-md.md

* tla2sharptla-uiautomation-md.md

* tla2sharptla-winclient-md.md

* tla2sharptla-xaml-md.md

* tlasharptla-ui-md.md

* tlasharptla-uiautomation-md.md

* tlasharptla-winclient-md.md

* tlasharptla-xaml-md.md

* fix warnings
2022-03-16 12:14:11 -04:00

1.2 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 Windows Presentation Foundation (WPF) 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.