This sample demonstrates how to obtain language-specific font recommendations using the LanguageFontGroup class in the Windows.Globalization.Fonts namespace.

The LanguageFontGroup APIs (Windows.Globalization.Fonts namespace) can indicate an appropriate font to use for a given language. The caller is assumed to know the language, by whatever means; the API takes a language identifier tag and returns a recommended font. Scenarios in which this API is recommended are those that include text in multiple languages involving different character sets where a single font (even one specified in localized application resources) may not provide optimal results for all of the text. Two typical examples are:

Be aware that if the content to which the font is applied contains text that is actually in another language, the recommended font may or may not be able to support that language. If not, some text controls or frameworks that display the text might automatically select a different font during text layout as a fallback to ensure legible display.

To obtain an evaluation copy of Windows 8.1, go to Windows 8.1.

To obtain an evaluation copy of Microsoft Visual Studio 2013, go to Visual Studio 2013.

Note  For Windows 8 app samples, download the Windows 8 app samples pack. The samples in the Windows 8 app samples pack will build and run only on Microsoft Visual Studio 2012.

Related topics

Windows 8 app samples

Operating system requirements

Client
Windows 8.1
Server
Windows Server 2012 R2

Build the sample

  1. Start Visual Studio 2013 and select File > Open > Project/Solution.
  2. Go to the directory in which you unzipped the sample. Go to the directory named for the sample, and double-click the Microsoft Visual Studio Solution (.sln) file.
  3. Press F7 or use Build > Build Solution to build the sample.

Run the sample

To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.